Thanks a lot.
Now its working but am getting this error
2008-12-08 16:06:56 [21683] [0] WARNING: mms_queueread: Mal-formed address
[+1000] in file
/home/kodiak/PRAMOD/mmsc/spool/mmsbox_incoming/o/qf4014.1.x683.43!
Attempting fixup.
2008-12-08 16:06:56 [21683] [0] DEBUG: Queued to thread 0 for
/home/kodiak/PRAMOD/mmsc/spool/mmsbox_incoming/o/qf4014.1.x683.43,
sendt=1228774014, tnow=1228774016

Also when am reading my content in cgi script am not getting the message
header from starting,
especially am not getting the From and to addresses(Bolded ones not coming),
but am getting the content length properly.
Attached my code also

POST /cgi-bin/Ne
w HTTP/1.1..Host
: 192.168.1.60:1
234..*Connection:
 keep-alive..Use
r-Agent: Mbuni/1
.4.0..X-Mbuni-Me
ssage-ID: o-qf40
[EMAIL PROTECTED]
ni..X-Mbuni-MMSC
-ID: testone..X-
Mbuni-From: +100
0/TYPE=PLMN..X-M
buni-Subject: Th
is is a test..X-
Mbuni-Transactio
nID: Mbuni-o-qf4
014.1.x683.43..X
-Mbuni-To: 5000/
TYPE=PLMN..Conte
nt-Type: multipa
rt/form-data; bo
undary=_boundary
_2090777907_1228
774016_O_z_bd136
0663108..MIME-Ve
rsion: 1.0..Cont
ent-Length: 3804
....*..--_boundar
y_2090777907_122
8774016_O_z_bd13
60663108..Conten
t-Disposition: f
orm-data; name="
fx"....true..--_
boundary_2090777
907_1228774016_O
_z_bd1360663108.
.Content-Disposi
tion: form-data;
 name="images[]"
