Hi all!
my DEV/LAB environment is comprised of 3 nodes: - SIP 1 with Asterisk and SIPP installed (IP 10.20.0.5) - SIP 2 with Kamailio 5.8 (IP 10.20.0.4) - SIP 3 with Asterisk and SIPP installed (IP 10.20.0.6)
Kamailio is set as a stateful SIP Proxy and seems to be working fine (the configuration is pretty standard, using dispatcher to dispatch to destination, even though there is only 1 destination endpoint -» SIP 3)
When establishing a call from SIP 1 using Asterisk, the termination is correctly done on SIP 3, also running Asterisk. Hanging up call on SIP 3 will send the correct BYE command to SIP 1 (of course, Kamailio is always between the dialogs)
When establishing a call from SIP 1 using SIPP and UAC scenario, the termination is correctly done on SIP 3 also running SIPP with a UAS scenario. However, hanging up the call on SIP 3 (SIPP scenario has a Pause of 2 seconds then sends a BYE message), the BYE command is not forwarded by Kamailio and SIPP keep sending BYE commands.
This is an example of the ACK and BYE command being sent from SIP 3:
ACK sip:10.20.0.6:5060;transport=UDP SIP/2.0 Via: SIP/2.0/UDP 10.20.0.4;branch=z9hG4bK680a.47d763c3f0732dbe0fdb64ccbeb3454a.0 Via: SIP/2.0/UDP 10.20.0.5:5060 ;received=10.20.0.5;branch=z9hG4bK01175d44;rport=5060 Max-Forwards: 69 From: "Anonymous" sip:anonymous@anonymous.invalid;tag=as023237be To: sip:1000@10.20.0.4;tag=20 Contact: sip:anonymous@10.20.0.5:5060 Call-ID: 568f1bbe197039983fc89cc6403b927b@10.20.0.5:5060 CSeq: 102 ACK User-Agent: Asterisk PBX 18.17.1 Content-Length: 0
and then:
BYE sip:anonymous@10.20.0.5:5060 SIP/2.0 Via: SIP/2.0/UDP 10.20.0.6:5060 Route: sip:10.20.0.4;lr=on;ftage=46906 Max-Forwards: 70 From: sipp sip:sipp@10.20.0.6:5060;tag=46906SIPpTag0120 To: : "Anonymous" sip:anonymous@anonymous.invalid;tag=as023237be Call-ID: 568f1bbe197039983fc89cc6403b927b@10.20.0.5:5060 Cseq: 2 BYE Contact: sip:sipp@10.20.0.6:5060 Content-Length: 0 Subject: Sending BYE
I'm pretty sure that the issue is within the SIPP Scenario(s), and my guess goes to the UAS scenario on SIP 3 that has some issue with the BYE command, but I can't figure why the message is wrong!
The goal is to have a Testing environment where we can simulate different call situations. SIPP is a wonderful tool but such a PITA !! Probably i am missing some detail somewhere....
Has anyone done such a testing environment? Can anyone share a SIPP UAS scenario where the BYE command is sent from the UAS (send BYE instead of recv BYE) ?
SIPP is launched on SIP 1 with: sipp -sf uac.xml -i 10.20.0.5 -p 5060 10.20.0.4 -r 1 -m 1
SIPP is launched on SIP 3 with: sipp -aa -sf uas5.xml -i 10.20.0.6 -p 5060
Thanks in advance.
Atenciosamente / Kind Regards / Cordialement / Un saludo,
*Sérgio Charrua*
At a glance, I guess that the missing branch parameter in the Via of the BYE is the cause. Nothing else stands out as being invalid.
If you're still stuck, add some xlog statements to kamailio and increase the debug level.
James
On Thu 8 May 2025, 18:10 Sergio Charrua via sr-users, < sr-users@lists.kamailio.org> wrote:
Hi all!
my DEV/LAB environment is comprised of 3 nodes:
- SIP 1 with Asterisk and SIPP installed (IP 10.20.0.5)
- SIP 2 with Kamailio 5.8 (IP 10.20.0.4)
- SIP 3 with Asterisk and SIPP installed (IP 10.20.0.6)
Kamailio is set as a stateful SIP Proxy and seems to be working fine (the configuration is pretty standard, using dispatcher to dispatch to destination, even though there is only 1 destination endpoint -» SIP 3)
When establishing a call from SIP 1 using Asterisk, the termination is correctly done on SIP 3, also running Asterisk. Hanging up call on SIP 3 will send the correct BYE command to SIP 1 (of course, Kamailio is always between the dialogs)
When establishing a call from SIP 1 using SIPP and UAC scenario, the termination is correctly done on SIP 3 also running SIPP with a UAS scenario. However, hanging up the call on SIP 3 (SIPP scenario has a Pause of 2 seconds then sends a BYE message), the BYE command is not forwarded by Kamailio and SIPP keep sending BYE commands.
This is an example of the ACK and BYE command being sent from SIP 3:
ACK sip:10.20.0.6:5060;transport=UDP SIP/2.0 Via: SIP/2.0/UDP 10.20.0.4;branch=z9hG4bK680a.47d763c3f0732dbe0fdb64ccbeb3454a.0 Via: SIP/2.0/UDP 10.20.0.5:5060 ;received=10.20.0.5;branch=z9hG4bK01175d44;rport=5060 Max-Forwards: 69 From: "Anonymous" sip:anonymous@anonymous.invalid;tag=as023237be To: sip:1000@10.20.0.4;tag=20 Contact: sip:anonymous@10.20.0.5:5060 Call-ID: 568f1bbe197039983fc89cc6403b927b@10.20.0.5:5060 CSeq: 102 ACK User-Agent: Asterisk PBX 18.17.1 Content-Length: 0
and then:
BYE sip:anonymous@10.20.0.5:5060 SIP/2.0 Via: SIP/2.0/UDP 10.20.0.6:5060 Route: sip:10.20.0.4;lr=on;ftage=46906 Max-Forwards: 70 From: sipp sip:sipp@10.20.0.6:5060;tag=46906SIPpTag0120 To: : "Anonymous" sip:anonymous@anonymous.invalid;tag=as023237be Call-ID: 568f1bbe197039983fc89cc6403b927b@10.20.0.5:5060 Cseq: 2 BYE Contact: sip:sipp@10.20.0.6:5060 Content-Length: 0 Subject: Sending BYE
I'm pretty sure that the issue is within the SIPP Scenario(s), and my guess goes to the UAS scenario on SIP 3 that has some issue with the BYE command, but I can't figure why the message is wrong!
The goal is to have a Testing environment where we can simulate different call situations. SIPP is a wonderful tool but such a PITA !! Probably i am missing some detail somewhere....
Has anyone done such a testing environment? Can anyone share a SIPP UAS scenario where the BYE command is sent from the UAS (send BYE instead of recv BYE) ?
SIPP is launched on SIP 1 with: sipp -sf uac.xml -i 10.20.0.5 -p 5060 10.20.0.4 -r 1 -m 1
SIPP is launched on SIP 3 with: sipp -aa -sf uas5.xml -i 10.20.0.6 -p 5060
Thanks in advance.
Atenciosamente / Kind Regards / Cordialement / Un saludo,
*Sérgio Charrua* __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!
Thanks James!
After banging my head to the wall during (all) the afternoon I solved it. I had to use regex to extract data from the initial Invite and then build the BYE with the values extracted. For future reference and anyone having similar issue, here is the final scenario script:
<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE scenario SYSTEM
"sipp.dtd"> <scenario name="UAS sends BYE after pause">
<recv request="INVITE" rrs="true"> <action> <!-- Save the incoming Contact header for correct BYE destination --> <ereg regexp="\s*(<sip:[^>]+>)" search_in="hdr" header="Contact:" check_it="true" assign_to="1"/> <ereg regexp=":([^;@]+)" search_in="hdr" header="To:" assign_to="2"/> <ereg regexp="[[:space:]]*<sip:[^@]+@([^>]+)>" search_in="hdr" header="Contact:" assign_to="3"/> <ereg regexp="@([^;@]*:[0-9]+)" search_in="hdr" header="Contact:" assign_to="4"/> <ereg regexp=":([^;@]+)" search_in="var" variable="1" assign_to="5"/> <ereg regexp=".*" search_in="hdr" header="From:" check_it="true" assign_to="6"/> </action> </recv>
<send> <![CDATA[ SIP/2.0 100 Trying [last_Via:] [last_Record-Route:] [last_From:] [last_To:] [last_Call-ID:] [last_CSeq:] Contact: <sip[$2][$4]> Content-Length: 0 ]]> </send>
<pause milliseconds="200"/>
<!-- send retrans="500">
<![CDATA[ SIP/2.0 180 Ringing [last_Via:] [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" rrs="true">
<![CDATA[ SIP/2.0 200 OK [last_Via:] [last_Record-Route:] [last_From:] [last_To:];tag=[call_number] [last_Call-ID:] [last_CSeq:] Contact: <sip[$2]@[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=- c=IN IP[media_ip_type] [media_ip] t=0 0 m=audio [media_port] RTP/AVP 0 a=rtpmap:0 PCMU/8000 ]]>
</send>
<recv request="ACK"/>
<!-- Call established, pause and then initiate BYE -->
<pause milliseconds="2000"/>
<send>
<![CDATA[ BYE sip[$5][$4] SIP/2.0 Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch] [routes] From: <sip[$2]@[remote_ip]>;tag=[call_number] To: [$6] Call-ID: [call_id] CSeq: 102 BYE Max-Forwards: 70 Content-Length: 0 ]]>
</send>
<recv response="200" optional="true"/> </scenario>
The main issue was related to how SIPP scenarios are managing SIP headers and routes.
What the problem seemed to be: - Kamailio instance, on SIP 2, is stateful and is inserting appropriate SIP headers (Via, Record-Route) to maintain dialog state. - Asterisk calls, on SIP 1, are working fine because Asterisk correctly uses and processes these headers. - SIPP UAS scenario on SIP 3 doesn't correctly handle these headers when sending the BYE message, resulting in Kamailio failing to forward the BYE.
So what a UAS must do is extract some values of the initial headers, which I did using RegEx at the beginning of the scenario. Regex (Posix) support on SIPP is limited: for example, I couldn’t figure out how to remove some characters from a string. And once I have all values in variables (from $1 to $6) , I can then use the values in the SIP messages.
NOTE: Launch the SIPP with:
sipp -aa -sf my_scenario.xml -i 10.20.0.6 -p 5060 10.20.0.4
Et voilá! Seems to be working.
Atenciosamente / Kind Regards / Cordialement / Un saludo,
*Sérgio Charrua*
On Fri, May 9, 2025 at 8:15 PM James Browne james@frideo.com wrote:
At a glance, I guess that the missing branch parameter in the Via of the BYE is the cause. Nothing else stands out as being invalid.
If you're still stuck, add some xlog statements to kamailio and increase the debug level.
James
On Thu 8 May 2025, 18:10 Sergio Charrua via sr-users, < sr-users@lists.kamailio.org> wrote:
Hi all!
my DEV/LAB environment is comprised of 3 nodes:
- SIP 1 with Asterisk and SIPP installed (IP 10.20.0.5)
- SIP 2 with Kamailio 5.8 (IP 10.20.0.4)
- SIP 3 with Asterisk and SIPP installed (IP 10.20.0.6)
Kamailio is set as a stateful SIP Proxy and seems to be working fine (the configuration is pretty standard, using dispatcher to dispatch to destination, even though there is only 1 destination endpoint -» SIP 3)
When establishing a call from SIP 1 using Asterisk, the termination is correctly done on SIP 3, also running Asterisk. Hanging up call on SIP 3 will send the correct BYE command to SIP 1 (of course, Kamailio is always between the dialogs)
When establishing a call from SIP 1 using SIPP and UAC scenario, the termination is correctly done on SIP 3 also running SIPP with a UAS scenario. However, hanging up the call on SIP 3 (SIPP scenario has a Pause of 2 seconds then sends a BYE message), the BYE command is not forwarded by Kamailio and SIPP keep sending BYE commands.
This is an example of the ACK and BYE command being sent from SIP 3:
ACK sip:10.20.0.6:5060;transport=UDP SIP/2.0 Via: SIP/2.0/UDP 10.20.0.4;branch=z9hG4bK680a.47d763c3f0732dbe0fdb64ccbeb3454a.0 Via: SIP/2.0/UDP 10.20.0.5:5060 ;received=10.20.0.5;branch=z9hG4bK01175d44;rport=5060 Max-Forwards: 69 From: "Anonymous" sip:anonymous@anonymous.invalid;tag=as023237be To: sip:1000@10.20.0.4;tag=20 Contact: sip:anonymous@10.20.0.5:5060 Call-ID: 568f1bbe197039983fc89cc6403b927b@10.20.0.5:5060 CSeq: 102 ACK User-Agent: Asterisk PBX 18.17.1 Content-Length: 0
and then:
BYE sip:anonymous@10.20.0.5:5060 SIP/2.0 Via: SIP/2.0/UDP 10.20.0.6:5060 Route: sip:10.20.0.4;lr=on;ftage=46906 Max-Forwards: 70 From: sipp sip:sipp@10.20.0.6:5060;tag=46906SIPpTag0120 To: : "Anonymous" sip:anonymous@anonymous.invalid;tag=as023237be Call-ID: 568f1bbe197039983fc89cc6403b927b@10.20.0.5:5060 Cseq: 2 BYE Contact: sip:sipp@10.20.0.6:5060 Content-Length: 0 Subject: Sending BYE
I'm pretty sure that the issue is within the SIPP Scenario(s), and my guess goes to the UAS scenario on SIP 3 that has some issue with the BYE command, but I can't figure why the message is wrong!
The goal is to have a Testing environment where we can simulate different call situations. SIPP is a wonderful tool but such a PITA !! Probably i am missing some detail somewhere....
Has anyone done such a testing environment? Can anyone share a SIPP UAS scenario where the BYE command is sent from the UAS (send BYE instead of recv BYE) ?
SIPP is launched on SIP 1 with: sipp -sf uac.xml -i 10.20.0.5 -p 5060 10.20.0.4 -r 1 -m 1
SIPP is launched on SIP 3 with: sipp -aa -sf uas5.xml -i 10.20.0.6 -p 5060
Thanks in advance.
Atenciosamente / Kind Regards / Cordialement / Un saludo,
*Sérgio Charrua* __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions -- sr-users@lists.kamailio.org To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!