Hello Pavel,
I have separated my scripts into two parts: one for REGISTER and another
for Incoming INVITE. In the REGISTER script, I have hardcoded the Contact
header with a specific port, and I have started the UAS (User Agent Server)
script on the same address and port specified in the Contact header.
Also I have added pause milliseconds="120000" to make the REGISTER session
alive.
However, the issue persists regardless of whether I hardcode the Contact
header or not. When I initiate a call, the INVITE is still sent to the
REGISTER SIPp instance instead of being directed to the INVITE SIPp
instance.
#########
#########
/usr/local/src/sipp-3.5.3/sipp -sf reg_with_contact.xml -inf test_itly.csv
-i 88.12.45.295 -p 5061 78.12.45.256:5061 -t ln -tls_key $PWD/myx_key.pem
-tls_cert myx_cert.pem -m 1
#########
#########
cat reg_with_separate_contact.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="UAC with media">
<send retrans="500">
<![CDATA[
REGISTER sip:[field1];transport=tls SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:[field0]@[field1]>;tag=[call_number]
To: <sip:[field0]@[field1]:[remote_port]>
Call-ID: [call_id]
CSeq: 1 REGISTER
Contact: sip:[email protected]:5069
Max-Forwards: 5
Expires: 3600
Allow:INVITE,ACK,BYE,CANCEL,OPTIONS,MESSAGE,INFO,UPDATE,REGISTER,REFER,NOTIFY
k:timer,path,replaces
User-Agent: SIPp
Content-Length: 0
]]>
</send>
<recv response="401" auth="true">
</recv>
<send retrans="500">
<![CDATA[
REGISTER sip:[field1];transport=tls SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:[field0]@[field1]>;tag=[call_number]
To: <sip:[field0]@[field1]>
Call-ID: [call_id]
CSeq: 2 REGISTER
Contact: sip:[email protected]:5069
[field2]
Max-Forwards: 5
Expires: 3600
Allow:INVITE,ACK,BYE,CANCEL,OPTIONS,MESSAGE,INFO,UPDATE,REGISTER,REFER,NOTIFY
k:timer,path,replaces
User-Agent: SIPp
Content-Length: 0
]]>
</send>
<!--recv response="100" auth="true">
</recv-->
<recv response="100" optional="true">
</recv>
<recv response="200"></recv>
<pause milliseconds="120000">
<send retrans="500">
<![CDATA[
REGISTER sip:[field1];transport=tls SIP/2.0
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
From: <sip:[field0]@[field1]>;tag=[call_number]
To: <sip:[field0]@[field1]>
Call-ID: [call_id]
CSeq: 3 REGISTER
Contact: sip:[email protected]:5069
[field2]
Max-Forwards: 5
Expires: 3600
Allow:INVITE,ACK,BYE,CANCEL,OPTIONS,MESSAGE,INFO,UPDATE,REGISTER,REFER,NOTIFY
k:timer,path,replaces
User-Agent: SIPp
Content-Length: 0
]]>
</send>
<!--recv response="100" auth="true">
</recv-->
<recv response="100" optional="true">
</recv>
<recv response="200"></recv>
<pause milliseconds="120000"/>
<!-- 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>
#######
#######
Incoming Call Script:
/usr/local/src/sipp-3.5.3/sipp -sf 200OK_Media-caller-bye.xml -i
88.12.45.295 -p 5069 -t ln -tls_key $PWD/myx_key.pem -tls_cert myx_cert.pem
#######
#######
cat 200OK_Media-caller-bye.xml
<?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 'uas' 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">
<action>
<!--ereg regexp="\<(.*)\>" search_in="hdr" header="Contact:"
check_it="true" assign_to="new" />
<ereg regexp=".*" search_in="hdr" header="From:"
assign_to="remote_from"/>
<ereg regexp=".*" search_in="hdr" header="To:"
assign_to="remote_to"/-->
<ereg regexp=".*" search_in="hdr" header="Record-Route:" occurence="1"
assign_to="2"/>
<ereg regexp=".*" search_in="hdr" header="Record-Route:" occurence="2"
assign_to="3"/>
</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 100 Trying
Record-Route: [$2]
Record-Route: [$3]
[last_Via:]
[last_From:]
[last_To:]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send-->
<send>
<![CDATA[
SIP/2.0 180 Ringing
Record-Route: [$2]
Record-Route: [$3]
Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Length: 0
]]>
</send>
<send retrans="500">
<![CDATA[
SIP/2.0 200 OK
Record-Route: [$2]
Record-Route: [$3]
[last_via]
[last_From:]
[last_To:];tag=[call_number]
[last_Call-ID:]
[last_CSeq:]
Contact: <sip:[local_ip]:[local_port];transport=[transport]>
Content-Type: application/sdp
Content-Length: [len]
v=0
o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
s= Kumartest
c=IN IP[media_ip_type] [media_ip]
t=0 0
m=audio [media_port] RTP/AVP 0 101 13
o=FreeSWITCH 1728427243 1728427244 IN IP4 30.30.30.30
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=rtpmap:13 CN/8000
a=ptime:20
]]>
</send>
<recv request="ACK"
rtd="true"
crlf="true">
</recv>
<!-- Play an RTP Stream -->
<nop>
<action>
<exec play_pcap_audio="playspeech.pcap"/>
</action>
</nop>
<!--pause milliseconds="120000"/-->
<recv request="BYE">
</recv>
<send>
<![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>
<!-- Keep the call open for a while in case the 200 is lost to be -->
<!-- able to retransmit it if we receive the BYE again. -->
<!-- pause milliseconds="4000"/-->
<!-- 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>
Best Regards,
KJM
On Tue, Dec 10, 2024 at 12:12 PM Jyotirmaya Mohanty <[email protected]>
wrote:
> Hello Pavel,
>
> Could you please review my script an suggest the required changes.
>
> modified_reg_with_call.xml
>> <?xml version="1.0" encoding="ISO-8859-1" ?>
>> <!DOCTYPE scenario SYSTEM "sipp.dtd">
>> <scenario name="REGISTRATION with INCOMING CALL">
>> <send retrans="500">
>> <![CDATA[
>> REGISTER sip:[field1];transport=tls SIP/2.0
>> Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
>> From: <sip:[field0]@[field1]>;tag=[call_number]
>> To: <sip:[field0]@[field1]:[remote_port]>
>> Call-ID: [call_id]
>> CSeq: 1 REGISTER
>> Contact: sip:[field0]@[local_ip]:[local_port]
>> Max-Forwards: 5
>> Expires: 3600
>> Allow:
>> INVITE,ACK,BYE,CANCEL,OPTIONS,MESSAGE,INFO,UPDATE,REGISTER,REFER,NOTIFY
>> k: timer,path,replaces
>> User-Agent: SIPp
>> Content-Length: 0
>> ]]>
>> </send>
>>
>> <recv response="401" auth="true"></recv>
>>
>> <send retrans="500">
>> <![CDATA[
>> REGISTER sip:[field1];transport=tls SIP/2.0
>> Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
>> From: <sip:[field0]@[field1]>;tag=[call_number]
>> To: <sip:[field0]@[field1]>
>> Call-ID: [call_id]
>> CSeq: 2 REGISTER
>> Contact: sip:[field0]@[local_ip]:[local_port]
>> [field2]
>> Max-Forwards: 5
>> Expires: 3600
>> Allow:
>> INVITE,ACK,BYE,CANCEL,OPTIONS,MESSAGE,INFO,UPDATE,REGISTER,REFER,NOTIFY
>> k: timer,path,replaces
>> User-Agent: SIPp
>> Content-Length: 0
>> ]]>
>> </send>
>>
>> <recv response="100" optional="true"></recv>
>> <recv response="200"></recv>
>>
>> <recv request="INVITE" next="handle_INVITE"/>
>> <label id="handle_INVITE"/>
>>
>> <send>
>> <![CDATA[
>> SIP/2.0 100 Trying
>> Record-Route: [$2]
>> Record-Route: [$3]
>> Via: [$4]
>> Via: [$5]
>> [last_From:]
>> [last_To:]
>> [last_Call-ID:]
>> [last_CSeq:]
>> Contact: <sip:[local_ip]:[local_port];transport=[transport]>
>> Content-Length: 0
>> ]]>
>> </send>
>>
>> <send>
>> <![CDATA[
>> SIP/2.0 180 Ringing
>> Record-Route: [$2]
>> Record-Route: [$3]
>> Via: [$4]
>> Via: [$5]
>> [last_From:]
>> [last_To:];tag=[call_number]
>> [last_Call-ID:]
>> [last_CSeq:]
>> Contact: <sip:[local_ip]:[local_port];transport=[transport]>
>> Content-Length: 0
>> ]]>
>> </send>
>>
>> <send retrans="500">
>> <![CDATA[
>> SIP/2.0 200 OK
>> Record-Route: [$2]
>> Record-Route: [$3]
>> Via: [$4]
>> Via: [$5]
>> [last_From:]
>> [last_To:];tag=[call_number]
>> [last_Call-ID:]
>> [last_CSeq:]
>> Contact: <sip:[local_ip]:[local_port];transport=[transport]>
>> Content-Type: application/sdp
>> Content-Length: [len]
>>
>> v=0
>> o=user1 53655765 2353687637 IN IP[local_ip_type] [local_ip]
>> s= Kumartest
>> c=IN IP[media_ip_type] [media_ip]
>> t=0 0
>> m=audio [media_port] RTP/AVP 0 101 13
>> a=rtpmap:0 PCMU/8000
>> a=rtpmap:101 telephone-event/8000
>> a=fmtp:101 0-15
>> a=rtpmap:13 CN/8000
>> ]]>
>> </send>
>>
>> <recv request="ACK" rtd="true" crlf="true"></recv>
>>
>> <nop>
>> <action>
>> <exec play_pcap_audio="playspeech.pcap"/>
>> </action>
>> </nop>
>>
>> <recv request="BYE"></recv>
>>
>> <send>
>> <![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>
>>
>> <!-- 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>
>>
>>
> On Mon, Dec 9, 2024 at 8:18 PM Šindelka Pavel <[email protected]> wrote:
>
>> Hello KJM,
>>
>> I'd suggest you to read
>> https://sourceforge.net/p/sipp/mailman/message/34707334/ as it covers
>> most of your issue.
>>
>> The use of TLS may complicate things further, though - I hazily remember
>> that I had to patch something in the source code so that sipp could
>> initiate outgoing TCP sessions and also expect incoming ones. But on the
>> other hand, since you start by sending a REGISTER, the typical use case
>> would be that the remote party would not create a new TCP session to
>> deliver the INVITE to your scenario but rather reuse the existing one
>> created by the REGISTER, so that patch may not be necessary.
>>
>> Pavel
>>
>>
>> Dne 09.12.2024 v 14:48 Jyotirmaya Mohanty napsal(a):
>>
>> Hello Team,
>>
>> I have a query regarding SIPp script. want to REGISTER and Receive an
>> incoming call on SIPp over TLS. Is it possible?
>>
>> Messages Retrans Timeout
>> Unexpected-Msg
>> REGISTER ----------> 1 0 0
>> 401 <---------- 1 0 0 0
>> REGISTER ----------> 1 0 0
>> 100 <---------- 1 0 0 0
>> 200 <---------- 1 0 0 0
>> INVITE <---------- 0 0 0 0
>>
>> 100 ----------> 0 0
>> 180 ----------> 0 0
>> 200 ----------> 0 0 0
>> ACK <---------- E-RTD1 0 0 0 0
>>
>> [ NOP ]
>> BYE <---------- 0 0 0 0
>> 200 ----------> 0 0
>> ------- Waiting for active calls to end. Press [q] again to force exit.
>> -------
>>
>>
>> My Registration is successful, but while receiving INVITE I am getting
>> 2024-12-09 13:18:31.970086 1733750311.970086: Discarding message
>> which can't be mapped to a known SIPp call:
>> INVITE sip:[email protected]:5069
>> <http://sip:[email protected]:5069/> SIP/2.0
>>
>> For UDP transport and if I ran separate script for REGISTER and INVITE
>> UAS. It is working fine.
>>
>> Please let me know and Thanks in advance, how to run it for TLS
>>
>> Best Regards
>> KJM
>>
>>
>> _______________________________________________
>> Sipp-users mailing
>> [email protected]https://lists.sourceforge.net/lists/listinfo/sipp-users
>>
>> --
>>
>>
>> *Ing. Pavel Šindelka * senior specialista
>>
>>
>>
>>
>>
>> TTC MARCONI s. r. o.
>> Třebohostická 987/5, 100 00 Praha 10
>> +420 234 051 712, +420 602 355 199
>> [email protected], www.ttc-marconi.com
>>
>> _______________________________________________
>> Sipp-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/sipp-users
>>
>
_______________________________________________
Sipp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sipp-users