|
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 Hi All, Yahoo! Messenger with Voice. Make
PC-to-Phone Calls to the --------------- 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
