Force direct path

My scenario: asterisk with sip clients and the same asterisk registering as client to voip provider.


—> indicates “REGISTER”

I want sip clients to be able to call voip provider via asterisk extensions, but RTP traffic must not go via asterisk, the audio must go direct between sip client and voip provider.
Sip clients may be behind NAT, but voip provider never.

We know that sip protocol permits it, but is there a way to force it on asterisk?
More, is it possible only RTP go directly, but SIP maintain via asterisk, for CDR?

My motivation is simple: lower bandwidth on asterisk link and call latency.

Any hint or pointer is welcome.


look at the option “canreinvite” in sip.conf.

you’ll have to make sure that your Dial() strings are setup correctly, any call monitoring, transfer ability, etc will prevent the reinvite.

hi baconbuttie,

Ok, I already read … anreinvite. I know this option.
But after read many descriptions of this option and others, I’m not sure if I can force this media path. I mean “to be sure” about the direct path. The link above just say “Connecting media paths direct to an endpoint behind NAT won’t be pretty. Especially if both devices are behind NAT”.
Do you think I can be sure if follow these rules?