Index: chan_mgcp.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v retrieving revision 1.17 diff -u -r1.17 chan_mgcp.c --- chan_mgcp.c 13 Aug 2003 15:25:16 -0000 1.17 +++ chan_mgcp.c 19 Aug 2003 08:25:00 -0000 @@ -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 cancallforward = 0; +static int canreinvite = CANREINVITE; + /*static int busycount = 3;*/ /*static int callprogress = 0;*/ @@ -266,6 +269,7 @@ 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 @@ /* 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 @@ 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 @@ 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 @@ 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 @@ { struct mgcp_subchannel *sub; sub = chan->pvt->pvt; - if (sub && sub->rtp) + if (sub && sub->rtp && sub->parent->canreinvite) return sub->rtp; return NULL; }