This pages contains tutorials for common use. All dialplan recipes gathered from emails or conversations could stay here.
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":
<extension name="lock_codec"> <condition field="destination_number" expression="^lock_codec$"> <action application="set" data="absolute_codec_string=${rtp_use_codec_name}"/> </condition> </extension> |
<action application="set" data="execute_on_answer=execute_extension lock_codec XML default"/> |
Dialplan: sofia/internal/1007@192.168.168.35 Regex (PASS) [lock_codec] destination_number(lock_codec) =~ /^lock_codec$/ break=on-false Dialplan: sofia/internal/1007@192.168.168.35 Action set(absolute_codec_string=${rtp_use_codec_name}) 2016-12-14 00:51:19.722495 [NOTICE] switch_core_session.c:2966 Execute set(absolute_codec_string=${rtp_use_codec_name}) EXECUTE sofia/internal/1007@192.168.168.35 set(absolute_codec_string=PCMU) 2016-12-14 00:51:19.722495 [DEBUG] mod_dptools.c:1562 SET sofia/internal/1007@192.168.168.35 [absolute_codec_string]=[PCMU] |