aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-03 20:48:48 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-03 20:48:48 +0000
commita73782aff532a1102239e23a66c86296dd52fe70 (patch)
treeb60a24dd99f31bac080dce420ea3d9242799ab0e /channels
parente44258424c1bdaac0754970d268a9bd1c77b2f99 (diff)
Rename 'canreinvite' option to 'directmedia', with backwards compatibility.
It is clear from multiple mailing list, forum, wiki and other sorts of posts that users don't really understand the effects that the 'canreinvite' config option actually has, and that in some cases they think that setting it to 'no' will actually cause various other features (T.38, MOH, etc.) to not work properly, when in fact this is not the case. This patch changes the proper name of the option to what it should have been from the beginning ('directmedia'), but preserves backwards compatibility for existing configurations. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210190 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_mgcp.c18
-rw-r--r--channels/chan_sip.c33
-rw-r--r--channels/chan_skinny.c12
3 files changed, 32 insertions, 31 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index d682c76bb..8adaf12a3 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -80,7 +80,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#define MGCPDUMPER
#define DEFAULT_EXPIRY 120
#define MAX_EXPIRY 3600
-#define CANREINVITE 1
+#define DIRECTMEDIA 1
#ifndef INADDR_NONE
#define INADDR_NONE (in_addr_t)(-1)
@@ -177,7 +177,7 @@ static int cancallforward = 0;
static int singlepath = 0;
-static int canreinvite = CANREINVITE;
+static int directmedia = DIRECTMEDIA;
static char accountcode[AST_MAX_ACCOUNT_CODE] = "";
@@ -330,7 +330,7 @@ struct mgcp_endpoint {
int threewaycalling;
int singlepath;
int cancallforward;
- int canreinvite;
+ int directmedia;
int callreturn;
int dnd; /* How does this affect callwait? Do we just deny a mgcp_request if we're dnd? */
int hascallerid;
@@ -3552,7 +3552,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
int i=0, y=0;
int gw_reload = 0;
int ep_reload = 0;
- canreinvite = CANREINVITE;
+ directmedia = DIRECTMEDIA;
/* locate existing gateway */
gw = gateways;
@@ -3662,8 +3662,8 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
cancallforward = ast_true(v->value);
} else if (!strcasecmp(v->name, "singlepath")) {
singlepath = ast_true(v->value);
- } else if (!strcasecmp(v->name, "canreinvite")) {
- canreinvite = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "directmedia") || !strcasecmp(v->name, "canreinvite")) {
+ directmedia = ast_true(v->value);
} else if (!strcasecmp(v->name, "mailbox")) {
ast_copy_string(mailbox, v->value, sizeof(mailbox));
} else if (!strcasecmp(v->name, "hasvoicemail")) {
@@ -3748,7 +3748,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
e->callreturn = callreturn;
e->cancallforward = cancallforward;
e->singlepath = singlepath;
- e->canreinvite = canreinvite;
+ e->directmedia = directmedia;
e->callwaiting = callwaiting;
e->hascallwaiting = callwaiting;
e->slowsequence = slowsequence;
@@ -3851,7 +3851,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
e->pickupgroup=cur_pickupgroup;
e->callreturn = callreturn;
e->cancallforward = cancallforward;
- e->canreinvite = canreinvite;
+ e->directmedia = directmedia;
e->singlepath = singlepath;
e->callwaiting = callwaiting;
e->hascallwaiting = callwaiting;
@@ -3944,7 +3944,7 @@ static enum ast_rtp_glue_result mgcp_get_rtp_peer(struct ast_channel *chan, stru
*instance = sub->rtp ? ao2_ref(sub->rtp, +1), sub->rtp : NULL;
- if (sub->parent->canreinvite)
+ if (sub->parent->directmedia)
return AST_RTP_GLUE_RESULT_REMOTE;
else
return AST_RTP_GLUE_RESULT_LOCAL;
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 5e777b4c3..78b42c821 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1457,8 +1457,8 @@ struct sip_auth {
/* re-INVITE related settings */
#define SIP_REINVITE (7 << 20) /*!< DP: four settings, uses three bits */
#define SIP_REINVITE_NONE (0 << 20) /*!< DP: no reinvite allowed */
-#define SIP_CAN_REINVITE (1 << 20) /*!< DP: allow peers to be reinvited to send media directly p2p */
-#define SIP_CAN_REINVITE_NAT (2 << 20) /*!< DP: allow media reinvite when new peer is behind NAT */
+#define SIP_DIRECT_MEDIA (1 << 20) /*!< DP: allow peers to be reinvited to send media directly p2p */
+#define SIP_DIRECT_MEDIA_NAT (2 << 20) /*!< DP: allow media reinvite when new peer is behind NAT */
#define SIP_REINVITE_UPDATE (4 << 20) /*!< DP: use UPDATE (RFC3311) when reinviting this peer */
/* "insecure" settings - see insecure2str() */
@@ -15369,7 +15369,7 @@ static char *_sip_show_peer(int type, int fd, struct mansession *s, const struct
ast_cli(fd, " Force rport : %s\n", cli_yesno(ast_test_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT)));
ast_cli(fd, " ACL : %s\n", cli_yesno(peer->ha != NULL));
ast_cli(fd, " T38 pt UDPTL : %s\n", cli_yesno(ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT)));
- ast_cli(fd, " CanReinvite : %s\n", cli_yesno(ast_test_flag(&peer->flags[0], SIP_CAN_REINVITE)));
+ ast_cli(fd, " DirectMedia : %s\n", cli_yesno(ast_test_flag(&peer->flags[0], SIP_DIRECT_MEDIA)));
ast_cli(fd, " PromiscRedir : %s\n", cli_yesno(ast_test_flag(&peer->flags[0], SIP_PROMISCREDIR)));
ast_cli(fd, " User=Phone : %s\n", cli_yesno(ast_test_flag(&peer->flags[0], SIP_USEREQPHONE)));
ast_cli(fd, " Video Support: %s\n", cli_yesno(ast_test_flag(&peer->flags[1], SIP_PAGE2_VIDEOSUPPORT)));
@@ -15473,7 +15473,8 @@ static char *_sip_show_peer(int type, int fd, struct mansession *s, const struct
astman_append(s, "SIP-AuthInsecure: %s\r\n", insecure2str(ast_test_flag(&peer->flags[0], SIP_INSECURE)));
astman_append(s, "SIP-Forcerport: %s\r\n", (ast_test_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT)?"Y":"N"));
astman_append(s, "ACL: %s\r\n", (peer->ha?"Y":"N"));
- astman_append(s, "SIP-CanReinvite: %s\r\n", (ast_test_flag(&peer->flags[0], SIP_CAN_REINVITE)?"Y":"N"));
+ astman_append(s, "SIP-CanReinvite: %s\r\n", (ast_test_flag(&peer->flags[0], SIP_DIRECT_MEDIA)?"Y":"N"));
+ astman_append(s, "SIP-DirectMedia: %s\r\n", (ast_test_flag(&peer->flags[0], SIP_DIRECT_MEDIA)?"Y":"N"));
astman_append(s, "SIP-PromiscRedir: %s\r\n", (ast_test_flag(&peer->flags[0], SIP_PROMISCREDIR)?"Y":"N"));
astman_append(s, "SIP-UserPhone: %s\r\n", (ast_test_flag(&peer->flags[0], SIP_USEREQPHONE)?"Y":"N"));
astman_append(s, "SIP-VideoSupport: %s\r\n", (ast_test_flag(&peer->flags[1], SIP_PAGE2_VIDEOSUPPORT)?"Y":"N"));
@@ -23488,11 +23489,11 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask
ast_set_flag(&mask[1], SIP_PAGE2_SYMMETRICRTP);
ast_set_flag(&flags[1], SIP_PAGE2_SYMMETRICRTP);
}
- } else if (!strcasecmp(v->name, "canreinvite")) {
+ } else if (!strcasecmp(v->name, "directmedia") || !strcasecmp(v->name, "canreinvite")) {
ast_set_flag(&mask[0], SIP_REINVITE);
ast_clear_flag(&flags[0], SIP_REINVITE);
if (ast_true(v->value)) {
- ast_set_flag(&flags[0], SIP_CAN_REINVITE | SIP_CAN_REINVITE_NAT);
+ ast_set_flag(&flags[0], SIP_DIRECT_MEDIA | SIP_DIRECT_MEDIA_NAT);
} else if (!ast_false(v->value)) {
char buf[64];
char *word, *next = buf;
@@ -23500,12 +23501,12 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask
ast_copy_string(buf, v->value, sizeof(buf));
while ((word = strsep(&next, ","))) {
if (!strcasecmp(word, "update")) {
- ast_set_flag(&flags[0], SIP_REINVITE_UPDATE | SIP_CAN_REINVITE);
+ ast_set_flag(&flags[0], SIP_REINVITE_UPDATE | SIP_DIRECT_MEDIA);
} else if (!strcasecmp(word, "nonat")) {
- ast_set_flag(&flags[0], SIP_CAN_REINVITE);
- ast_clear_flag(&flags[0], SIP_CAN_REINVITE_NAT);
+ ast_set_flag(&flags[0], SIP_DIRECT_MEDIA);
+ ast_clear_flag(&flags[0], SIP_DIRECT_MEDIA_NAT);
} else {
- ast_log(LOG_WARNING, "Unknown canreinvite mode '%s' on line %d\n", v->value, v->lineno);
+ ast_log(LOG_WARNING, "Unknown directmedia mode '%s' on line %d\n", v->value, v->lineno);
}
}
}
@@ -24594,7 +24595,7 @@ static int reload_config(enum channelreloadreason reason)
ast_copy_string(default_mohsuggest, DEFAULT_MOHSUGGEST, sizeof(default_mohsuggest));
ast_copy_string(default_vmexten, DEFAULT_VMEXTEN, sizeof(default_vmexten));
ast_set_flag(&global_flags[0], SIP_DTMF_RFC2833); /*!< Default DTMF setting: RFC2833 */
- ast_set_flag(&global_flags[0], SIP_CAN_REINVITE); /*!< Allow re-invites */
+ ast_set_flag(&global_flags[0], SIP_DIRECT_MEDIA); /*!< Allow re-invites */
ast_copy_string(default_engine, DEFAULT_ENGINE, sizeof(default_engine));
/* Debugging settings, always default to off */
@@ -25291,7 +25292,7 @@ static struct ast_udptl *sip_get_udptl_peer(struct ast_channel *chan)
return NULL;
sip_pvt_lock(p);
- if (p->udptl && ast_test_flag(&p->flags[0], SIP_CAN_REINVITE))
+ if (p->udptl && ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA))
udptl = p->udptl;
sip_pvt_unlock(p);
return udptl;
@@ -25342,7 +25343,7 @@ static enum ast_rtp_glue_result sip_get_rtp_peer(struct ast_channel *chan, struc
ao2_ref(p->rtp, +1);
*instance = p->rtp;
- if (ast_test_flag(&p->flags[0], SIP_CAN_REINVITE | SIP_CAN_REINVITE_NAT)) {
+ if (ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA | SIP_DIRECT_MEDIA_NAT)) {
res = AST_RTP_GLUE_RESULT_REMOTE;
} else if (ast_test_flag(&global_jbconf, AST_JB_FORCED)) {
res = AST_RTP_GLUE_RESULT_FORBID;
@@ -25371,7 +25372,7 @@ static enum ast_rtp_glue_result sip_get_vrtp_peer(struct ast_channel *chan, stru
ao2_ref(p->vrtp, +1);
*instance = p->vrtp;
- if (ast_test_flag(&p->flags[0], SIP_CAN_REINVITE)) {
+ if (ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA)) {
res = AST_RTP_GLUE_RESULT_REMOTE;
}
@@ -25398,7 +25399,7 @@ static enum ast_rtp_glue_result sip_get_trtp_peer(struct ast_channel *chan, stru
ao2_ref(p->trtp, +1);
*instance = p->trtp;
- if (ast_test_flag(&p->flags[0], SIP_CAN_REINVITE)) {
+ if (ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA)) {
res = AST_RTP_GLUE_RESULT_REMOTE;
}
@@ -25430,7 +25431,7 @@ static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp_instance *i
/* if this peer cannot handle reinvites of the media stream to devices
that are known to be behind a NAT, then stop the process now
*/
- if (nat_active && !ast_test_flag(&p->flags[0], SIP_CAN_REINVITE_NAT)) {
+ if (nat_active && !ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA_NAT)) {
sip_pvt_unlock(p);
return 0;
}
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index 6a82c74e5..edaf148d8 100644
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -1239,7 +1239,7 @@ struct skinny_subchannel {
int immediate; \
int hookstate; \
int nat; \
- int canreinvite; \
+ int directmedia; \
int prune;
struct skinny_line {
@@ -1265,7 +1265,7 @@ static struct skinny_line_options{
.hidecallerid = 0,
.amaflags = 0,
.instance = 0,
- .canreinvite = 0,
+ .directmedia = 0,
.nat = 0,
.confcapability = AST_FORMAT_ULAW | AST_FORMAT_ALAW,
.capability = 0,
@@ -2689,7 +2689,7 @@ static enum ast_rtp_glue_result skinny_get_rtp_peer(struct ast_channel *c, struc
l = sub->parent;
- if (!l->canreinvite || l->nat){
+ if (!l->directmedia || l->nat){
res = AST_RTP_GLUE_RESULT_LOCAL;
if (skinnydebug)
ast_verb(1, "skinny_get_rtp_peer() Using AST_RTP_GLUE_RESULT_LOCAL \n");
@@ -2749,7 +2749,7 @@ static int skinny_set_rtp_peer(struct ast_channel *c, struct ast_rtp_instance *r
req->data.startmedia.conferenceId = htolel(sub->callid);
req->data.startmedia.passThruPartyId = htolel(sub->callid);
- if (!(l->canreinvite) || (l->nat)){
+ if (!(l->directmedia) || (l->nat)){
ast_rtp_instance_get_local_address(rtp, &us);
req->data.startmedia.remoteIp = htolel(d->ourip.s_addr);
req->data.startmedia.remotePort = htolel(ntohs(us.sin_port));
@@ -6717,9 +6717,9 @@ static struct ast_channel *skinny_request(const char *type, int format, const st
CLINE_OPTS->callwaiting = ast_true(v->value);
continue;
}
- } else if (!strcasecmp(v->name, "canreinvite")) {
+ } else if (!strcasecmp(v->name, "directmedia") || !strcasecmp(v->name, "canreinvite")) {
if (type & (TYPE_DEF_LINE | TYPE_LINE)) {
- CLINE_OPTS->canreinvite = ast_true(v->value);
+ CLINE_OPTS->directmedia = ast_true(v->value);
continue;
}
} else if (!strcasecmp(v->name, "nat")) {