; filename="cats
.gif"..Content-T
ype: image/gif..
..GIF89aP.P.....
..{{{.vZJ>2aG QE
6RJ:566FFGOIDxus
...YZX200cdb



On Mon, Dec 8, 2008 at 2:40 PM, Paul Bagyenda <[EMAIL PROTECTED]> wrote:

> Easiest way:
> -  Move to CVS code base
> - Have two separate conf files, one for mmsc, one for mmsbox
> - For mmsc, configure a vasp account, give it a short code (type eaif or
> soap -- doesn't matter)
> - for mmsbox, configure an mmsc connection. short code irrelevant
> - Run mmsc and mmsproxy
> - Use command-line mmssend (of mmsc) to send a message to the mmsc, to a
> short code of the VAS
> - mmsbox will receive the message in short order, process it, and send
> back.
>
>  Or something to that effect
> P.
>
> On Dec 08, 2008, at 09:56, Vijay wrote:
>
> Hi,
> Am testing locally since i dont have any live network interface or any
> tool.
>
> Can any one suggest any open source tool to test VAS gateway mbuni.
> Or any one let me know how to loop back to VAS gateway.
> Actually am running mmsbox, mmsproxy and mmsrelay on same machine.
> And given MMS url as mmsproxy mm7 port, so its sending to mmsrelay which is
> trying to send it to mobile.
> How to configure relay to route it to gateway treating it as VASP. Even
> though i gave terminating address as short code of VASP.
>
> Attached my config file
>
> send mms url
> http://192.168.1.60:13013/sendmms?username=gsms&password=gsms&to=+111&smil=
> <smil+xmlns="http://www.w3.org/2001/SMIL20/Language
> "+xml:lang="en"+title="SMIL+template">++<head>++</head>++<body><img+src="mmsFile11.jpg"+alt="a+Group+Mms+Msg"+longdesc="mms.txt"/>++</body></smil>&base-urlfile//home/kodiak
>
>
> --
> VIJAY
> <mbuni.conf>_______________________________________________
> Users mailing list
> [email protected]
> http://lists.mbuni.org/mailman/listinfo/users
>
>
>


-- 
VIJAY
//#include <iostream.h>
//#include <stdio.h>
//#include <stdlib.h>
#include "MmsCommon.h"
#include "MmsTCPClient.h"
#include "MmsTlvHandler.h"
#include "MmsDecoderMain.h"

int MmsDecoderMain::MmsDecode()
{
   char inpbuffer[10000];
   memset(inpbuffer, 0, 10000);
   printf("Content-type: text/html\r\n\r\n");
   printf("<html><head><title>CGI Echo Response</title></head><body>\n");
   printf("<h1>CGI Echo Response</h1>\n");
   printf("Length of the input is %d\n", strlen(inpbuffer));
   printf("inpbuffer %s\n",inpbuffer);
   int i = 0;

   char * ptr = getenv("REQUEST_METHOD");
   if (ptr != NULL) printf("Method: %s<br>\n",ptr);
   ptr =getenv("CONTENT_TYPE");
   if (ptr != NULL) 
      printf("Content_type: %s<p>\n", ptr);
   else
      printf("Content_type: NULL\n");

   FILE *fp;

   fp = fopen("/home/kodiak/Nags/Dummy.txt", "a+");
   char texting[] = "how are u";
   fwrite( texting, 1, strlen(texting), fp);
   fclose(fp);
   char *envPtr1;
   char chumma[200];
   envPtr1 = getenv("CONTENT_TYPE");
   int len =0 ;
   memset(chumma, 0, 200);
   envPtr1 = getenv("CONTENT_LENGTH");
   if (envPtr1 != NULL) 
      printf("Content Length: %s<p>\n", envPtr1);

   int length = atoi(envPtr1);
   fp = fopen("/home/kodiak/Nags/Dummy.txt", "a+");
   sprintf(chumma, "%s %s %d", "Env variable : ", envPtr1, length);
   fwrite(chumma, 1, strlen(chumma), fp);
   fclose(fp);
   memset(chumma, 0, 200);
   envPtr1 = getenv("QUERY_STRING");
   if (envPtr1 != NULL) 
      printf("Query String: %s<p>\n", envPtr1);
   fp = fopen("/home/kodiak/Nags/Dummy.txt", "a+");
   sprintf(chumma, "%s %s\n", "Query String : ", envPtr1);
   fwrite(chumma, 1, strlen(chumma), fp);
   fclose(fp);
   //Reading content from the  
   read(0,inpbuffer , length);
   printf("Query String: %s<p>\n", inpbuffer);

   fp = fopen("/home/kodiak/Nags/Dummy.txt", "a+");
   fwrite(inpbuffer, 1, length, fp);
   fclose(fp);
   MmsInfo l_MmsInfo;
   i = 0;
   /*char * Originator = strstr(inpbuffer, "X-Mbuni-From: ");
   while( (Originator[14+i] != '/'))
      i++;
   strncpy(l_MmsInfo.MmsOMdn, &(Originator[14]), i);
   printf("Originator : %s", l_MmsInfo.MmsOMdn);*/
   i = 0;
   char * Destination = strstr(inpbuffer, "X-Mbuni-To: ");
   while( (Destination[12+i] != '/'))
      i++;
   strncpy(l_MmsInfo.MmsTMdn, &(Destination[12]), i);
   printf("Destination : %s", l_MmsInfo.MmsTMdn);
   i = 0;
   //get the boundary length
   char * boundaryPtr = strstr(inpbuffer, "boundary=");
   int BoundaryLen = 0;
   while((boundaryPtr[BoundaryLen+10] != '\n'))
      BoundaryLen++;
   printf("BoundaryLen : %d", BoundaryLen);

   //get the content length of the image portion alone
   char * newptr1 = strstr(inpbuffer, "Content-Length:");
   newptr1 = newptr1+15;
   int len1 = newptr1 - inpbuffer;
   int ii = 1;
   while((inpbuffer[len1+ii]) != '\n')
      ii++;

   char lens[10];
   strncpy(lens, &(newptr1[1]), ii-1);
   int ll = atoi( lens);
    printf("Content-Length:%d\n", ll);
    ii--;
   //Start from boundary after content length and count length till image starting
   char *contBuf = newptr1 + ii+4; //1 for space and 4 for /n /n od oa od oa
   char * newptr = strstr(contBuf, "image/jpeg");
   int len2 = newptr - contBuf;
   len2 = len2 + strlen("image/jpeg") + 4;
   printf("Read Length : %d \n", len2);

   char inpbuffer1[4000];   
   BoundaryLen = BoundaryLen + 8;
   memcpy(inpbuffer1, &(contBuf[len2]), ll - len2-BoundaryLen);
   int tot = ll - len2-BoundaryLen;
   printf("Total image length :%d ConLen:%d ReadLen:%d", tot, ll, len2);
   printf("%x %x %x %x  %x \n  ", inpbuffer1[0], inpbuffer1[1], inpbuffer1[2], inpbuffer1[3], inpbuffer1[4]);
   printf("%x %x %x %x  %x \n  ", inpbuffer1[5], inpbuffer1[6], inpbuffer1[7], inpbuffer1[8], inpbuffer1[9]);
   printf("%x %x %x %x  %x \n  ", inpbuffer1[tot-5], inpbuffer1[tot-4], 
         inpbuffer1[tot-3], inpbuffer1[tot-2], inpbuffer1[tot-1]);

   //FILE *fp1;
   //fp1 = fopen("/home/kodiak/Wow4.jpg", "w+");
   //fwrite(inpbuffer1, 1, tot, fp1);
   memcpy(l_MmsInfo.MmsContent, inpbuffer1, tot);
   //fclose(fp1);

   char *localadd;
   strcpy(l_MmsInfo.MmsFile, "jpg");
   l_MmsInfo.MmsContentLength = tot;
   //printf("Destination File: %s", l_MmsInfo.MmsFile);
   localadd = getenv("LOCAL_IP_ADDRESS");
   if(localadd == NULL)
      localadd = "127.0.0.1";
   ACE_Time_Value tv(1);
   tSubsystemId l_SubsystemId = SUBSYSTEM_ID_NEH; //TBD Change value here
   //tSubsystemId l_SubsystemId = SUBSYSTEM_ID_HTTP_BILLING_AGENT;
   m_pTCCLibraryReference = &(TCPClientConnectorIface::getInstance());
   m_pTCCLibraryReference->initialize\
   (localadd, SUBSYSTEM_ID_BILLING_AGENT,tv);
   BillingInfTCPClient = new MmsTCPClient();
   unsigned int lport = 23232;

   //const tSubsystemId  lSubsystemId = SUBSYSTEM_ID_NEH;
   const tSubsystemId  lSubsystemId = SUBSYSTEM_ID_NEH;
   m_pTCCLibraryReference->addNewSubsystemIdMapping(lSubsystemId, lport);
   //Register the TCP Client object
   m_pTCCLibraryReference->registerClientObject\
   (BillingInfTCPClient,SUBSYSTEM_ID_NEH,"HTTP_AGENT");
   //(BillingInfTCPClient,SUBSYSTEM_ID_NEH,"HTTP_AGENT");
   char* pPttServerId = getenv("PTTSERVERID");
   //BillingInfTCPClient->setServerId(SUBSYSTEM_ID_NEH,pttServerId.c_str());
   BillingInfTCPClient->setServerId(SUBSYSTEM_ID_NEH,pPttServerId);

   m_pTCCLibraryReference->activate();
   unsigned char TlvBuffer[MMS_MAX_TLVMSG_SIZE];
   memset(TlvBuffer,0,MMS_MAX_TLVMSG_SIZE);
   //strcpy((char *)TlvBuffer, "hai how are u");
   length = 14;
   MmsTlvHandler::EncodeTLVMessage(l_MmsInfo, TlvBuffer, length); 

   sleep(10);
   BillingInfTCPClient->sendMessage(TlvBuffer, length);
   fp = fopen("/home/kodiak/Nags/Dummy.txt", "a+");
   char lbuffer[100];
   memset(lbuffer, 0, 100);
   sprintf(lbuffer, " O:%s D:%s Length:%d Type:%s", l_MmsInfo.MmsOMdn, l_MmsInfo.MmsTMdn, length, l_MmsInfo.MmsFile);
		   
   fwrite(lbuffer, 1, strlen(lbuffer), fp);
   fclose(fp);
   printf("</body></html>\n");
   return 0;
}

int main(int argc, char *argv[])
{
   /*string pttServerId; 
   string          dataBaseName;

   char* pPttServerId = getenv("PTTSERVERID");
   if ((pPttServerId != NULL) && (strcmp(pPttServerId, "") != 0))
   {
      pttServerId.assign(pPttServerId);
      dataBaseName.assign("DG_");
      dataBaseName.append(pPttServerId);
   }

    string dbDriverPath;
    dbuserinfo_t dbParam;
   
    // Get the ODBC library path from the environment variable.
    char* pOdbcPath = getenv("ODBC");
    if ((pOdbcPath != NULL) && (strcmp(pOdbcPath, "") != 0))
    {
        strcpy(dbParam.cRemoteDriverPath, pOdbcPath);
        strcat(dbParam.cRemoteDriverPath, "/lib");
   dbDriverPath.assign(pOdbcPath);
        cout << "Setting driver path to: " << dbParam.cRemoteDriverPath \
             << "." << endl;
    }
    else
    {
        cout << "ODBC driver path environment variable (ODBC) not set! "
                  "GrpSms will quit now." << endl;
        exit(0);
    }
    strncpy( dbParam.cDSNName, dataBaseName.c_str(), 100 );
    strncpy( dbParam.cPttServerId, pttServerId.c_str(), 100 );

    dbParam.nTimeOut = 30;
    LogClient::GetInstance()->Initialize( SUBSYSTEM_ID_RTX_GRPSMS, &dbParam );

   LogClient::GetInstance()->Log( LOG_CATEGORY_DEBUG_DETAIL,\
   "Entering GrpSmsMain::Initialize");*/

   MmsDecoderMain l_MmsDecoderMain;
   l_MmsDecoderMain.MmsDecode();
   exit(0);
   return 0;
}


_______________________________________________
Users mailing list
[email protected]
http://lists.mbuni.org/mailman/listinfo/users

Reply via email to