|
From: makarand b. <bha...@gm...> - 2006-10-11 04:39:52
|
Thanks Peter,
I'll give this a shot and let you know how it goes
Peter,Oliver, thanks for the help , Much appreciated.
Makarand
On 10/9/06, Peter Higginson <pet...@ne...> 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 i=
t
> 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 =3D get_cseq_value(msg);
>
> if (rcseq > cseq) cseq =3D 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 =3D strstr(msg, "\r\nCSeq:");
>
> if(!ptr1) { ptr1 =3D strstr(msg, "\r\nCSEQ:"); }
>
> if(!ptr1) { ptr1 =3D strstr(msg, "\r\ncseq:"); }
>
> if(!ptr1) { ptr1 =3D strstr(msg, "\r\nCseq:"); }
>
> if(!ptr1) { WARNING_P1("No valid Cseq header in request '%s'", msg);
> return 0;}
>
>
>
> ptr1 +=3D 7;
>
>
>
> while((*ptr1 =3D=3D ' ') || (*ptr1 =3D=3D '\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 thi=
s
> you need to change lines 1359-1363 of call.cpp to:
>
>
>
> int incr_cseq =3D 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 =3D 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
>
>
>
> Peter Higginson
>
> Newport Networks Ltd,
>
> Direct line 01494 470694
>
> http://www.newport-networks.com/
> ------------------------------
>
> *From:* sip...@li... [mailto:
> sip...@li...] *On Behalf Of *Makarand Bhagwat
> *Sent:* 06 October 2006 05:16
> *To:* sip...@li...
> *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<http://us.rd.yahoo.co=
m/mail_us/taglines/postman1/*http:/us.rd.yahoo.com/evt=3D39663/*http:/voice=
.yahoo.com>to the US (and 30+ countries) for 2=A2/min or less.
>
>
> ------------------------------
> ---------------
> This e-mail may contain confidential and/or privileged information. If yo=
u
> 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=3Djoin.php&p=3Dsourceforge&CID=3D=
DEVDEV
>
> _______________________________________________
> Sipp-users mailing list
> Sip...@li...
> https://lists.sourceforge.net/lists/listinfo/sipp-users
>
>
>
|