diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-21 13:34:32 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-09-21 13:34:32 +0000 |
commit | ec43deabe7d576aca83ebbda30dfc0290e38ef3c (patch) | |
tree | 71f37810cd8c3749b52c77f63d0424a30681534b /channels/chan_sip.c | |
parent | f2453a8215d5f74cb7953deec7e7df3e87bc5014 (diff) |
Fix video under certain circumstances. It would have been possible for the formats on the channel to not contain the video format.
(closes issue #10782)
Reported by: cwhuang
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@83400 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 132b8be69..c365c00c7 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -3901,7 +3901,7 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit struct ast_variable *v = NULL; int fmt; int what; - int needvideo = 0; + int needvideo = 0, video = 0; { const char *my_name; /* pick a good name */ @@ -3930,15 +3930,19 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit /* Select our native format based on codec preference until we receive something from another device to the contrary. */ - if (i->jointcapability) /* The joint capabilities of us and peer */ + if (i->jointcapability) { /* The joint capabilities of us and peer */ what = i->jointcapability; - else if (i->capability) /* Our configured capability for this peer */ + video = i->jointcapability & AST_FORMAT_VIDEO_MASK; + } else if (i->capability) { /* Our configured capability for this peer */ what = i->capability; - else + video = i->capability & AST_FORMAT_VIDEO_MASK; + } else { what = global_capability; /* Global codec support */ + video = global_capability & AST_FORMAT_VIDEO_MASK; + } /* Set the native formats for audio and merge in video */ - tmp->nativeformats = ast_codec_choose(&i->prefs, what, 1) | (i->jointcapability & AST_FORMAT_VIDEO_MASK); + tmp->nativeformats = ast_codec_choose(&i->prefs, what, 1) | video; if (option_debug > 2) { char buf[BUFSIZ]; ast_log(LOG_DEBUG, "*** Our native formats are %s \n", ast_getformatname_multiple(buf, BUFSIZ, tmp->nativeformats)); |