Early media, set sendrecv on SDP of 183

Hi,

We identified that ASTPP doesn’t forward the sendrecv property to the customer, while the carrier is sending it.

This is the scenario: the customer, A party, originates a call to any number; ASTPP receives the call, forwards the request to any carrier, the carrier answers with the proper 183 (including the sendrecv), then ASTPP forwards the 183 to the A party but without the sendrecv property in the SDP.

This is affecting the early media and the ability of some autodialers to identify the voicemail (AMD).

This is how the SDP of the carrier looks like:

recv 747 bytes from udp/[carrier.ip.v4.add]:5060 at 09:12:31.815027:
------------------------------------------------------------------------
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP astpp.ip.v4.add;branch=z9hG4bK3j9UKQS0Uc8DN;received=astpp.ip.v4.add;rport=5060
From: "51995992664" <sip:a-number@astpp.ip.v4.add>;tag=0pcFmerQSBF0N
To: <sip:b-number@carrier.ip.v4.add>;tag=sbcsipuas_1_C46184_20260917101230631_b02sbc02
Call-ID: a94574ed-2d44-1240-2798-02da8e1f18c9
Contact: <sip:carrier.ip.v4.add:5060>
CSeq: 120273383 INVITE
Allow: ACK,BYE,CANCEL,INVITE,OPTIONS,NOTIFY,INFO,UPDATE
Server: sbc_138
Content-Type: application/sdp
Content-Length: 226

v=0
o=SBCSIPUAS 1047122486 1 IN IP4 carrier.ip.v4.add
s=SBCSIPUAS SIP STACK v1.0
c=IN IP4 carrier.ip.v4.add
t=0 0
m=audio 21862 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv  <<<<<------HERE IS THE SDP PROPERTY FROM THE CARRIER
 -----------------------------------------------------------------------

This is how the SDP from ASTPP to the customer looks like:

send 1001 bytes to udp/[a.party.ip.add]:5060 at 09:12:32.201124:
 ------------------------------------------------------------------------
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP a.party.ip.add:5060;branch=z9hG4bK7e954ca7;rport=5060
From: <sip:a-number@a.party.ip.add>;tag=as41f9f2dc
To: <sip:b-number@astpp.ip.v4.fqdn:5060>;tag=y4SXgrpgZS2te
Call-ID: 5c7cfd1748932a1b7f83e30b1995141a@a.party.ip.add:5060
CSeq: 103 INVITE
Contact: <sip:51951183372@astpp.ip.v4.add:5060;transport=udp>
User-Agent: ASTPP
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: path, replaces
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Content-Type: application/sdp
Content-Disposition: session
Content-Length: 210

v=0
o=FreeSWITCH 1619739356 1619739358 IN IP4 astpp.ip.v4.add
s=FreeSWITCH
c=IN IP4 astpp.ip.v4.add
t=0 0
m=audio 17190 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15 
<<<<<------HERE IS WEHRE ASTPP MISS THE SDP PROPERTY 'senrecv' TO THE CUSTOMER
------------------------------------------------------------------------

I have tried to edit /opt/ASTPP/freeswitch/scripts/astpp/scripts/astpp.xml.lua with several different options like:

line 56:

...
    table.insert(xml, [[<action application="set" data="continue_on_fail=TRUE"/>]]);
    -- FORCE EARLY MEDIA & SDP DIRECTION ATTRIBUTES HERE --
    --table.insert(xml, [[<action application="set" data="proxy_media=true"/>]]);
    --table.insert(xml, [[<action application="set" data="ignore_early_media=false"/>]]);
    --table.insert(xml, [[<action application="pre_answer"/>]]);
    --table.insert(xml, [[<action application="export" data="sip_append_audio_sdp=\na=sendrecv"/>]]);
    --table.insert(xml, [[<action application="set" data="sip_provisional_media_attributes=sendrecv"/>]]);
    --table.insert(xml, [[<action application="set" data="media_mix_inbound_outbound_sdp=true"/>]]);
    table.insert(xml, [[<action application="set" data="account_id=]]..customer_userinfo['id']..[["/>]]);
    table.insert(xml, [[<action application="set" data="parent_id=]]..customer_userinfo['reseller_id']..[["/>]]);
    table.insert(xml, [[<action application="set" data="entity_id=]]..customer_userinfo['type']..[["/>]]);
    table.insert(xml, [[<action application="set" data="call_processed=internal"/>]]);
    table.insert(xml, [[<action application="set" data="call_direction=]]..call_direction..[["/>]]);
...

The commented lines test different combinations of actions, but none worked; the SDP still lacks the sendrcv option.

Also, we have tried adding settings to the sofia profile through the GUI:

media-option=media_direction_in_manifest,resume-media-on-hold
inbound-bypass-media=false
inbound-proxy-media=true
inbound-late-negotiation=true

I’m not sure what else to try; any help or ideas would be welcome. Thank you!

David

Possible fix to try first: Add this to the external SIP profile (external.xml) and reload it:

xml

<param name="NDLB-sendrecv-in-session" value="true"/>

This is a FreeSWITCH parameter intended to force a=sendrecv into session SDP. Worth testing, but verify it exists in your FreeSWITCH version before relying on it.

After adding this parameter, you will need to reload the SIP profile (sofia profile external restart or reloadxml + sofia profile external rescan) for it to take effect.

If that doesn’t work: The more reliable fix is an SBC in the signaling path between the carrier and ASTPP/FreeSWITCH, configured to normalize/preserve SDP direction attributes on provisional responses.

Kamailio: Possible with sdpops/textops, but only worth it if you already have Kamailio in the path — otherwise it adds complexity for little gain.

-2cents + grain of salt-

Hi,

Thanks for your reply. I will try your suggestion in a couple of hours, when service hours are done.

But I couldn’t find the file external.xml, do you know the path to it or if have any other name?

Thank you, David

What FreeSWITCH Uses by Default

The external profile is just the default suggestion. In a stock FreeSWITCH install, you would find it at:

conf/sip_profiles/external.xml

However, this file often acts as a template. It contains X-PRE-PROCESS directives that load other XML files (like gateways) from a subdirectory. The file itself might exist, but the person looking might be in the wrong directory or looking for a file that’s been renamed.

:hammer_and_wrench: Where to Look in an ASTPP Setup

Since you are on an ASTPP system, the paths and filenames are likely customized. You should have the person check these locations:

1. ASTPP-Specific Profile File: ASTPP installation scripts often replace the default profiles with a file named astpp.xml. Look for: conf/sip_profiles/astpp.xml .

2. Check the Active Directory: The actual running configuration is often under /usr/local/freeswitch/conf/sip_profiles/ or /etc/freeswitch/sip_profiles/ depending on the install method. The person should list that directory.

3. Find the “Real” External Profile: Use sofia status in the FreeSWITCH CLI. This will show the actual profile names currently loaded (e.g., “external”, “internal”, “astpp”). The corresponding configuration file will be named after that profile (e.g., external.xml, astpp.xml).

:white_check_mark: What to Look For

The external profile is a default template. In ASTPP setups, the actual profile is often renamed to astpp.xml. Check conf/sip_profiles/ for the active file, or run sofia status to see the profile name currently in use.

+2 cents and a grain of salt