freeswitch icon indicating copy to clipboard operation
freeswitch copied to clipboard

Freeswitch Bug when SDP on 180

Open patrickarton opened this issue 4 years ago • 2 comments

Describe the bug Freeswitch send 183 instead of 180 ( with SDP ) when the 180 contains SDP

To Reproduce Steps to reproduce the behavior:

  1. create one sipp uac and sipp uas
  2. Dial from sipp uac to sipp uas through freeswitch
  3. sipp uas include SDP in 180
  4. FreeSWITCH forward 183 with SDP instead of 180 with SDP

Expected behavior Freeswitch must forward the SIP 180 along with SDP

Package version or git hash

  • Version 1.10.6

Trace logs Provide freeswitch logs w/ DEBUG and UUID logging enabled

sipp uac

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">
<scenario name="Basic UAC">
  <!-- In client mode (sipp placing calls), the Call-ID MUST be         -->
  <!-- generated by sipp. To do so, use [call_id] keyword.                -->

  <send retrans="500">
    <![CDATA[

      INVITE sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
      To: [service] <sip:[service]@[remote_ip]:[remote_port]>
      Call-ID: [call_id]
      CSeq: 1 INVITE
      Contact: sip:sipp@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      Content-Type: application/sdp
      Content-Length: [len]

      v=0
      o=kamuac 53655765 2353687637 IN IP[local_ip_type] [local_ip]
      s=-
      c=IN IP[media_ip_type] [media_ip]
      t=0 0
      m=audio [rtpstream_audio_port] RTP/AVP 8 101 
      a=rtpmap:8 PCMA/8000
      a=rtpmap:101 telephone-event/8000
      a=fmtp:101 0-15


    ]]>
  </send>

  <recv response="100" rtd="true" optional="true">
  </recv>

  <recv response="180" rtd="true" optional="true">
  </recv>

  <recv response="183" rtd="true" optional="true">
  </recv>



  <!-- 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 response="200" rtd="true" rrs="true">
  </recv>

  <!-- Packet lost can be simulated in any send/recv message by         -->
  <!-- by adding the 'lost = "10"'. Value can be [1-100] percent.       -->
  <send>
    <![CDATA[

      ACK [next_url] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
      To: [service] <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
      Call-ID: [call_id]
      CSeq: 1 ACK
      Contact: sip:sipp@[local_ip]:[local_port]
      [routes]
      Max-Forwards: 70
      Content-Length: 0

    ]]>
  </send>

  <nop>
    <action>
        <exec rtp_stream="/var/sipp/scripts/pcap/voice-man.wav,-1,8,PCMA/8000"/>
    </action>
  </nop> 
  
  <!-- This delay can be customized by the -d command-line option       -->
  <!-- or by adding a 'milliseconds = "value"' option here.             -->
  <pause />

  <!-- The 'crlf' option inserts a blank line in the statistics report. -->
  <send retrans="500" crlf="true">
    <![CDATA[

      BYE [next_url] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
      To: [service] <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
      Call-ID: [call_id]
      CSeq: 2 BYE
      Contact: sip:sipp@[local_ip]:[local_port]
      Max-Forwards: 70
      Subject: Performance Test
      [routes]
      Content-Length: 0

    ]]>
  </send>

  <recv response="200" crlf="true" next="10">
  </recv>

  <label id="9" rtd="true" />
  <send>
    <![CDATA[

      ACK sip:[service]@[remote_ip]:[remote_port] SIP/2.0
      Via: SIP/2.0/[transport] [local_ip]:[local_port];branch=[branch]
      From: sipp <sip:sipp@[local_ip]:[local_port]>;tag=[pid]SIPpTag00[call_number]
      To: [service] <sip:[service]@[remote_ip]:[remote_port]>[peer_tag_param]
      Call-ID: [call_id]
      CSeq: 1 ACK
      Contact: sip:sipp@[local_ip]:[local_port]
      Max-Forwards: 70
      Content-Length: 0

    ]]>
  </send>  
  
  <label id="10" rtd="true" />

  <!-- 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>

sipp uas If applicable, provide the full backtrace from the core file.

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE scenario SYSTEM "sipp.dtd">

<scenario name="Basic UAS responder">
  <recv request="INVITE" crlf="true">

  </recv>

  <send>
    <![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-Type: application/sdp
      Content-Length: [len]

      v=0
      o=fsuas 87308505 1 IN IP[local_ip_type] [local_ip]
      s=-
      t=0 0
      c=IN IP[media_ip_type] [media_ip]
      m=audio [rtpstream_audio_port] RTP/AVP 8 101
      a=rtpmap:8 PCMA/8000
      a=rtpmap:101 telephone-event/8000
      a=fmtp:101 0-15      
      


    ]]>
  </send>

  <send retrans="500">
    <![CDATA[

      SIP/2.0 200 OK
      [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>

  <recv request="ACK" crlf="true">
  </recv>

  <nop>
    <action>
        <exec rtp_stream="/var/sipp/scripts/pcap/voice-woman.wav,-1,8,PCMA/8000"/>
    </action>
  </nop> 
  
  <pause  />

  <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>

Freeswitch-bug-180-183

patrickarton avatar Oct 27 '21 10:10 patrickarton

Looks like it has been discussed here... My understanding is, FS is a B2BUA, not a SIP proxy... https://lists.freeswitch.org/pipermail/freeswitch-users/2016-August/121974.html

nttranbao avatar Mar 30 '22 20:03 nttranbao

Hello, you may already found a solution but to share my experience, I faced the same issue when deploying freeswitch as an sbc to handle traffic from an FR carrier.

For some reason, FS automatically converts received 180+SDP to 183+SDP and 183 without SDP to 180. The given reason is debatable but my solution was to make a patch to remove this automatic conversion and keep the same received progress code as it was a hard requirement for the certification tests.

vma avatar May 19 '22 09:05 vma

Hi Guys, Did you found the correction to fix this bug? I met the same bug and it is very urgent for me to fix it. Thanks you very much for your feedback Bests regards

ousseynou1980 avatar Nov 29 '22 14:11 ousseynou1980