[asterisk-dev] Why does the outbound SIP channel use jointcapability instead of capability?

Alex Hermann alex at speakup.nl
Tue Aug 18 11:04:39 CDT 2009


Hi,


I'm trying to understand the codec selection for chan_sip in Asterisk 
and found a part which I don't understand. This is for Asterisk 1.6.1.4

in the function add_sdp() there is this section:


	if (add_audio) {
		capability = p->jointcapability;

		/* XXX note, Video and Text are negated - 'true' means 'no' */
		ast_debug(1, "** Our capability: %s Video flag: %s Text flag: %s\n", ast_getformatname_multiple(codecbuf, sizeof(codecbuf), capability), 
			  p->novideo ? "True" : "False", p->notext ? "True" : "False");
		ast_debug(1, "** Our prefcodec: %s \n", ast_getformatname_multiple(codecbuf, sizeof(codecbuf), p->prefcodec));


Why is the p->jointcapability used? The resulting outbound INVITE has 
only a very limited set of codecs as can be seen in the last line of the log:


[Aug 18 17:33:19] DEBUG[14968]: chan_sip.c:5778 sip_new: *** Our native formats are 0x8 (alaw)
[Aug 18 17:33:19] DEBUG[14968]: chan_sip.c:5779 sip_new: *** Joint capabilities are 0x8 (alaw)
[Aug 18 17:33:19] DEBUG[14968]: chan_sip.c:5780 sip_new: *** Our capabilities are 0xb1e (gsm|ulaw|alaw|g726|g729|speex|g726aal2)
[Aug 18 17:33:19] DEBUG[14968]: chan_sip.c:5781 sip_new: *** AST_CODEC_CHOOSE formats are 0x8 (alaw)
[Aug 18 17:33:19] DEBUG[14968]: chan_sip.c:5811 sip_new: This channel will not be able to handle video.
[Aug 18 17:33:19] DEBUG[14968]: channel.c:3994 ast_channel_inherit_variables: Not copying variable DIALEDTIME.
[Aug 18 17:33:19] DEBUG[14968]: channel.c:3994 ast_channel_inherit_variables: Not copying variable ANSWEREDTIME.
[Aug 18 17:33:19] DEBUG[14968]: channel.c:3994 ast_channel_inherit_variables: Not copying variable DIALEDPEERNAME.
[Aug 18 17:33:19] DEBUG[14968]: channel.c:3994 ast_channel_inherit_variables: Not copying variable DIALEDPEERNUMBER.
[Aug 18 17:33:19] DEBUG[14968]: channel.c:3994 ast_channel_inherit_variables: Not copying variable DIALSTATUS.
[Aug 18 17:33:19] DEBUG[14968]: channel.c:3994 ast_channel_inherit_variables: Not copying variable SIPCALLID.
[Aug 18 17:33:19] DEBUG[14968]: channel.c:3994 ast_channel_inherit_variables: Not copying variable SIPDOMAIN.
[Aug 18 17:33:19] DEBUG[14968]: channel.c:3994 ast_channel_inherit_variables: Not copying variable SIPRURI.
[Aug 18 17:33:19] DEBUG[14968]: channel.c:3994 ast_channel_inherit_variables: Not copying variable SIPURI.
[Aug 18 17:33:19] DEBUG[14968]: chan_sip.c:4619 sip_call: Outgoing Call for uac
[Aug 18 17:33:19] DEBUG[14968]: chan_sip.c:4814 update_call_counter: Updating call counter for outgoing call
[Aug 18 17:33:19] DEBUG[14968]: chan_sip.c:4639 sip_call: Our T38 capability (0), joint T38 capability (0)
[Aug 18 17:33:19] DEBUG[14968]: chan_sip.c:8765 add_sdp: ** Our capability: 0xc (ulaw|alaw) Video flag: False Text flag: False


Shouldn't the outbound leg have the list of codecs from:
[Aug 18 17:33:19] DEBUG[14968]: chan_sip.c:5780 sip_new: *** Our capabilities are 0xb1e (gsm|ulaw|alaw|g726|g729|speex|g726aal2)

If p->jointcapability is replaced with p>capablility, the whole set of 
codecs is added to the INVITE, which seems more correct to me.

-- 
Met vriendelijke groet,


Alex Hermann
SpeakUp BV
T: 088-SPEAKUP (088-7732587)
F: 088-7732588



More information about the asterisk-dev mailing list