diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-22 20:36:47 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-22 20:36:47 +0000 |
commit | abe3c046b5efc3b2d6d6ae48e3b91e6ad9bc73c3 (patch) | |
tree | 2dbcfb6b43f90c4d50f7fd2b4ebad3ce42c761cf | |
parent | 28db3023010aa815a1190c3f106bd37ecf0a6324 (diff) |
revert changes to videosupport to allow per-peer setting, since it isn't quite
complete and there is not an obvious fix at this point
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@7599 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 25 | ||||
-rw-r--r-- | configs/sip.conf.sample | 1 |
2 files changed, 10 insertions, 16 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 221f8f4a9..f1d549b57 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -417,6 +417,8 @@ static struct sockaddr_in debugaddr; static int tos = 0; +static int videosupport = 0; + static int compactheaders = 0; /*!< send compact sip headers */ static int recordhistory = 0; /*!< Record SIP history. Off by default */ @@ -558,13 +560,11 @@ struct sip_auth { #define SIP_CALL_LIMIT (1 << 29) /* Remote Party-ID Support */ #define SIP_SENDRPID (1 << 30) -/* SIP Video Options */ -#define SIP_VIDEOSUPPORT (1 << 31) #define SIP_FLAGS_TO_COPY \ (SIP_PROMISCREDIR | SIP_TRUSTRPID | SIP_SENDRPID | SIP_DTMF | SIP_REINVITE | \ SIP_PROG_INBAND | SIP_OSPAUTH | SIP_USECLIENTCODE | SIP_NAT | \ - SIP_INSECURE_PORT | SIP_INSECURE_INVITE | SIP_VIDEOSUPPORT) + SIP_INSECURE_PORT | SIP_INSECURE_INVITE) /* a new page of flags for peer */ #define SIP_PAGE2_RTCACHEFRIENDS (1 << 0) @@ -3046,10 +3046,10 @@ static struct sip_pvt *sip_alloc(char *callid, struct sockaddr_in *sin, int useg if (sip_methods[intended_method].need_rtp) { p->rtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr); - if (ast_test_flag(p, SIP_VIDEOSUPPORT)) + if (videosupport) p->vrtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr); - if (!p->rtp || (ast_test_flag(p, SIP_VIDEOSUPPORT) && !p->vrtp)) { - ast_log(LOG_WARNING, "Unable to create RTP audio %s session: %s\n", ast_test_flag(p, SIP_VIDEOSUPPORT) ? "and video" : "", strerror(errno)); + if (!p->rtp || (videosupport && !p->vrtp)) { + ast_log(LOG_WARNING, "Unable to create RTP audio %s session: %s\n", videosupport ? "and video" : "", strerror(errno)); ast_mutex_destroy(&p->lock); if (p->chanvars) { ast_variables_destroy(p->chanvars); @@ -4416,7 +4416,7 @@ static int add_sdp(struct sip_request *resp, struct sip_pvt *p) } /* Now send any other common codecs, and non-codec formats: */ - for (x = 1; x <= ((ast_test_flag(p, SIP_VIDEOSUPPORT) && p->vrtp) ? AST_FORMAT_MAX_VIDEO : AST_FORMAT_MAX_AUDIO); x <<= 1) { + for (x = 1; x <= ((videosupport && p->vrtp) ? AST_FORMAT_MAX_VIDEO : AST_FORMAT_MAX_AUDIO); x <<= 1) { if (!(capability & x)) continue; @@ -7525,7 +7525,6 @@ static int _sip_show_peers(int fd, int *total, struct mansession *s, struct mess "IPport: %d\r\n" "Dynamic: %s\r\n" "Natsupport: %s\r\n" - "Video Support: %s\r\n" "ACL: %s\r\n" "Status: %s\r\n\r\n", idtext, @@ -7534,7 +7533,6 @@ static int _sip_show_peers(int fd, int *total, struct mansession *s, struct mess ntohs(iterator->addr.sin_port), ast_test_flag(iterator, SIP_DYNAMIC) ? "yes" : "no", /* Dynamic or not? */ (ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? "yes" : "no", /* NAT=yes? */ - ast_test_flag(iterator, SIP_VIDEOSUPPORT) ? "yes" : "no", /* VIDEOSUPPORT=yes? */ iterator->ha ? "yes" : "no", /* permit/deny */ status); } @@ -7915,7 +7913,6 @@ static int _sip_show_peer(int type, int fd, struct mansession *s, struct message ast_cli(fd, " CanReinvite : %s\n", (ast_test_flag(peer, SIP_CAN_REINVITE)?"Yes":"No")); ast_cli(fd, " PromiscRedir : %s\n", (ast_test_flag(peer, SIP_PROMISCREDIR)?"Yes":"No")); ast_cli(fd, " User=Phone : %s\n", (ast_test_flag(peer, SIP_USEREQPHONE)?"Yes":"No")); - ast_cli(fd, " Video Support: %s\n", (ast_test_flag(peer, SIP_VIDEOSUPPORT)?"Yes":"No")); ast_cli(fd, " Trust RPID : %s\n", (ast_test_flag(peer, SIP_TRUSTRPID) ? "Yes" : "No")); ast_cli(fd, " Send RPID : %s\n", (ast_test_flag(peer, SIP_SENDRPID) ? "Yes" : "No")); @@ -7992,7 +7989,6 @@ static int _sip_show_peer(int type, int fd, struct mansession *s, struct message ast_cli(fd, "SIP-CanReinvite: %s\r\n", (ast_test_flag(peer, SIP_CAN_REINVITE)?"Y":"N")); ast_cli(fd, "SIP-PromiscRedir: %s\r\n", (ast_test_flag(peer, SIP_PROMISCREDIR)?"Y":"N")); ast_cli(fd, "SIP-UserPhone: %s\r\n", (ast_test_flag(peer, SIP_USEREQPHONE)?"Y":"N")); - ast_cli(fd, "SIP-VideoSupport: %s\r\n", (ast_test_flag(peer, SIP_VIDEOSUPPORT)?"Y":"N")); /* - is enumerated */ ast_cli(fd, "SIP-DTMFmode %s\r\n", dtmfmode2str(ast_test_flag(peer, SIP_DTMF))); @@ -8139,7 +8135,7 @@ static int sip_show_settings(int fd, int argc, char *argv[]) ast_cli(fd, "----------------\n"); ast_cli(fd, " SIP Port: %d\n", ntohs(bindaddr.sin_port)); ast_cli(fd, " Bindaddress: %s\n", ast_inet_ntoa(tmp, sizeof(tmp), bindaddr.sin_addr)); - ast_cli(fd, " Videosupport: %s\n", ast_test_flag(&global_flags, SIP_VIDEOSUPPORT) ? "Yes" : "No"); + ast_cli(fd, " Videosupport: %s\n", videosupport ? "Yes" : "No"); ast_cli(fd, " AutoCreatePeer: %s\n", autocreatepeer ? "Yes" : "No"); ast_cli(fd, " Allow unknown access: %s\n", global_allowguest ? "Yes" : "No"); ast_cli(fd, " Promsic. redir: %s\n", ast_test_flag(&global_flags, SIP_PROMISCREDIR) ? "Yes" : "No"); @@ -12098,8 +12094,6 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int ast_copy_string(peer->fromdomain, v->value, sizeof(peer->fromdomain)); else if (!strcasecmp(v->name, "usereqphone")) ast_set2_flag(peer, ast_true(v->value), SIP_USEREQPHONE); - else if (!strcasecmp(v->name, "videosupport")) - ast_set2_flag(peer, ast_true(v->value), SIP_VIDEOSUPPORT); else if (!strcasecmp(v->name, "fromuser")) ast_copy_string(peer->fromuser, v->value, sizeof(peer->fromuser)); else if (!strcasecmp(v->name, "host") || !strcasecmp(v->name, "outboundproxy")) { @@ -12305,6 +12299,7 @@ static int reload_config(void) memset(&outboundproxyip, 0, sizeof(outboundproxyip)); outboundproxyip.sin_port = htons(DEFAULT_SIP_PORT); outboundproxyip.sin_family = AF_INET; /* Type of address: IPv4 */ + videosupport = 0; compactheaders = 0; dumphistory = 0; recordhistory = 0; @@ -12388,7 +12383,7 @@ static int reload_config(void) global_rtpkeepalive = 0; } } else if (!strcasecmp(v->name, "videosupport")) { - ast_set2_flag((&global_flags), ast_true(v->value), SIP_VIDEOSUPPORT); + videosupport = ast_true(v->value); } else if (!strcasecmp(v->name, "compactheaders")) { compactheaders = ast_true(v->value); } else if (!strcasecmp(v->name, "notifymimetype")) { diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample index 4d279aa9c..3d9299c05 100644 --- a/configs/sip.conf.sample +++ b/configs/sip.conf.sample @@ -290,7 +290,6 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls ; call-limit call-limit ; restrictcid restrictcid ; subscribecontext subscribecontext -; videosupport videosupport ; mailbox ; username ; template |