[SIPForum-discussion] Need help for Route header
Ashis Jena
jenaashis at gmail.com
Thu Apr 17 09:38:20 UTC 2008
Hi
I am a user of SIPP . I am running a call transfer scenario wherein user A
calls User B . After the voice path B sends a Invite with c=0.0.0.0 for
hold.
B is UAS.so I am extracting route form the Invite recieved by B by using
rrs=true and giving the keyword [routes].
But B sipp is not doing the proper extraction from Recordroute , for which
call is getting dropped.
So i want to extract the Record route from Invite received using Regular
Expression.
Below is my script used
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<!-- This program is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU General Public License as -->
<!-- published by the Free Software Foundation; either version 2 of the -->
<!-- License, or (at your option) any later version. -->
<!-- -->
<!-- This program is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
<!-- GNU General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU General Public License -->
<!-- along with this program; if not, write to the -->
<!-- Free Software Foundation, Inc., -->
<!-- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Sipp default 'uac' scenario. -->
<!-- -->
<scenario name="Basic UAS responder">
<!-- By adding rrs="true" (Record Route Sets), the route sets -->
<!-- are saved and used for following messages sent. Useful to test -->
<!-- against stateful SIP proxies/B2BUAs. -->
<recv request="INVITE" crlf="true" rrs="true">
<action>
<!--<ereg
regexp="[a-z][:][a-zA-Z]@[0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[.][0-9]{1,3}[:][0-9]{1,5}[;][a-z][;][a-z]"
search_in="hdr" header="Record-Route:" check_it="true"
assign_to="1,3,4,5,6,7,8,9"/>
-->
<ereg regexp="([a-z][a-zA-Z0-9 at .:;]*,)" search_in="hdr"
header="Record-Route:" check_it="true" assign_to="1,3,4,5,6,7,8,9"/>
<ereg regexp=".*" search_in="hdr" header="CSeq:" check_it="true"
assign_to="2"/>
<ereg regexp="[a-z][a-zA-Z0-9 at .:;]*" search_in="hdr" header="Contact:"
check_it="true" assign_to="1" />
</action>
</recv>
<!-- The '[last_*]' keyword is replaced automatically by the -->
<!-- specified header if it was present in the last message received -->
<!-- (except if it was a retransmission). If the header was not -->
<!-- present or if no message has been received, the '[last_*]' -->
<!-- keyword is discarded, and all bytes until the end of the line -->
<!-- are also discarded. -->
<!-- -->
<!-- If the specified header was present several times in the -->
<!-- message, all occurences are concatenated (CRLF seperated) -->
<!-- to be used in place of the '[last_*]' keyword. -->
<send>
<![CDATA[
SIP/2.0 180 Ringing
[last_Via:]
[last_Record-Route:]
[last_From:]
[last_To:];tag=[call_number]-[pid]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<pause milliseconds="2000"/>
<send retrans="1500">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_Record-Route:]
[last_From:]
[last_To:];tag=[call_number]-[pid]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Session-Expires: 900;refresher=uac
Supported : timer
Content-Length: [len]
v=0
o=user 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=VerazUE
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 97 111 0 8 18 3 98 112 113 114 116 101
a=rtpmap:97 iLBC/8000
a=rtpmap:111 AMR-WB/16000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:3 GSM/8000
a=rtpmap:98 iLBC/8000
a=fmtp:98 mode=20
a=rtpmap:112 g7222/16000
a=rtpmap:113 AMR-WBHR/16000
a=rtpmap:114 g7222hr/16000
a=rtpmap:116 AMR-WB_VAD/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendrecv
]]>
</send>
<recv request="ACK"
rtd="true"
crlf="true"/>
<pause milliseconds="5000"/>
<send retrans="1500">
<![CDATA[
INVITE [next_url] SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch];rport
From:"[field2]" <sip:[field2]@[field1]>;tag=[call_number]-[pid]
To: "[field0]" <sip:[field0]@[field1]>;tag=[call_number]
Contact: <sip:[local_ip]:[local_port]>
Call-ID: [call_id]
CSeq: [cseq] INVITE
Max-Forwards: 70
User-Agent: VerazUE
Content-Type: application/sdp
Content-Length:[len]
Route [$9],[$8],[$7],[$6],[$5],[$4],[$3],[$1]
Route [$8]
Route [$7]
Route [$6]
Route [$5]
v=0
o=user 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s=VerazUE
c=IN IP[media_ip_type] 0.0.0.0
t=0 0
m=audio [media_port] RTP/AVP 97 111 0 8 18 3 98 112 113 114 116 101
a=rtpmap:97 iLBC/8000
a=rtpmap:111 AMR-WB/16000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:3 GSM/8000
a=rtpmap:98 iLBC/8000
a=fmtp:98 mode=20
a=rtpmap:112 g7222/16000
a=rtpmap:113 AMR-WBHR/16000
a=rtpmap:114 g7222hr/16000
a=rtpmap:116 AMR-WB_VAD/16000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=sendonly
]]>
</send>
<recv response="100"/>
<recv response="200" ontimeout="2">
<action>
<ereg regexp=".*" search_in="hdr" header="To: " check_it="true"
assign_to="4"/>
<ereg regexp="[a-z][a-zA-Z0-9 at .:;]*" search_in="hdr" header="Contact:"
check_it="true" assign_to="2" />
</action>
</recv>
<send>
<![CDATA[
ACK [next_url] SIP/2.0
Via: SIP/2.0/[transport]
[local_ip]:[local_port];branch=[branch];rport=5060
[last_From:]
[last_To:]
[last_Call-ID:]
CSeq: [cseq] ACK
Contact: <sip:[field0]@[local_ip]>
Max-Forwards: 70
Session-Expires: 900;refresher=uac
User-Agent: VerazUE
P-Preferred-Identity: "[field0]" <sip:[field0]@[field1]>
Content-Length: 0
]]>
</send>
<send retrans="1500">
<![CDATA[
REFER [next_url] SIP/2.0
Via: SIP/2.0/[transport]
[local_ip]:[local_port];branch=[branch];rport=5060
[last_From:]
[last_To:]
[last_Call-ID:]
Contact: <sip:[local_ip]:[local_port]
Call-ID: [call_id]
CSeq: [cseq] REFER
Max-Forwards: 70
User-Agent: VerazUE
Supported: replaces,timer
Refer-Sub: false
P-Preferred-Identity: "[field2]" <sip:[field2]@[field1]>
Content-Type: application/sdp
Content-Length: 0
Refer-To:<sip:[field5]@[field1]>
Referred-By:<sip:[field2]@[field1]>
[routes]
]]>
</send>
<recv response="202" rrs="true" ontimeout="2">
</recv>
<recv request="NOTIFY" crlf="true">
</recv>
<send>
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_Record-Route:]
[last_From:]
[last_To:]
[last_Call-ID:]
CSeq: [$2]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<!-- The 'crlf' option inserts a blank line in the statistics report. -->
<recv request="BYE"/>
<send>
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_Record-Route:]
[last_From:]
[last_To:];tag=[call_number]-[pid]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<label id="1"/>
<send next="9">
<![CDATA[
ACK sip:[field2]@[field1] SIP/2.0
Via: SIP/2.0/[transport]
[local_ip]:[local_port];branch=z9hG4bK-[call_number]-0
From: "[field0]" <sip:[field0]@[field1]>;tag=[call_number]
To: <sip:[field2]@[field1];user=phone>[peer_tag_param]
Call-ID: [call_id]
CSeq: [cseq] ACK
Max-Forwards: 70
User-Agent: VerazUE
Content-Length: 0
[routes]
]]>
</send>
<label id="5"/>
<send next="4">
<![CDATA[
SIP/2.0 200 OK
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<label id="9"/>
<nop>
<action>
<log message="[last_From], [last_To], [last_Call-ID], [last_CSeq],
[last_Warning]"/>
</action>
</nop>
<label id="2"/>
<!-- definition of the response time repartition table (unit is ms) -->
<ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
<!-- definition of the call length repartition table (unit is ms) -->
<CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
</scenario>
Regards
Ashis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sipforum.org/pipermail/discussion/attachments/20080417/339bb24d/attachment-0002.html>
More information about the discussion
mailing list