[asterisk-commits] branch 1.2 - r7586
/branches/1.2/channels/chan_sip.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Dec 21 16:23:41 CST 2005
Author: twisted
Date: Wed Dec 21 16:23:39 2005
New Revision: 7586
URL: http://svn.digium.com/view/asterisk?rev=7586&view=rev
Log:
Actually put in the per-peer settings for sip video, as they didn't make it in at astricon somehow, and I've been too busy up until now to redo it.
Modified:
branches/1.2/channels/chan_sip.c
Modified: branches/1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_sip.c?rev=7586&r1=7585&r2=7586&view=diff
==============================================================================
--- branches/1.2/channels/chan_sip.c (original)
+++ branches/1.2/channels/chan_sip.c Wed Dec 21 16:23:39 2005
@@ -416,8 +416,6 @@
static struct sockaddr_in debugaddr;
static int tos = 0;
-
-static int videosupport = 0;
static int compactheaders = 0; /*!< send compact sip headers */
@@ -560,11 +558,13 @@
#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_INSECURE_PORT | SIP_INSECURE_INVITE | SIP_VIDEOSUPPORT)
/* a new page of flags for peer */
#define SIP_PAGE2_RTCACHEFRIENDS (1 << 0)
@@ -3047,10 +3047,10 @@
if (sip_methods[intended_method].need_rtp) {
p->rtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
- if (videosupport)
+ if (ast_test_flag(p, SIP_VIDEOSUPPORT))
p->vrtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
- if (!p->rtp || (videosupport && !p->vrtp)) {
- ast_log(LOG_WARNING, "Unable to create RTP audio %s session: %s\n", videosupport ? "and video" : "", strerror(errno));
+ 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));
ast_mutex_destroy(&p->lock);
if (p->chanvars) {
ast_variables_destroy(p->chanvars);
@@ -4417,7 +4417,7 @@
}
/* Now send any other common codecs, and non-codec formats: */
- for (x = 1; x <= ((videosupport && p->vrtp) ? AST_FORMAT_MAX_VIDEO : AST_FORMAT_MAX_AUDIO); x <<= 1) {
+ for (x = 1; x <= ((ast_test_flag(p, SIP_VIDEOSUPPORT) && p->vrtp) ? AST_FORMAT_MAX_VIDEO : AST_FORMAT_MAX_AUDIO); x <<= 1) {
if (!(capability & x))
continue;
@@ -7526,6 +7526,7 @@
"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,6 +7535,7 @@
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);
}
@@ -7914,6 +7916,7 @@
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"));
@@ -7990,6 +7993,7 @@
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)));
@@ -8136,7 +8140,7 @@
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", videosupport ? "Yes" : "No");
+ ast_cli(fd, " Videosupport: %s\n", ast_test_flag(&global_flags, SIP_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");
@@ -12095,6 +12099,8 @@
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")) {
@@ -12300,7 +12306,6 @@
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;
@@ -12384,7 +12389,7 @@
global_rtpkeepalive = 0;
}
} else if (!strcasecmp(v->name, "videosupport")) {
- videosupport = ast_true(v->value);
+ ast_set2_flag((&global_flags), ast_true(v->value), SIP_VIDEOSUPPORT);
} else if (!strcasecmp(v->name, "compactheaders")) {
compactheaders = ast_true(v->value);
} else if (!strcasecmp(v->name, "notifymimetype")) {
More information about the asterisk-commits
mailing list