Add support for changing the outbound codec on a SIP call using

a dialplan variable.

This adds a dialplan variable (SIP_CODEC_OUTBOUND) which controls
the codec offered for an outgoing SIP call. This is much like the
SIP_CODEC dialplan variable and has the same restrictions. The codec
set must be one that is configured for the call.

(closes issue #13243)
Reported by: samdell3
Patches:
      13243.diff uploaded by file (license 11)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
certified/1.8.6
Joshua Colp 16 years ago
parent 02b56bb7d2
commit 4eaa651a8a

@ -15,6 +15,9 @@ SIP Changes
-----------
* Added preferred_codec_only option in sip.conf. This feature limits the joint
codecs sent in response to an INVITE to the single most preferred codec.
* Added SIP_CODEC_OUTBOUND dialplan variable which can be used to set the codec
to be used for the outgoing call. It must be one of the codecs configured
for the device.
Applications
------------

@ -5836,7 +5836,12 @@ static void try_suggested_sip_codec(struct sip_pvt *p)
int fmt;
const char *codec;
codec = pbx_builtin_getvar_helper(p->owner, "SIP_CODEC");
if (p->outgoing_call) {
codec = pbx_builtin_getvar_helper(p->owner, "SIP_CODEC_OUTBOUND");
} else if (!(codec = pbx_builtin_getvar_helper(p->owner, "SIP_CODEC_INBOUND"))) {
codec = pbx_builtin_getvar_helper(p->owner, "SIP_CODEC");
}
if (!codec)
return;
@ -9838,6 +9843,7 @@ static int transmit_reinvite_with_sdp(struct sip_pvt *p, int t38version, int old
if (p->do_history)
append_history(p, "ReInv", "Re-invite sent");
try_suggested_sip_codec(p);
if (t38version)
add_sdp(&req, p, oldsdp, FALSE, TRUE);
else
@ -10199,8 +10205,10 @@ static int transmit_invite(struct sip_pvt *p, int sipmethod, int sdp, int init)
ast_udptl_offered_from_local(p->udptl, 1);
ast_debug(1, "T38 is in state %d on channel %s\n", p->t38.state, p->owner ? p->owner->name : "<none>");
add_sdp(&req, p, FALSE, FALSE, TRUE);
} else if (p->rtp)
} else if (p->rtp) {
try_suggested_sip_codec(p);
add_sdp(&req, p, FALSE, TRUE, FALSE);
}
} else {
if (!p->notify_headers) {
add_header_contentLength(&req, 0);

@ -925,7 +925,9 @@ ${SIPDOMAIN} * SIP destination domain of an inbound call (if appropriate
${SIPFROMDOMAIN} Set SIP domain on outbound calls
${SIPUSERAGENT} * SIP user agent (deprecated)
${SIPURI} * SIP uri
${SIP_CODEC} Set the SIP codec for a call
${SIP_CODEC} Set the SIP codec for an inbound call
${SIP_CODEC_INBOUND} Set the SIP codec for an inbound call
${SIP_CODEC_OUTBOUND} Set the SIP codec for an outbound call
${SIP_URI_OPTIONS} * additional options to add to the URI for an outgoing call
${RTPAUDIOQOS} RTCP QoS report for the audio of this call
${RTPVIDEOQOS} RTCP QoS report for the video of this call

Loading…
Cancel
Save