I checked both in (SVN 63). I also added [cseq] in the doc.
Thanks a lot,
Olivier.
Thanks Peter,
I'll give this a shot and let you know how it goes
Peter,Oliver, thanks for the help , Much appreciated.
MakarandOn 10/9/06, Peter Higginson <[EMAIL PROTECTED]> wrote:Olivier,
I have this as an option in my local version. Given that [cseq] is not widely used in the public version of SIPP, I would like to suggest that it is put in without making it optional, which reduces the number of edits. So, taking sipp_2006_10_4 as a base for line numbers:
In call.cpp at line 2672 (in process_incomming after the /* Simulate loss of messages */ block), add this code:
if (request) { // update [cseq] with received CSeq
unsigned long int rcseq = get_cseq_value(msg);
if (rcseq > cseq) cseq = rcseq;
}
Remembering that [cseq] is incremented before transmission, so you just need to copy the received value.
You then need to put this routine somewhere. I have put mine just before get_reply_code in sipp.cpp (which means it needs defining in sipp.hpp as well). But somewhere in call.cpp before the usage point would do equally well.
unsigned long int get_cseq_value(char *msg) {
char *ptr1;
// no short form for CSeq:
ptr1 = strstr(msg, "\r\nCSeq:");
if(!ptr1) { ptr1 = strstr(msg, "\r\nCSEQ:"); }
if(!ptr1) { ptr1 = strstr(msg, "\r\ncseq:"); }
if(!ptr1) { ptr1 = strstr(msg, "\r\nCseq:"); }
if(!ptr1) { WARNING_P1("No valid Cseq header in request '%s'", msg); return 0;}
ptr1 += 7;
while((*ptr1 == ' ') || (*ptr1 == '\t')) {++ptr1;}
if(!(*ptr1)) { WARNING("No valid Cseq data in header"); return 0;}
return strtoul(ptr1, NULL, 10);
}
Note there are cases that [cseq] does not really help, where you have to go back and use the cseq of an earlier message in a CANCEL.
While we are on [cseq], there is one fix to a rare bug that may be worth having. [cseq] is incremented before sending but it is possible to retry sends on TCP which increments cseq once extra for every retry. To fix this you need to change lines 1359-1363 of call.cpp to:
int incr_cseq = 0;
if (strncmp(::scenario[msg_index]->send_scheme,"ACK",3) &&
strncmp(::scenario[msg_index]->send_scheme,"CANCEL",6) &&
strncmp(::scenario[msg_index]->send_scheme,"SIP/2.0",7)) {
++cseq;
incr_cseq = 1;
}
(That is add the two lines with incr_cseq.)
And then just before this line (1374)
return true; /* No step, nothing done, retry later */
insert this line:
if (incr_cseq) --cseq;
Peter
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Makarand Bhagwat
Sent: 06 October 2006 05:16
To: [email protected]
Subject: [Sipp-users] incrementing the value of Cseq on the server side
Hi All,
I tried the [cseq+1] value and the cseq was changed to 2.
However in this scenario, I need to learn the CSeq (which cannot be controlled) from the incomming message and increase it by one.
Could you tell me where the CSeq value is picked up when we use the last_Cseq key word ?
Would it be possible to increase the value of CSeq then and store it in a variable for later use ?
Any pointers are highly appreciated. Thanks in advance for your help.
Regards,
Makarand
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2ยข/min or less.
---------------
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the contents in this e-mail is strictly forbidden.
---------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users
--
HP OpenCall Software
http://www.hp.com/go/opencall/
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Sipp-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sipp-users
