Skip to content

Wrong RTP port in SDP #2967

@PV22892

Description

@PV22892

Hello Everyone,
I'm not sure if this is the best place to ask, but here goes.
My Scenario:
Softphone -> FreeSWITCH -> Internet -> Asterisk
FreeSWITCH Domains:

Internal: 172.17.220.201
External: 83.240.xxx.xxx
Global

The issue occurs on outbound calls: My router or FreeSWITCH isn't updating the SDP for the RTP port, resulting in an RTP port mismatch. This leads to one-way or no audio, as the actual RTP packets are sent from a different source port than what's advertised in the SDP (likely due to NAT port remapping).

I have this configured in two outbound routes in my dialplan:

<extension name="call_direction-outbound" continue="true" uuid="aa37cf43-6efc-483f-8ff9-e3feb80fd4eb">
  <condition field="${user_exists}" expression="false"/>
  <condition field="${call_direction}" expression="^$"/>
  <condition field="destination_number" expression="^(100)$">
    <action application="set" data="rtp_manual_rtp_bugs=accept_any_packets" inline="true"/>
    <action application="export" data="call_direction=outbound" inline="true"/>
  </condition>
</extension>

<extension name="Devscope.number" continue="" uuid="fdc47941-9d66-4086-85cb-ffbb1c3c2552">
  <condition field="${user_exists}" expression="false"/>
  <condition field="destination_number" expression="^(100)$">
    <action application="export" data="call_direction=outbound" inline="true"/>
    <action application="unset" data="call_timeout"/>
    <action application="set" data="hangup_after_bridge=true"/>
    <action application="set" data="effective_caller_id_name=${outbound_caller_id_name}"/>
    <action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/>
    <action application="set" data="inherit_codec=true"/>
    <action application="set" data="ignore_display_updates=true"/>
    <action application="set" data="callee_id_number=$1"/>
    <action application="set" data="continue_on_fail=1,2,3,6,18,21,27,28,31,34,38,41,42,44,58,88,111,403,501,602,607,809"/>
    <action application="bridge" data="sofia/gateway/07143571-a044-4cb3-9650-d52267267b09/$1"/>
  </condition>
</extension>

And here's my gateway configuration (I can't check the exact XML right now, but this should be close):

<include>
  <gateway name="Devscope">
    <param name="from-domain" value="135.236.xxx.xxx" />
    <param name="proxy" value="135.236.xxx.xxx" />
    <param name="realm" value="135.236.xxx.xxx" />
    <param name="expire-seconds" value="800" />
    <param name="register" value="false" />
    <param name="retry-seconds" value="30" />
    <param name="context" value="83.240.xxx.xxx" />
    <param name="distinct-to" value="false" />
    <param name="extension-in-contact" value="false" />
    <param name="enabled" value="true" />
    <!-- Description: Devscope SIP Trunk -->
    <!-- Domain (tenant): 172.17.220.201 -->
  </gateway>
</include>

SIP Log:
From FreeSWITCH SDP:
c=IN IP4 83.240.xxx.xxx
t=0 0
m=audio 20432 RTP/AVP 9 0 8 101

From Asterisk SDP:
c=IN IP4 135.236.108.143
t=0 0
m=audio 13868 RTP/AVP 9 0 8 101

I've attached a screenshot of the relevant packet capture/log for more details:
Image

Any help or suggestions would be greatly appreciated! I've tried settings like disable_rtp_auto_adjust and symmetric RTP on the Asterisk side, but no luck so far.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions