# How to configure asterisk so that the SDP is not modified

**URL:** <https://community.asterisk.org/t/how-to-configure-asterisk-so-that-the-sdp-is-not-modified/98719>\
**Category:** Asterisk SIP\
**Created:** [September 18, 2023, 6:28pm UTC](https://community.asterisk.org/t/how-to-configure-asterisk-so-that-the-sdp-is-not-modified/98719 "2023-09-18T18:28:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![torontoABCD](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@torontoABCD](https://community.asterisk.org/u/torontoABCD)\
**Post date:** [September 18, 2023, 6:28pm UTC](https://community.asterisk.org/t/how-to-configure-asterisk-so-that-the-sdp-is-not-modified/98719/1 "2023-09-18T18:28:23Z")

</div>

Hello, I am working on a project on which I would need the sdp not to be modified, my goal is to have the rtp stream going from peer to peer (without going through asterisk).  
Both client + the asterisk server are on the same network. Both client are using an PJSIP extension.

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [September 18, 2023, 6:34pm UTC](https://community.asterisk.org/t/how-to-configure-asterisk-so-that-the-sdp-is-not-modified/98719/2 "2023-09-18T18:34:54Z")

</div>

You can’t. Asterisk doesn’t support or implement such a thing. Any such functionality would be something you’d have to hack up the code to do in some way.

---

<div class="post-metadata">

**Author:** ![Pooh](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@Pooh](https://community.asterisk.org/u/Pooh)\
**Post date:** [September 18, 2023, 6:44pm UTC](https://community.asterisk.org/t/how-to-configure-asterisk-so-that-the-sdp-is-not-modified/98719/3 "2023-09-18T18:44:16Z")

</div>

This is generally referred to as Direct Media and is fully supported by  
Asterisk.

Is there any specific problem you are running into and are asking for  
assistance with?

Antony.

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [September 18, 2023, 7:11pm UTC](https://community.asterisk.org/t/how-to-configure-asterisk-so-that-the-sdp-is-not-modified/98719/4 "2023-09-18T19:11:22Z")

</div>

The conflict between the two answers is that direct media is not implemented by sending SDP unchanged, but rather by sending SDP with compatible descriptions for the primary audio stream.

Also note that Asterisk only supports direct media as a re-INVITEd configuration, after an initial, relay, configuration is established. Although chan\_sip has code to try to negotiate it directly, that has never been officially supported.

Note that, as the OP refers to extension in a sense used by FreePBX, but not by Asterisk, I should point out that you have to disable a lot of FreePBX for direct media to work, as anything that requires recording or monitoring, and, in most configurations, any enabling of feature codes, means that Asterisk needs access to the media stream.

---

<div class="post-metadata">

**Author:** ![torontoABCD](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@torontoABCD](https://community.asterisk.org/u/torontoABCD)\
**Post date:** [September 18, 2023, 8:54pm UTC](https://community.asterisk.org/t/how-to-configure-asterisk-so-that-the-sdp-is-not-modified/98719/5 "2023-09-18T20:54:23Z")

</div>

Thanks for the responses, I disabled some feature my FreePBX and now I have the rtp stream going from phoneA to phoneB without going to go through the server.

```auto
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.19.50.99:5060;rport=5060;branch=z9hG4bKPje762fc5d-683d-4eb2-8ede-4855af9c323d;received=172.19.50.99
From: <sip:1002@172.19.50.99;user=phone>;tag=f3517a10-dd4b-461c-bf42-df78cedb6eba
To: <sip:1001@172.19.50.99>;tag=f9e320af16
Call-ID: 0ba4a5156ebad724
CSeq: 3845 INVITE
Accept-Language: en
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, OPTIONS, UPDATE, PRACK, SUBSCRIBE, INFO, PUBLISH
Allow-Events: talk, hold, conference, LocalModeStatus
Contact: <sip:1001@172.19.50.111:5060;transport=udp>;+sip.instance="<urn:uuid:00000000-0000-1000-8000-1400E90675A2>"
Server: noname
Supported: path, replaces
Content-Type: application/sdp
Content-Length: 235

v=0
o=MxSIP 0 2 IN IP4 172.19.50.111
s=SIP Call
c=IN IP4 172.19.50.111
t=0 0
m=audio 3000 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=silenceSupp:off - - - -
a=fmtp:101 0-15
a=ptime:20
a=sendrecv

```

---

<div class="post-metadata">

**Author:** ![Chano](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/chano/32/3448_2.png) [@Chano](https://community.asterisk.org/u/Chano)\
**Post date:** [September 22, 2023, 8:24am UTC](https://community.asterisk.org/t/how-to-configure-asterisk-so-that-the-sdp-is-not-modified/98719/6 "2023-09-22T08:24:06Z")

</div>

You might get problems handling DTMF signaling in scenarios where you want Asteirsk to process them. (Eg. features configured in features.conf)

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [September 22, 2023, 8:43am UTC](https://community.asterisk.org/t/how-to-configure-asterisk-so-that-the-sdp-is-not-modified/98719/7 "2023-09-22T08:43:48Z")

</div>

Asterisk disables direct media when those are enabled.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [October 22, 2023, 8:43am UTC](https://community.asterisk.org/t/how-to-configure-asterisk-so-that-the-sdp-is-not-modified/98719/8 "2023-10-22T08:43:51Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
