aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_mgcp.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-08-19 15:13:54 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-08-19 15:13:54 +0000
commit4afa88f8510cc7041901aa7e8ded877d02a0703f (patch)
treee37e27b10c5cb8e41c3531e92208681523883d4f /channels/chan_mgcp.c
parentbd1e681a5540a607f54db4660afb832e43b04894 (diff)
Add canreinvite option and minor tweak to bridging code
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1374 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_mgcp.c')
-rwxr-xr-xchannels/chan_mgcp.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 19045e85b..1e40d5a73 100755
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -58,6 +58,7 @@
#define MGCPDUMPER
#define DEFAULT_EXPIREY 120
#define MAX_EXPIREY 3600
+#define CANREINVITE 1
static char *desc = "Media Gateway Control Protocol (MGCP)";
static char *type = "MGCP";
@@ -128,6 +129,8 @@ static int transfer = 0;
static int cancallforward = 0;
+static int canreinvite = CANREINVITE;
+
/*static int busycount = 3;*/
/*static int callprogress = 0;*/
@@ -266,6 +269,7 @@ struct mgcp_endpoint {
int transfer;
int threewaycalling;
int cancallforward;
+ int canreinvite;
int callreturn;
int dnd; /* How does this affect callwait? Do we just deny a mgcp_request if we're dnd? */
int hascallerid;
@@ -2191,6 +2195,9 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req,
/* Thanks to point on IRC for pointing this out */
return -1;
}
+ /* do not let * confrnce two down channels */
+ if( sub->owner && sub->owner->_state == AST_STATE_DOWN && !sub->next->owner) return -1;
+
if (p->callwaiting || p->transfer || p->threewaycalling) {
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3 "Swapping %d for %d on %s@%s\n", p->sub->id, p->sub->next->id, p->name, p->parent->name);
@@ -2622,7 +2629,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
struct mgcp_subchannel *sub;
/*char txident[80];*/
int i=0, y=0;
-
+ canreinvite = CANREINVITE;
gw = malloc(sizeof(struct mgcp_gateway));
if (gw) {
memset(gw, 0, sizeof(struct mgcp_gateway));
@@ -2692,6 +2699,8 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v)
immediate = ast_true(v->value);
} else if (!strcasecmp(v->name, "cancallforward")) {
cancallforward = ast_true(v->value);
+ } else if (!strcasecmp(v->name, "canreinvite")) {
+ canreinvite = ast_true(v->value);
} else if (!strcasecmp(v->name, "mailbox")) {
strncpy(mailbox, v->value, sizeof(mailbox) -1);
} else if (!strcasecmp(v->name, "adsi")) {
@@ -2737,6 +2746,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->callwaiting = callwaiting;
e->transfer = transfer;
e->threewaycalling = threewaycalling;
@@ -2802,7 +2812,7 @@ static struct ast_rtp *mgcp_get_rtp_peer(struct ast_channel *chan)
{
struct mgcp_subchannel *sub;
sub = chan->pvt->pvt;
- if (sub && sub->rtp)
+ if (sub && sub->rtp && sub->parent->canreinvite)
return sub->rtp;
return NULL;
}