Author: asanders Date: Mon Mar 2 22:13:14 2015 New Revision: 6483 URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=6483 Log: chan_sip: Asterisk fails to re-activate an inactive media session when an offer does not contain a=sendrecv
This test is to ensure that Asterisk correctly applies the direction of the media stream when a=<sendonly|recvonly|inactive|sendrecv> is missing from the offer's SDP. The expected behavior is for Asterisk to apply "sendrecv" as the direction of the media stream when no direction attribute is present in an offer's SDP. According to RFC 4566 (Section 6. SDP Attributes): "If none of the attributes "sendonly", "recvonly", "inactive", and "sendrecv" is present, "sendrecv" SHOULD be assumed as the default for sessions that are not of the conference type "broadcast" or "H332" [...]" The test scenario: 1. From Phone A, send an offer to Phone B to establish a call 2. From Phone B, send an offer to Phone A to put the call on hold. 3. Observe that the MOH start event occurs. 4. From Phone B, send an offer to Phone A to 'un-hold' the call (ensure that the direction attribute from the offer's SDP is omitted) 5. Observe that the MOH stop event occurs. ASTERISK-24824 #close Reported By: Ashley Sanders Review: https://reviewboard.asterisk.org/r/4442/ Added: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_A_no_direction.xml (with props) asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_no_direction.xml (with props) Modified: asterisk/trunk/tests/channels/SIP/sip_hold/run-test asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_IP_media_restrict.xml asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_IP_restrict.xml asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_media_restrict.xml Modified: asterisk/trunk/tests/channels/SIP/sip_hold/run-test URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_hold/run-test?view=diff&rev=6483&r1=6482&r2=6483 ============================================================================== --- asterisk/trunk/tests/channels/SIP/sip_hold/run-test (original) +++ asterisk/trunk/tests/channels/SIP/sip_hold/run-test Mon Mar 2 22:13:14 2015 @@ -39,15 +39,19 @@ self.sipp_phone_a_scenarios = [{'scenario':'phone_A.xml','-i':'127.0.0.2','-p':'5060','-inf':INJECT_FILE_BYPASS}, {'scenario':'phone_A.xml','-i':'127.0.0.2','-p':'5060','-inf':INJECT_FILE_BYPASS}, {'scenario':'phone_A.xml','-i':'127.0.0.2','-p':'5060','-inf':INJECT_FILE_BYPASS}, + {'scenario':'phone_A_no_direction.xml','-i':'127.0.0.2','-p':'5060','-inf':INJECT_FILE_BYPASS}, {'scenario':'phone_A.xml','-i':'127.0.0.2','-p':'5060','-inf':INJECT_FILE_BRIDGE}, {'scenario':'phone_A.xml','-i':'127.0.0.2','-p':'5060','-inf':INJECT_FILE_BRIDGE}, - {'scenario':'phone_A.xml','-i':'127.0.0.2','-p':'5060','-inf':INJECT_FILE_BRIDGE},] + {'scenario':'phone_A.xml','-i':'127.0.0.2','-p':'5060','-inf':INJECT_FILE_BRIDGE}, + {'scenario':'phone_A_no_direction.xml','-i':'127.0.0.2','-p':'5060','-inf':INJECT_FILE_BRIDGE}] self.sipp_phone_b_scenarios = [{'scenario':'phone_B_media_restrict.xml','-i':'127.0.0.3','-p':'5060','-inf':INJECT_FILE_BYPASS}, {'scenario':'phone_B_IP_restrict.xml','-i':'127.0.0.3','-p':'5060','-inf':INJECT_FILE_BYPASS}, {'scenario':'phone_B_IP_media_restrict.xml','-i':'127.0.0.3','-p':'5060','-inf':INJECT_FILE_BYPASS}, + {'scenario':'phone_B_no_direction.xml','-i':'127.0.0.3','-p':'5060','-inf':INJECT_FILE_BYPASS}, {'scenario':'phone_B_media_restrict.xml','-i':'127.0.0.3','-p':'5060','-inf':INJECT_FILE_BRIDGE}, {'scenario':'phone_B_IP_restrict.xml','-i':'127.0.0.3','-p':'5060','-inf':INJECT_FILE_BRIDGE}, - {'scenario':'phone_B_IP_media_restrict.xml','-i':'127.0.0.3','-p':'5060','-inf':INJECT_FILE_BRIDGE},] + {'scenario':'phone_B_IP_media_restrict.xml','-i':'127.0.0.3','-p':'5060','-inf':INJECT_FILE_BRIDGE}, + {'scenario':'phone_B_no_direction.xml','-i':'127.0.0.3','-p':'5060','-inf':INJECT_FILE_BRIDGE}] self.passed = True self.moh_start_events = 0 Added: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_A_no_direction.xml URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_A_no_direction.xml?view=auto&rev=6483 ============================================================================== --- asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_A_no_direction.xml (added) +++ asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_A_no_direction.xml Mon Mar 2 22:13:14 2015 @@ -1,0 +1,87 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<scenario name="Phone A in hold scenario. This is the phone that initiates the call."> + + <!-- Send the initial invite to start the call --> + <send retrans="500"> + <![CDATA[ + INVITE sip:[field2]@[remote_ip]:[remote_port]; SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + Max-Forwards: 70 + From: "[field0]" <sip:[field0]@[local_ip]>;tag=[call_number] + To: <sip:[field2]@[remote_ip]> + Contact: sip:[field0]@[local_ip]:[local_port] + Call-ID: [call_id] + Cseq: [cseq] INVITE + User-Agent: AcmeCorp/2.0 + Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH + Supported: replaces, timer + Content-Type: application/sdp + Content-Length: [len] + + v=0 + o=root 238930722 238930722 IN IP[local_ip_type] [local_ip] + s=Asterisk PBX + c=IN IP[local_ip_type] [local_ip] + t=0 0 + m=audio 15968 RTP/AVP 18 0 101 + a=rtpmap:18 G729/8000 + a=fmtp:18 annexb=no + a=rtpmap:0 PCMU/8000 + a=rtpmap:101 telephone-event/8000 + a=fmtp:101 0-16 + a=silenceSupp:off - - - - + a=ptime:20 + a=sendrecv + ]]> + </send> + + <!-- (Maybe) receive a Trying response from Phone B --> + <recv response="100" optional="true" /> + + <!-- (Maybe) receive a Ringing response from Phone B --> + <recv response="180" optional="true" /> + + <!-- Receive the OK response from Phone B --> + <recv response="200" /> + + <pause milliseconds="200"/> + + <!-- Send ACK to Phone B --> + <send> + <![CDATA[ + ACK sip:[field2]@[remote_ip]:[remote_port] SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + Max-Forwards: 70 + From: "[field0]" <sip:[field0]@[local_ip]>;tag=[call_number] + To: <sip:[field2]@[remote_ip]>[peer_tag_param] + Contact: <sip:[field0]@[local_ip]:[local_port]> + Call-ID: [call_id] + Cseq: [cseq] ACK + User-Agent: AcmeCorp/2.0 + Content-Length: [len] + ]]> + </send> + + <!-- Wait some period of time while Phone B performs hold/unhold tasks --> + <pause milliseconds="3000"/> + + <!-- Receive a BYE request from Phone B indicating scenario is over --> + <recv request="BYE"/> + + <!-- Send OK response to Phone B --> + <send retrans="500"> + <![CDATA[ + SIP/2.0 200 OK + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + [last_Via:] + Content-Length: [len] + User-Agent: AcmeCorp/2.0 + ]]> + </send> + +</scenario> Propchange: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_A_no_direction.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_A_no_direction.xml ------------------------------------------------------------------------------ svn:executable = * Propchange: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_A_no_direction.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_A_no_direction.xml ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_IP_media_restrict.xml URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_IP_media_restrict.xml?view=diff&rev=6483&r1=6482&r2=6483 ============================================================================== --- asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_IP_media_restrict.xml (original) +++ asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_IP_media_restrict.xml Mon Mar 2 22:13:14 2015 @@ -210,5 +210,6 @@ ]]> </send> + <recv response="200" /> </scenario> Modified: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_IP_restrict.xml URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_IP_restrict.xml?view=diff&rev=6483&r1=6482&r2=6483 ============================================================================== --- asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_IP_restrict.xml (original) +++ asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_IP_restrict.xml Mon Mar 2 22:13:14 2015 @@ -210,5 +210,6 @@ ]]> </send> + <recv response="200" /> </scenario> Modified: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_media_restrict.xml URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_media_restrict.xml?view=diff&rev=6483&r1=6482&r2=6483 ============================================================================== --- asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_media_restrict.xml (original) +++ asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_media_restrict.xml Mon Mar 2 22:13:14 2015 @@ -211,5 +211,6 @@ ]]> </send> + <recv response="200" /> </scenario> Added: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_no_direction.xml URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_no_direction.xml?view=auto&rev=6483 ============================================================================== --- asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_no_direction.xml (added) +++ asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_no_direction.xml Mon Mar 2 22:13:14 2015 @@ -1,0 +1,207 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE scenario SYSTEM "sipp.dtd"> + +<scenario name="Phone B in hold scenario. This is the phone that initiates the hold/unhold events."> + + <!-- Receive the initial invite to initiate the call --> + <recv request="INVITE" crlf="true" /> + + <pause milliseconds="200"/> + + <!-- Send a Trying response to Phone A --> + <send> + <![CDATA[ + SIP/2.0 100 Trying + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + [last_Via:] + ]]> + </send> + + <pause milliseconds="200"/> + + <!-- Send a Ringing response to Phone A --> + <send> + <![CDATA[ + SIP/2.0 180 Ringing + [last_Via:] + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + Server: AcmeCorp/2.0 + Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH + Supported: replaces, timer + Contact: <sip:[field2]@[local_ip]:[local_port]> + Content-Length: [len] + ]]> + </send> + + <pause milliseconds="200"/> + + <!-- Send an OK response to Phone A --> + <send retrans="500"> + <![CDATA[ + SIP/2.0 200 OK + [last_From:] + [last_To:];tag=[call_number] + [last_Call-ID:] + [last_CSeq:] + [last_Via:] + Content-Type: application/sdp + Content-Length: [len] + User-Agent: AcmeCorp/2.0 + Contact: sip:[field2]@[local_ip]:[local_port] + Allow: INVITE, ACK, CANCEL, BYE, INFO, UPDATE, OPTIONS, PRACK, REFER + + v=0 + o=- 1 1 IN IP[local_ip_type] [local_ip] + s=LO-CM + c=IN IP[local_ip_type] [local_ip] + t=0 0 + m=audio 44064 RTP/AVP 0 101 + a=rtpmap:0 PCMU/8000/1 + a=rtpmap:101 telephone-event/8000/1 + a=fmtp:101 0-15 + ]]> + </send> + + <!-- Receive ACK from Phone A --> + <recv request="ACK"/> + + <!-- Wait some period of time, then send hold --> + <pause milliseconds="3000"/> + + <!-- Send a re-invite to "Phone A" (Asterisk) to put the call on hold --> + <send retrans="500"> + <![CDATA[ + INVITE sip:[field0]@[remote_ip]:[remote_port] SIP/2.0 + From: sip:[field2]@[local_ip];tag=[call_number] + To: "[field0]" <sip:[field2]@[remote_ip]> + Call-ID: [call_id] + Cseq: [cseq] INVITE + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + Content-Type: application/sdp + Content-Length: [len] + Contact: sip:[field2]@[local_ip]:[local_port] + Max-Forwards: 70 + User-Agent: AcmeCorp/2.0 + Allow: INVITE, ACK, CANCEL, BYE, INFO, UPDATE, OPTIONS, PRACK, REFER + + v=0 + o=AcmeCorp 1393520501 1393520501 IN IP[local_ip_type] [local_ip] + s=AcmeCorp Call + c=IN IP4 0.0.0.0 + t=0 0 + a=inactive + m=audio 10000 RTP/AVP 0 + a=rtpmap:0 PCMU/8000/1 + a=rtpmap:101 telephone-event/8000/1 + a=fmtp:101 0-15 + ]]> + </send> + + <!-- (Maybe) receive a Trying response from "Phone A" (Asterisk) --> + <recv response="100" optional="true" /> + + <!-- Receive the OK response from "Phone A" (Asterisk) --> + <recv response="200" /> + + <pause milliseconds="200"/> + + <!-- Send ACK to "Phone A" (Asterisk) --> + <send> + <![CDATA[ + ACK sip:[field0]@[remote_ip]:[remote_port] SIP/2.0 + From: sip:[field1]@[local_ip];tag=[call_number] + To: "[field0]" <sip:[field0]@[remote_ip]>[peer_tag_param] + Call-ID: [call_id] + Cseq: [cseq] ACK + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + Content-Length: [len] + Max-Forwards: 70 + User-Agent: AcmeCorp/2.0 + ]]> + </send> + + <!-- Wait some period of time, then send the un-hold --> + <pause milliseconds="3000"/> + + <!-- Send another re-invite to "Phone A" (Asterisk) to take the call out of hold; + omitting a=<direction> from SDP --> + <send retrans="500"> + <![CDATA[ + INVITE sip:[field0]@[remote_ip]:[remote_port] SIP/2.0 + From: sip:[field1]@[local_ip];tag=[call_number] + To: "[field0]" <sip:[field0]@[remote_ip]>[peer_tag_param] + Call-ID: [call_id] + Cseq: [cseq] INVITE + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + Content-Type: application/sdp + Content-Length: [len] + Contact: sip:[field2]@[local_ip]:[local_port] + Max-Forwards: 70 + User-Agent: AcmeCorp/2.0 + Allow: INVITE, ACK, CANCEL, BYE, INFO, UPDATE, OPTIONS, PRACK, REFER + + v=0 + o=AcmeCorp 7786706563 7786706563 IN IP[local_ip_type] [local_ip] + s=AcmeCorp Call + c=IN IP[local_ip_type] [local_ip] + t=0 0 + m=audio 44170 RTP/AVP 0 101 + a=rtpmap:0 PCMU/8000/1 + a=rtpmap:101 telephone-event/8000/1 + a=fmtp:101 0-15 + ]]> + </send> + + <!-- (Maybe) receive a Trying response from "Phone A" (Asterisk) --> + <recv response="100" optional="true" /> + + <!-- Receive the OK response from "Phone A" (Asterisk) --> + <recv response="200" /> + + <pause milliseconds="200"/> + + <!-- Send ACK to "Phone A" (Asterisk) --> + <send> + <![CDATA[ + ACK sip:[field0]@[remote_ip]:[remote_port] SIP/2.0 + From: sip:[field1]@[local_ip];tag=[call_number] + To: "[field0]" <sip:[field0]@[remote_ip]>[peer_tag_param] + Call-ID: [call_id] + Cseq: [cseq] ACK + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + Content-Length: [len] + Max-Forwards: 70 + User-Agent: AcmeCorp/2.0 + ]]> + </send> + + <pause milliseconds="500"/> + + <!-- Send a BYE request to Phone A indicating hold scenario is over --> + <send> + <![CDATA[ + BYE sip:[field0]@[remote_ip]:[remote_port]; SIP/2.0 + Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] + Max-Forwards: 70 + From: sip:[field1]@[local_ip];tag=[call_number] + To: "[field0]" <sip:[field0]@[remote_ip]>[peer_tag_param] + Contact: sip:[field1]@[local_ip]:[local_port] + Call-ID: [call_id] + Cseq: [cseq] BYE + User-Agent: AcmeCorp/2.0 + X-Asterisk-HangupCause: Normal Clearing + X-Asterisk-HangupCauseCode: 16 + Content-Length: [len] + ]]> + </send> + + <!-- Receive the OK response from Phone A --> + <recv response="200" /> + +</scenario> Propchange: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_no_direction.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_no_direction.xml ------------------------------------------------------------------------------ svn:executable = * Propchange: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_no_direction.xml ------------------------------------------------------------------------------ svn:keywords = Author Date Id Revision Propchange: asterisk/trunk/tests/channels/SIP/sip_hold/sipp/phone_B_no_direction.xml ------------------------------------------------------------------------------ svn:mime-type = text/plain -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- svn-commits mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/svn-commits