From: Russell Bryant Date: Fri, 24 Jun 2005 22:20:22 +0000 (+0000) Subject: after a *70, re-enable call waiting on hangup (bug #3971) X-Git-Tag: 1.0.11.1~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e3d58e030c81256e95a62ee9a9a2992e1ec3de6;p=thirdparty%2Fasterisk.git after a *70, re-enable call waiting on hangup (bug #3971) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@6006 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/CHANGES b/CHANGES index 3d4cff016e..16aaa3e919 100755 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,10 @@ is available through the Asterisk-CVS mailing list hosted at http://lists.digium.com. + -- chan_mgcp + -- *70 is used to disable call waiting. Call waiting will now be re-enabled + on hangup. + Asterisk 1.0.8 -- chan_zap diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index e7ebdf6caf..44b62dfc2c 100755 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -365,6 +365,7 @@ struct mgcp_endpoint { unsigned int callgroup; unsigned int pickupgroup; int callwaiting; + int hascallwaiting; int transfer; int threewaycalling; int singlepath; @@ -937,6 +938,12 @@ static int mgcp_hangup(struct ast_channel *ast) if ((p->hookstate == MGCP_ONHOOK) && (!sub->next->rtp)) { p->hidecallerid = 0; + if (p->hascallwaiting && !p->callwaiting) { + if (option_verbose > 2) { + ast_verbose(VERBOSE_PREFIX_3 "Enabling call waiting on %s\n", ast->name); + } + p->callwaiting = -1; + } if (has_voicemail(p)) { if (mgcpdebug) { ast_verbose(VERBOSE_PREFIX_3 "MGCP mgcp_hangup(%s) on %s@%s set vmwi(+)\n", ast->name, p->name, p->parent->name); @@ -2519,7 +2526,7 @@ static void *mgcp_ss(void *data) /*zt_wait_event(p->subs[index].zfd);*/ ast_hangup(chan); return NULL; - } else if (p->callwaiting && !strcmp(exten, "*70")) { + } else if (p->hascallwaiting && p->callwaiting && !strcmp(exten, "*70")) { if (option_verbose > 2) { ast_verbose(VERBOSE_PREFIX_3 "Disabling call waiting on %s\n", chan->name); } @@ -3059,6 +3066,13 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req, } } if ((p->hookstate == MGCP_ONHOOK) && (!sub->rtp) && (!sub->next->rtp)) { + p->hidecallerid = 0; + if (p->hascallwaiting && !p->callwaiting) { + if (option_verbose > 2) { + ast_verbose(VERBOSE_PREFIX_3 "Enabling call waiting on MGCP/%s@%s-%d\n", p->name, p->parent->name, sub->id); + } + p->callwaiting = -1; + } if (has_voicemail(p)) { if (option_verbose > 2) { ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s) set vmwi(+)\n", p->name, p->parent->name); @@ -3583,6 +3597,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v) e->singlepath = singlepath; e->canreinvite = canreinvite; e->callwaiting = callwaiting; + e->hascallwaiting = callwaiting; e->slowsequence = slowsequence; e->transfer = transfer; e->threewaycalling = threewaycalling; @@ -3686,6 +3701,7 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v) e->canreinvite = canreinvite; e->singlepath = singlepath; e->callwaiting = callwaiting; + e->hascallwaiting = callwaiting; e->slowsequence = slowsequence; e->transfer = transfer; e->threewaycalling = threewaycalling;