Page tree
Skip to end of metadata
Go to start of metadata

About

This pages contains tutorials for common use. All dialplan recipes gathered from emails or conversations could stay here.

 Click here to expand Table of Contents

Lock negotiated codec

In the middle of a call if one side puts the other one on hold a re-invite will occur and a new codec negotiation will happen. There's cases where you need to keep the same codec previously negotiated when the call was answered.

To accomplish this you can make an extension in the same context "assuming default for this example":

In your normal call processing extension add this condition before calling bridge:

 

Then when the channel is answered it will execute the extension and set the absolute_codec_string to whatever codec was first negotiated, that should limit what it will choose on the re-invite.
You can probably set it on both legs with "export" instead of set or by adding it also to the {} before bridge.