How to configure canreinvite in dialplan?

When canreinvite=no is configured in sip.conf, Asterisk can be forced to proxy media, but I only want to proxy media for part of the call. Is it possible?
Similar to configuring this in dialplan:

exten => _.,1,Set(canreinvite=no)

Asterisk will only do direct media when two devices are bridged that have it enabled, otherwise media goes through Asterisk. Is that not sufficient? Are you wanting to do it while in a call or something?

We hope to always be direct media, but in some scenarios proxy media, such as when the initiator is sipp, sipp is not friendly to re-invite processing, so I want to know if it can be controlled in dialplan.
I have solved this problem by creating different users in sip.conf, just curious, if I want to implement it in dialplan, how should I do it, haha.

There is no configurability of it in the dialplan. It’s only through specific options that would inherently force media to go through Asterisk that you can control it.

ok thank you very much.

sipp is a testing tool; it seems to be strange to be adapting the target to the testing tool, rather than the other way round.

Lots of things that can be done from the dialplan will inhibit direct media, e.g. setting any option on Dial that enables feature codes will do it (although possibly not for dtmfmode=info), recording calls will do it, I presume spying a channel will do it.

Also, canreinvite was renamed directmedia about a decade ago, and only ever existed under the name canreinvite in chan_sip, which is deprecated, and will be removed next year.

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