aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-15 16:20:35 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-15 16:20:35 +0000
commitf702800c32f6d15add119bd86b79b8293b7b2503 (patch)
tree7570589d50b3d214d5d43f8d7d786faceeb01642 /channels/chan_sip.c
parentc0b94033742cbb47079d2e15e8391b9431b42ba3 (diff)
Additional option for videosupport (always) that disables the optimization to
fail to setup video RTP if the two endpoints will not support it. This assists with call files and certain transfers to ensure that if two video phones are ever connected, they will always share a video feed. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@130951 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 580160731..35a208bf5 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1056,11 +1056,13 @@ struct sip_auth {
#define SIP_PAGE2_BUGGY_MWI (1 << 26) /*!< DP: Buggy CISCO MWI fix */
#define SIP_PAGE2_REGISTERTRYING (1 << 29) /*!< DP: Send 100 Trying on REGISTER attempts */
#define SIP_PAGE2_UDPTL_DESTINATION (1 << 30) /*!< DP: Use source IP of RTP as destination if NAT is enabled */
+#define SIP_PAGE2_VIDEOSUPPORT_ALWAYS (1 << 31) /*!< DP: Always set up video, even if endpoints don't support it */
#define SIP_PAGE2_FLAGS_TO_COPY \
(SIP_PAGE2_ALLOWSUBSCRIBE | SIP_PAGE2_ALLOWOVERLAP | SIP_PAGE2_VIDEOSUPPORT | \
SIP_PAGE2_T38SUPPORT | SIP_PAGE2_RFC2833_COMPENSATE | SIP_PAGE2_BUGGY_MWI | \
- SIP_PAGE2_TEXTSUPPORT | SIP_PAGE2_UDPTL_DESTINATION)
+ SIP_PAGE2_TEXTSUPPORT | SIP_PAGE2_UDPTL_DESTINATION | \
+ SIP_PAGE2_VIDEOSUPPORT_ALWAYS)
/*@}*/
@@ -4147,7 +4149,10 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
ast_copy_flags(&dialog->flags[0], &peer->flags[0], SIP_FLAGS_TO_COPY);
ast_copy_flags(&dialog->flags[1], &peer->flags[1], SIP_PAGE2_FLAGS_TO_COPY);
dialog->capability = peer->capability;
- if ((!ast_test_flag(&dialog->flags[1], SIP_PAGE2_VIDEOSUPPORT) || !(dialog->capability & AST_FORMAT_VIDEO_MASK)) && dialog->vrtp) {
+ if (!ast_test_flag(&dialog->flags[1], SIP_PAGE2_VIDEOSUPPORT_ALWAYS) &&
+ (!ast_test_flag(&dialog->flags[1], SIP_PAGE2_VIDEOSUPPORT) ||
+ !(dialog->capability & AST_FORMAT_VIDEO_MASK)) &&
+ dialog->vrtp) {
ast_rtp_destroy(dialog->vrtp);
dialog->vrtp = NULL;
}
@@ -5509,7 +5514,9 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, const char *tit
We also check for vrtp. If it's not there, we are not allowed do any video anyway.
*/
if (i->vrtp) {
- if (i->prefcodec)
+ if (ast_test_flag(&i->flags[1], SIP_PAGE2_VIDEOSUPPORT))
+ needvideo = AST_FORMAT_VIDEO_MASK;
+ else if (i->prefcodec)
needvideo = i->prefcodec & AST_FORMAT_VIDEO_MASK; /* Outbound call */
else
needvideo = i->jointcapability & AST_FORMAT_VIDEO_MASK; /* Inbound call */
@@ -11793,7 +11800,10 @@ static enum check_auth_result check_peer_ok(struct sip_pvt *p, char *of,
if (p->peercapability)
p->jointcapability &= p->peercapability;
p->maxcallbitrate = peer->maxcallbitrate;
- if ((!ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT) || !(p->capability & AST_FORMAT_VIDEO_MASK)) && p->vrtp) {
+ if (!ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT_ALWAYS) &&
+ (!ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT) ||
+ !(p->capability & AST_FORMAT_VIDEO_MASK)) &&
+ p->vrtp) {
ast_rtp_destroy(p->vrtp);
p->vrtp = NULL;
}
@@ -20008,8 +20018,13 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask
ast_set_flag(&mask[0], SIP_PROMISCREDIR);
ast_set2_flag(&flags[0], ast_true(v->value), SIP_PROMISCREDIR);
} else if (!strcasecmp(v->name, "videosupport")) {
- ast_set_flag(&mask[1], SIP_PAGE2_VIDEOSUPPORT);
- ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_VIDEOSUPPORT);
+ if (!strcasecmp(v->value, "always")) {
+ ast_set_flag(&mask[1], SIP_PAGE2_VIDEOSUPPORT_ALWAYS);
+ ast_set_flag(&flags[1], SIP_PAGE2_VIDEOSUPPORT_ALWAYS);
+ } else {
+ ast_set_flag(&mask[1], SIP_PAGE2_VIDEOSUPPORT);
+ ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_VIDEOSUPPORT);
+ }
} else if (!strcasecmp(v->name, "textsupport")) {
ast_set_flag(&mask[1], SIP_PAGE2_TEXTSUPPORT);
ast_set2_flag(&flags[1], ast_true(v->value), SIP_PAGE2_TEXTSUPPORT);
@@ -20936,7 +20951,7 @@ static int reload_config(enum channelreloadreason reason)
/* Copy the default jb config over global_jbconf */
memcpy(&global_jbconf, &default_jbconf, sizeof(struct ast_jb_conf));
- ast_clear_flag(&global_flags[1], SIP_PAGE2_VIDEOSUPPORT);
+ ast_clear_flag(&global_flags[1], SIP_PAGE2_VIDEOSUPPORT | SIP_PAGE2_VIDEOSUPPORT_ALWAYS);
ast_clear_flag(&global_flags[1], SIP_PAGE2_TEXTSUPPORT);