Interop of SIPP with Cisco PGW2200 and BTS10200 products. Both of these 
products include extra whitespace between the CSeq number and method.  SIPP 
cannot extract CSeq method and aborts scenario with unexpected message.

Example messages with extra white space in the CSeq header...
UDP message received [269] bytes :

SIP/2.0 100 Trying^M
Via: SIP/2.0/UDP  14.80.67.222:5060;branch=z9hG4bK-4662-1-0^M
From: "ScottP"<sip:[EMAIL PROTECTED];user=phone>;tag=1^M
To: <sip:[EMAIL PROTECTED]:5060;user=phone>^M
Call-ID: [EMAIL PROTECTED]
"testsip_uac_basiccodec_4662_messages.log" 62L, 2064C
To: <sip:[EMAIL PROTECTED]:5060;user=phone>^M
Call-ID: [EMAIL PROTECTED]
CSeq: 1       INVITE^M
Content-Length: 0^M
^M

----------------------------------------------- 2008-08-12 23:38:55:9.509
UDP message received [329] bytes :

SIP/2.0 180 Ringing^M
Via: SIP/2.0/UDP  14.80.67.222:5060;branch=z9hG4bK-4662-1-0^M
From: "ScottP"<sip:[EMAIL PROTECTED];user=phone>;tag=1^M
To: <sip:[EMAIL PROTECTED]:5060;user=phone>;tag=989824812^M
Call-ID: [EMAIL PROTECTED]
CSeq: 1       INVITE^M
Contact: <sip:[EMAIL PROTECTED]:5060>^M
Content-Length: 0^M
^M

Changes made in call.cpp to get this working:

void call::extract_cseq_method (char* method, char* msg)
{
char* cseq ;
if (cseq = strstr (msg, "CSeq"))
{
char * value ;
if ( value = strchr (cseq, ':'))
{
value++;
while ( isspace(*value)) value++; // ignore any white spaces after the :
while ( !isspace(*value)) value++; // ignore the CSEQ numnber
- value++
char *end = value;
int nbytes = 0;
/* A '\r' terminates the line, so we want to catch that too. */
while ((*end != '\r') && (*end != '\n')) { end++; nbytes++; }
if (nbytes > 0) strncpy (method, value, nbytes);
method[nbytes] = '\0';
}
}
}


void call::extract_cseq_method (char* method, char* msg)
{
char* cseq ;
if (cseq = strstr (msg, "CSeq"))
{
char * value ;
if ( value = strchr (cseq, ':'))
{
value++;
while ( isspace(*value)) value++; // ignore any white spaces after the :
while ( !isspace(*value)) value++; // ignore the CSEQ numnber
+ while ( isspace(*value)) value++; // ignore spaces after CSEQ number
char *end = value;
int nbytes = 0;
/* A '\r' terminates the line, so we want to catch that too. */
while ((*end != '\r') && (*end != '\n')) { end++; nbytes++; }
if (nbytes > 0) strncpy (method, value, nbytes);
method[nbytes] = '\0';
}
}
}

This was a quick fix and I am new at SIPP.  I am sure there are better methods 
but was hoping for a fix to be included in future SIPP code.

Thanks!
scott

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users

Reply via email to