Re: [Sipp-users] rrs=true does not work

2009-01-09 Thread Charles P Wright
The rrs=true should be independent of next.  Did you try a SIPp -trace_msg 
to see what it thinks it is sending?

Charles

Andreas Winkelbauer andreas.winkelba...@gmx.at wrote on 01/08/2009 
11:33:27 PM:

 Hi,
 
 I am currently testing a SIPp scenario and I am experiencing problems
 with rrs=true and next=... when receiving optional responses. You can
 find the relevant parts of the scenario below.
 
 In my scenario I want to consider some exceptional cases, for example
 a 480 response to an INVITE request. After receiving such a response I
 want to end the SIP dialog in a proper way, in this case by sending an
 ACK message.
 
 Now the problem is that this ACK message (at label #12) is never sent
 (it is skipped without any error message!) as soon as I use either
 [next_url] or [routes]. Unfortunately I have to use both keywords, since
 all SIP messages have to be routed via a proxy.
 
 The other ACK message in the scenario (at label #9) also uses the
 keywords [next_url] and [routes], but it is processed and sent 
flawlessly.
 
 Could somebody tell me why the ACK message at label #12 is not sent at
 all and there is no error message? (Yes, the message is not sent for
 sure, I traced the SIP messages using Wireshark.)
 
 It seems to me as if SIPp is unable to process [next_url] and [routes]
 if rrs=true is used in conjunction with next=... when receiving an
 optional response. Is this behavior by design or is it a bug?
 
 Any suggestions how I could properly end the SIP dialog in this case?
 
 Bye,
 Andreas Winkelbauer
 
 
 
 ?xml version=1.0 encoding=ISO-8859-1 ?
 scenario name=swkn sipp scenario
   label id=5 /
   send retrans=500
 ![CDATA[
   INVITE sip:[field5] SIP/2.0
   Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
   From: [field3] sip:[fiel...@[field0];tag=[call_number]
   To: [field4] sip:[field5]
   Contact: sip:[fiel...@[local_ip]:[local_port]
   Call-ID: [call_id]
   CSeq: [cseq] INVITE
   Max-Forwards: 70
   User-Agent: [field6]
   Content-Type: application/sdp
   Content-Length: [len]
 
   ... SDP ...
 ]]
   /send
 
   !-- consider exceptional cases --
   ...
   recv response=480 optional=true next=12 rrs=true
 action
   exec command=echo Error: ... sipp.log /
 /action
   /recv
   ...
 
   !-- receive 100 trying (optional) --
   label id=6 /
   recv response=100 optional=true rrs=true
   /recv
 
   !-- receive 180 ringing (optional) --
   label id=7 /
   recv response=180 optional=true rrs=true
   /recv
 
   !-- receive 200 OK --
   label id=8 /
   recv response=200 rrs=true
   /recv
 
   !-- send ACK --
   label id=9 /
   send
 ![CDATA[
   ACK [next_url] SIP/2.0
   Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
   From: [field3] sip:[fiel...@[field0];tag=[call_number]
   To: [field4] sip:[field5][peer_tag_param]
   Contact: sip:[fiel...@[local_ip]:[local_port]
   [routes]
   Call-ID: [call_id]
   CSeq: [cseq] ACK
   Max-Forwards: 70
   User-Agent: [field6]
   Content-Length: 0
 ]]
   /send
 
   ... play pcap files ...
 
   !-- send BYE --
   label id=10 /
   send retrans=500
 ![CDATA[
   BYE [next_url] SIP/2.0
   Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
   From: [field3] sip:[fiel...@[field0];tag=[call_number]
   To: [field4] sip:[field5][peer_tag_param]
   Contact: sip:[fiel...@[local_ip]:[local_port]
   [routes]
   Call-ID: [call_id]
   CSeq: [cseq] BYE
   Max-Forwards: 70
   User-Agent: [field6]
   Content-Length: 0
 ]]
   /send
 
   !-- receive 200 OK --
   label id=11 /
   recv response=200 next=13
   /recv
 
   !-- send ACK --
   !-- ERROR: this message is never sent! --
   label id=12 /
   send
 ![CDATA[
   ACK [next_url] SIP/2.0
   Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
   From: [field3] sip:[fiel...@[field0];tag=[call_number]
   To: [field4] sip:[field5][peer_tag_param]
   Contact: sip:[fiel...@[local_ip]:[local_port]
   [routes]
   Call-ID: [call_id]
   CSeq: [cseq] ACK
   Max-Forwards: 70
   User-Agent: [field6]
   Content-Length: 0
 ]]
   /send
 
   label id=13 /
 /scenario
 
 
--
 Check out the new SourceForge.net Marketplace.
 It is the best place to buy or sell services for
 just about anything Open Source.
 http://p.sf.net/sfu/Xq1LFB
 ___
 Sipp-users mailing list
 Sipp-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/sipp-users


--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Sipp-users mailing 

Re: [Sipp-users] rrs=true does not work

2009-01-09 Thread Andreas Winkelbauer
Hi,

Charles P Wright wrote:
 The rrs=true should be independent of next.  Did you try a SIPp -trace_msg 
 to see what it thinks it is sending?

Thanks for the hint. I already found a solution to my problem, SIPp was
working correctly.

Some further notes:

* The documentation of the [branch] keyword might be a little
misleading, since, for example, [branch-1] is not replaced by the value
of [branch] of the previous message (as one might think).

* The Redhat package of SIPp comes with some patches that might be worth
looking at. I have attached those patches.
** sipp--INT_MAX_headers_for_gcc43.diff for INT_MAX has been recently
merged as far as I have seen
** sipp--Makefile-fix-paths.diff: use the default system directories for
libraries and header files
** sipp--CVE-2008-2085-fix.diff: fix CVE-2008-2085
(http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-2085)

Bye,
Andreas
--- call.cpp.cve20082085	2008-07-06 12:38:01.0 +0400
+++ call.cpp	2008-07-06 17:11:11.0 +0400
@@ -125,17 +125,26 @@
 char pattern[] = c=IN IP4 ;
 char *begin, *end;
 char ip[32];
-begin = strstr(msg, pattern);
+char *tmp = strdup(msg);
+
+if(!tmp) return INADDR_NONE;
+begin = strstr(tmp, pattern);
 if (!begin) {
+  free(tmp);
   /* Can't find what we're looking at - return no address */
   return INADDR_NONE;
 }
 begin += sizeof(c=IN IP4 ) - 1;
 end = strstr(begin, \r\n);
-if (!end)
+if (!end){
+  free(tmp);
   return INADDR_NONE;
+}
+*end = 0;
 memset(ip, 0, 32);
-strncpy(ip, begin, end - begin);
+strncpy(ip, begin, sizeof(ip) - 1);
+ip[sizeof(ip) - 1] = 0;
+free(tmp);
 return inet_addr(ip);
 }
 
@@ -148,20 +157,28 @@
 char pattern[] = c=IN IP6 ;
 char *begin, *end;
 char ip[128];
+char *tmp = strdup(msg);
 
 memset(addr, 0, sizeof(addr));
 memset(ip, 0, 128);
 
-begin = strstr(msg, pattern);
+if(!tmp) return 0;
+begin = strstr(tmp, pattern);
 if (!begin) {
+  free(tmp);
   /* Can't find what we're looking at - return no address */
   return 0;
 }
 begin += sizeof(c=IN IP6 ) - 1;
 end = strstr(begin, \r\n);
-if (!end)
+if (!end){
+  free(tmp);
   return 0;
-strncpy(ip, begin, end - begin);
+}
+*end = 0;
+strncpy(ip, begin, sizeof(ip) - 1);
+ip[sizeof(ip) - 1] = 0;
+free(tmp);
 if (!inet_pton(AF_INET6, ip, addr)) {
   return 0;
 }
@@ -188,17 +205,25 @@
 	ERROR(Internal error: Undefined media pattern %d\n, 3);
 }
 
-begin = strstr(msg, pattern);
+char *tmp = strdup(msg);
+if(!tmp) return 0;
+begin = strstr(tmp, pattern);
 if (!begin) {
+  free(tmp);
   /* m=audio not found */
   return 0;
 }
 begin += strlen(pattern) - 1;
 end = strstr(begin, \r\n);
-if (!end)
+if (!end){
+  free(tmp);
   ERROR(get_remote_port_media: no CRLF found);
+}
+*end = 0;
 memset(number, 0, sizeof(number));
 strncpy(number, begin, sizeof(number) - 1);
+number[sizeof(number) - 1] = 0;
+free(tmp);
 return atoi(number);
 }
 
--- call.cpp~	2007-11-06 13:18:07.0 +0300
+++ call.cpp	2008-02-21 13:22:54.0 +0300
@@ -41,6 +41,7 @@
 #include iostream
 #include sys/types.h
 #include sys/wait.h
+#include limits.h
 
 #ifdef PCAPPLAY
 #include send_packets.h
--- scenario.cpp~	2007-07-26 14:16:49.0 +0400
+++ scenario.cpp	2008-02-21 13:22:19.0 +0300
@@ -27,6 +27,7 @@
  */
 
 #include stdlib.h
+#include limits.h
 #include sipp.hpp
 #ifdef HAVE_GSL
 #include gsl/gsl_rng.h
--- Makefile	2007-11-05 13:26:04.0 +0300
+++ Makefile	2008-01-10 01:51:48.0 +0300
@@ -135,7 +135,7 @@
 LFLAGS=$(LFLAGS_$(SYSTEM)) $(EXTRALFLAGS)
 
 #Link Libraries
-LIBS_linux= -ldl -lpthread -lncurses -lstdc++ -lm -L /usr/local/lib -L /usr/lib -L /usr/lib64
+LIBS_linux= -ldl -lpthread -lncurses -lstdc++ -lm
 LIBS_hpux= -lcurses -lpthread -L /opt/openssl/lib -L /usr/local/lib
 LIBS_tru64= -lcurses -lpthread
 LIBS_freebsd= -lcurses -pthread -L /usr/local/lib
@@ -145,7 +145,7 @@
 LIBS=$(LIBS_$(SYSTEM)) $(EXTRALIBS)
 
 # Include directories
-INCDIR_linux=-I. -I/usr/include/openssl
+INCDIR_linux=-I.
 INCDIR_freebsd=-I. -I/usr/local/include
 INCDIR_hpux=-I. -I/usr/local/include -I/opt/openssl/include
 INCDIR_tru64=-I. -I/opt/openssl/include
--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB___
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users


[Sipp-users] rrs=true does not work

2009-01-08 Thread Andreas Winkelbauer
Hi,

I am currently testing a SIPp scenario and I am experiencing problems
with rrs=true and next=... when receiving optional responses. You can
find the relevant parts of the scenario below.

In my scenario I want to consider some exceptional cases, for example
a 480 response to an INVITE request. After receiving such a response I
want to end the SIP dialog in a proper way, in this case by sending an
ACK message.

Now the problem is that this ACK message (at label #12) is never sent
(it is skipped without any error message!) as soon as I use either
[next_url] or [routes]. Unfortunately I have to use both keywords, since
all SIP messages have to be routed via a proxy.

The other ACK message in the scenario (at label #9) also uses the
keywords [next_url] and [routes], but it is processed and sent flawlessly.

Could somebody tell me why the ACK message at label #12 is not sent at
all and there is no error message? (Yes, the message is not sent for
sure, I traced the SIP messages using Wireshark.)

It seems to me as if SIPp is unable to process [next_url] and [routes]
if rrs=true is used in conjunction with next=... when receiving an
optional response. Is this behavior by design or is it a bug?

Any suggestions how I could properly end the SIP dialog in this case?

Bye,
Andreas Winkelbauer



?xml version=1.0 encoding=ISO-8859-1 ?
scenario name=swkn sipp scenario
  label id=5 /
  send retrans=500
![CDATA[
  INVITE sip:[field5] SIP/2.0
  Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
  From: [field3] sip:[fiel...@[field0];tag=[call_number]
  To: [field4] sip:[field5]
  Contact: sip:[fiel...@[local_ip]:[local_port]
  Call-ID: [call_id]
  CSeq: [cseq] INVITE
  Max-Forwards: 70
  User-Agent: [field6]
  Content-Type: application/sdp
  Content-Length: [len]

  ... SDP ...
]]
  /send

  !-- consider exceptional cases --
  ...
  recv response=480 optional=true next=12 rrs=true
action
  exec command=echo Error: ... sipp.log /
/action
  /recv
  ...

  !-- receive 100 trying (optional) --
  label id=6 /
  recv response=100 optional=true rrs=true
  /recv

  !-- receive 180 ringing (optional) --
  label id=7 /
  recv response=180 optional=true rrs=true
  /recv

  !-- receive 200 OK --
  label id=8 /
  recv response=200 rrs=true
  /recv

  !-- send ACK --
  label id=9 /
  send
![CDATA[
  ACK [next_url] SIP/2.0
  Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
  From: [field3] sip:[fiel...@[field0];tag=[call_number]
  To: [field4] sip:[field5][peer_tag_param]
  Contact: sip:[fiel...@[local_ip]:[local_port]
  [routes]
  Call-ID: [call_id]
  CSeq: [cseq] ACK
  Max-Forwards: 70
  User-Agent: [field6]
  Content-Length: 0
]]
  /send

  ... play pcap files ...

  !-- send BYE --
  label id=10 /
  send retrans=500
![CDATA[
  BYE [next_url] SIP/2.0
  Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
  From: [field3] sip:[fiel...@[field0];tag=[call_number]
  To: [field4] sip:[field5][peer_tag_param]
  Contact: sip:[fiel...@[local_ip]:[local_port]
  [routes]
  Call-ID: [call_id]
  CSeq: [cseq] BYE
  Max-Forwards: 70
  User-Agent: [field6]
  Content-Length: 0
]]
  /send

  !-- receive 200 OK --
  label id=11 /
  recv response=200 next=13
  /recv

  !-- send ACK --
  !-- ERROR: this message is never sent! --
  label id=12 /
  send
![CDATA[
  ACK [next_url] SIP/2.0
  Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
  From: [field3] sip:[fiel...@[field0];tag=[call_number]
  To: [field4] sip:[field5][peer_tag_param]
  Contact: sip:[fiel...@[local_ip]:[local_port]
  [routes]
  Call-ID: [call_id]
  CSeq: [cseq] ACK
  Max-Forwards: 70
  User-Agent: [field6]
  Content-Length: 0
]]
  /send

  label id=13 /
/scenario

--
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
___
Sipp-users mailing list
Sipp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sipp-users