Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions lib/sippy_cup/scenario.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sip:#{@from_user}@[local_ip]>;tag=[call_number]
From: "#{@from_user}" <sip:#{@from_user}@[local_ip]>;tag=[call_number]
To: <sip:[service]@[remote_ip]:[remote_port]>
Call-ID: [call_id]
CSeq: [cseq] INVITE
Contact: sip:#{@from_user}@[local_ip]:[local_port]
Contact: <sip:#{@from_user}@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 100
Content-Type: application/sdp
Content-Length: [len]
Expand Down Expand Up @@ -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: <sip:#{@from_user}@[local_ip]>;tag=[call_number]
From: "#{@from_user}" <sip:#{@from_user}@[local_ip]>;tag=[call_number]
[last_To:]
[routes]
Call-ID: [call_id]
CSeq: [cseq] ACK
Contact: sip:#{@from_user}@[local_ip]:[local_port]
Contact: <sip:#{@from_user}@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 100
Content-Length: 0
[routes]
ACK
@scenario << new_send(msg, opts)
start_media
Expand Down Expand Up @@ -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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change compatible with what was there before? The SIPp docs say:

If the "rrs" attribute in a recv command is set to "true", then the [next_url] contains the contents of the Contact header (i.e within the '<' and '>' of Contact)

If rrs is not set to true, what will [next_url] expand to?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm relying on the rrs in the initial #receive_answer to be true. Without that, I believe that [next_url] would yield an empty string and break the entire exchange.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you say the rrs in #receive_answer, are you referring to this: https://github.com/bklang/sippy_cup/pull/15/files#L1R111 Right now it appears to be hard coded, but your other PR might make that no longer the case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, exactly. I did happen to make changes to it in #15. But there rrs still defaults to true if not explicitly overridden. I believe that [next_url] in BYE would only break if someone explicitly set rrs to false for some reason.

[last_Via:]
[last_From:]
From: "#{@from_user}" <sip:#{@from_user}@[local_ip]>;tag=[call_number]
[last_To:]
[last_Call-ID]
CSeq: [cseq] BYE
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Contact: <sip:#{@from_user}@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 100
Content-Length: 0
[routes]
MSG
@scenario << new_send(msg, opts)
end
Expand All @@ -200,12 +201,12 @@ def ack_bye(opts = {})
[last_Via:]
[last_From:]
[last_To:]
[routes]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Contact: <sip:#{@from_user}@[local_ip]:[local_port];transport=[transport]>
Max-Forwards: 100
Content-Length: 0
[routes]
ACK
@scenario << new_send(msg, opts)
end
Expand Down