From 65dda75e477aea5f8453614dfcef136bf8e93a0f Mon Sep 17 00:00:00 2001 From: Stephen George Date: Tue, 3 Sep 2013 01:59:29 -0500 Subject: [PATCH 1/6] Ensure BYEs work through proxies --- lib/sippy_cup/scenario.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sippy_cup/scenario.rb b/lib/sippy_cup/scenario.rb index bebd13f..8966da2 100644 --- a/lib/sippy_cup/scenario.rb +++ b/lib/sippy_cup/scenario.rb @@ -167,7 +167,7 @@ def send_digits(digits, delay = 0.250) def send_bye(opts = {}) msg = <<-MSG - BYE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 + BYE [next_url] SIP/2.0 [last_Via:] [last_From:] [last_To:] From 6bf210323066b0b28a9a62041b60e835da253cd9 Mon Sep 17 00:00:00 2001 From: Stephen George Date: Tue, 3 Sep 2013 02:01:45 -0500 Subject: [PATCH 2/6] Add [routes] to every message --- lib/sippy_cup/scenario.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/sippy_cup/scenario.rb b/lib/sippy_cup/scenario.rb index 8966da2..7b31226 100644 --- a/lib/sippy_cup/scenario.rb +++ b/lib/sippy_cup/scenario.rb @@ -176,6 +176,7 @@ def send_bye(opts = {}) Contact: Max-Forwards: 100 Content-Length: 0 + [routes] MSG @scenario << new_send(msg, opts) end From f069795dc3a2c89fbb533b91d7850c23dc1b790d Mon Sep 17 00:00:00 2001 From: Stephen George Date: Tue, 3 Sep 2013 02:02:26 -0500 Subject: [PATCH 3/6] Put [routes] at the end of the headers to avoid issues with old versions of SIPp @see http://www.mail-archive.com/sipp-users@lists.sourceforge.net/msg01114.html --- lib/sippy_cup/scenario.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sippy_cup/scenario.rb b/lib/sippy_cup/scenario.rb index 7b31226..551191c 100644 --- a/lib/sippy_cup/scenario.rb +++ b/lib/sippy_cup/scenario.rb @@ -129,12 +129,12 @@ def ack_answer(opts = {}) Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] From: ;tag=[call_number] [last_To:] - [routes] Call-ID: [call_id] CSeq: [cseq] ACK Contact: sip:#{@from_user}@[local_ip]:[local_port] Max-Forwards: 100 Content-Length: 0 + [routes] ACK @scenario << new_send(msg, opts) start_media @@ -201,12 +201,12 @@ def ack_bye(opts = {}) [last_Via:] [last_From:] [last_To:] - [routes] [last_Call-ID:] [last_CSeq:] Contact: Max-Forwards: 100 Content-Length: 0 + [routes] ACK @scenario << new_send(msg, opts) end From 880f0d0c6d5c0afb4065f37f30d4c07ac9102c77 Mon Sep 17 00:00:00 2001 From: Stephen George Date: Tue, 3 Sep 2013 02:04:55 -0500 Subject: [PATCH 4/6] Explicitly set From for BYEs --- lib/sippy_cup/scenario.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sippy_cup/scenario.rb b/lib/sippy_cup/scenario.rb index 551191c..1268aa2 100644 --- a/lib/sippy_cup/scenario.rb +++ b/lib/sippy_cup/scenario.rb @@ -169,7 +169,7 @@ def send_bye(opts = {}) BYE [next_url] SIP/2.0 [last_Via:] - [last_From:] + From: "#{@from_user}" ;tag=[call_number] [last_To:] [last_Call-ID] CSeq: [cseq] BYE From db40d61d196dcdbd6392c7a1a0576f2b2bc97dc0 Mon Sep 17 00:00:00 2001 From: Stephen George Date: Tue, 3 Sep 2013 02:05:40 -0500 Subject: [PATCH 5/6] Make specified From consistent --- lib/sippy_cup/scenario.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/sippy_cup/scenario.rb b/lib/sippy_cup/scenario.rb index 1268aa2..85e474d 100644 --- a/lib/sippy_cup/scenario.rb +++ b/lib/sippy_cup/scenario.rb @@ -59,7 +59,7 @@ def invite(opts = {}) INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: sipp ;tag=[call_number] + From: "#{@from_user}" ;tag=[call_number] To: Call-ID: [call_id] CSeq: [cseq] INVITE @@ -127,7 +127,7 @@ def ack_answer(opts = {}) ACK [next_url] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] - From: ;tag=[call_number] + From: "#{@from_user}" ;tag=[call_number] [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK From e6d82c57ab51b0ea8302b1e722e8017d3f23c218 Mon Sep 17 00:00:00 2001 From: Stephen George Date: Tue, 3 Sep 2013 02:06:04 -0500 Subject: [PATCH 6/6] Make specified Contact consistent --- lib/sippy_cup/scenario.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/sippy_cup/scenario.rb b/lib/sippy_cup/scenario.rb index 85e474d..53e7874 100644 --- a/lib/sippy_cup/scenario.rb +++ b/lib/sippy_cup/scenario.rb @@ -63,7 +63,7 @@ def invite(opts = {}) To: Call-ID: [call_id] CSeq: [cseq] INVITE - Contact: sip:#{@from_user}@[local_ip]:[local_port] + Contact: Max-Forwards: 100 Content-Type: application/sdp Content-Length: [len] @@ -131,7 +131,7 @@ def ack_answer(opts = {}) [last_To:] Call-ID: [call_id] CSeq: [cseq] ACK - Contact: sip:#{@from_user}@[local_ip]:[local_port] + Contact: Max-Forwards: 100 Content-Length: 0 [routes] @@ -173,7 +173,7 @@ def send_bye(opts = {}) [last_To:] [last_Call-ID] CSeq: [cseq] BYE - Contact: + Contact: Max-Forwards: 100 Content-Length: 0 [routes] @@ -203,7 +203,7 @@ def ack_bye(opts = {}) [last_To:] [last_Call-ID:] [last_CSeq:] - Contact: + Contact: Max-Forwards: 100 Content-Length: 0 [routes]