One Way Audio Issue, selectively decided if RTP flows directly or not

I have an issue with my asterisk server and one way voice. First I am running 13.2.0 (I know we need to update, it is on the list our tech department has been very busy though)

I have callers that are at multiple locations over a VPN network it is a hub and spoke layout, the hub being the data center (where the asterisk server is at). This setup has been working for awhile now with no problems. The problem I have is that we recently tried to make it so one of our smaller locations could call to another one of our smaller locations. We are getting a one way voice problem.

I think this is because the RTP can not flow through the NAT between the two sites. My question is without changing the asterisk config so that all RTP does not flow through it can I change this so just the RTP on inter extension calls flow through asterisk but RTP on outside calls flows directly between the peer and the phone?

Thank you in advance for your help.

No, that is not possible. There is not configuration for decision logic like that.

If the dialplan can be programmed to distinguish the cases, you can invoke options on Dial that conflict with the use of directmedia on those calls where you don’t want it.

Hrm! True. You could make a dynamic feature that does a NoOp which would force the media stream through Asterisk provided DTMF is using RFC2833 which it likely is.

Sorry to not understand what you mean but can you give me an example of this?

Do you mean to call Dial then have a context that is called which says directmedia=nonat,update?

So in Sip.conf have


Then in my dialplan I could call that with adding a @ correct?


Direct media is only possible if Asterisk doesn’t have to inspect the media stream. Some options on Dial require that it does inspect the media stream for the presence of specific dialled digits. Also things like recording a call require that media stream to pass through Asterisk.

ok done , fixed issue with rcom ims …
had to add the route to their rtp server !
you can get the rtp server details from rtp debug option in asterisk
manulally add the route to the server .