mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
Add canreinvite option and minor tweak to bridging code
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -58,6 +58,7 @@
|
|||||||
#define MGCPDUMPER
|
#define MGCPDUMPER
|
||||||
#define DEFAULT_EXPIREY 120
|
#define DEFAULT_EXPIREY 120
|
||||||
#define MAX_EXPIREY 3600
|
#define MAX_EXPIREY 3600
|
||||||
|
#define CANREINVITE 1
|
||||||
|
|
||||||
static char *desc = "Media Gateway Control Protocol (MGCP)";
|
static char *desc = "Media Gateway Control Protocol (MGCP)";
|
||||||
static char *type = "MGCP";
|
static char *type = "MGCP";
|
||||||
@@ -128,6 +129,8 @@ static int transfer = 0;
|
|||||||
|
|
||||||
static int cancallforward = 0;
|
static int cancallforward = 0;
|
||||||
|
|
||||||
|
static int canreinvite = CANREINVITE;
|
||||||
|
|
||||||
/*static int busycount = 3;*/
|
/*static int busycount = 3;*/
|
||||||
|
|
||||||
/*static int callprogress = 0;*/
|
/*static int callprogress = 0;*/
|
||||||
@@ -266,6 +269,7 @@ struct mgcp_endpoint {
|
|||||||
int transfer;
|
int transfer;
|
||||||
int threewaycalling;
|
int threewaycalling;
|
||||||
int cancallforward;
|
int cancallforward;
|
||||||
|
int canreinvite;
|
||||||
int callreturn;
|
int callreturn;
|
||||||
int dnd; /* How does this affect callwait? Do we just deny a mgcp_request if we're dnd? */
|
int dnd; /* How does this affect callwait? Do we just deny a mgcp_request if we're dnd? */
|
||||||
int hascallerid;
|
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 */
|
/* Thanks to point on IRC for pointing this out */
|
||||||
return -1;
|
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 (p->callwaiting || p->transfer || p->threewaycalling) {
|
||||||
if (option_verbose > 2) {
|
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);
|
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;
|
struct mgcp_subchannel *sub;
|
||||||
/*char txident[80];*/
|
/*char txident[80];*/
|
||||||
int i=0, y=0;
|
int i=0, y=0;
|
||||||
|
canreinvite = CANREINVITE;
|
||||||
gw = malloc(sizeof(struct mgcp_gateway));
|
gw = malloc(sizeof(struct mgcp_gateway));
|
||||||
if (gw) {
|
if (gw) {
|
||||||
memset(gw, 0, sizeof(struct mgcp_gateway));
|
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);
|
immediate = ast_true(v->value);
|
||||||
} else if (!strcasecmp(v->name, "cancallforward")) {
|
} else if (!strcasecmp(v->name, "cancallforward")) {
|
||||||
cancallforward = ast_true(v->value);
|
cancallforward = ast_true(v->value);
|
||||||
|
} else if (!strcasecmp(v->name, "canreinvite")) {
|
||||||
|
canreinvite = ast_true(v->value);
|
||||||
} else if (!strcasecmp(v->name, "mailbox")) {
|
} else if (!strcasecmp(v->name, "mailbox")) {
|
||||||
strncpy(mailbox, v->value, sizeof(mailbox) -1);
|
strncpy(mailbox, v->value, sizeof(mailbox) -1);
|
||||||
} else if (!strcasecmp(v->name, "adsi")) {
|
} 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->pickupgroup=cur_pickupgroup;
|
||||||
e->callreturn = callreturn;
|
e->callreturn = callreturn;
|
||||||
e->cancallforward = cancallforward;
|
e->cancallforward = cancallforward;
|
||||||
|
e->canreinvite = canreinvite;
|
||||||
e->callwaiting = callwaiting;
|
e->callwaiting = callwaiting;
|
||||||
e->transfer = transfer;
|
e->transfer = transfer;
|
||||||
e->threewaycalling = threewaycalling;
|
e->threewaycalling = threewaycalling;
|
||||||
@@ -2802,7 +2812,7 @@ static struct ast_rtp *mgcp_get_rtp_peer(struct ast_channel *chan)
|
|||||||
{
|
{
|
||||||
struct mgcp_subchannel *sub;
|
struct mgcp_subchannel *sub;
|
||||||
sub = chan->pvt->pvt;
|
sub = chan->pvt->pvt;
|
||||||
if (sub && sub->rtp)
|
if (sub && sub->rtp && sub->parent->canreinvite)
|
||||||
return sub->rtp;
|
return sub->rtp;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user