diff --git a/lib/sippy_cup/scenario.rb b/lib/sippy_cup/scenario.rb index bebd13f..53e7874 100644 --- a/lib/sippy_cup/scenario.rb +++ b/lib/sippy_cup/scenario.rb @@ -59,11 +59,11 @@ 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 - Contact: sip:#{@from_user}@[local_ip]:[local_port] + Contact: Max-Forwards: 100 Content-Type: application/sdp Content-Length: [len] @@ -127,14 +127,14 @@ 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:] - [routes] Call-ID: [call_id] CSeq: [cseq] ACK - Contact: sip:#{@from_user}@[local_ip]:[local_port] + Contact: Max-Forwards: 100 Content-Length: 0 + [routes] ACK @scenario << new_send(msg, opts) start_media @@ -167,15 +167,16 @@ 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:] + From: "#{@from_user}" ;tag=[call_number] [last_To:] [last_Call-ID] CSeq: [cseq] BYE - Contact: + Contact: Max-Forwards: 100 Content-Length: 0 + [routes] MSG @scenario << new_send(msg, opts) end @@ -200,12 +201,12 @@ def ack_bye(opts = {}) [last_Via:] [last_From:] [last_To:] - [routes] [last_Call-ID:] [last_CSeq:] - Contact: + Contact: Max-Forwards: 100 Content-Length: 0 + [routes] ACK @scenario << new_send(msg, opts) end