aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_mgcp.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-11 05:48:58 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-11 05:48:58 +0000
commit11ff484c17144e657fba368d593d1040f165c675 (patch)
treee53b9b08539b43d03bf40e028893e459d7610e6c /channels/chan_mgcp.c
parenteba9824400e6d6320422b52dace977d7fd009c69 (diff)
Fix MGCP call waiting (bug #3971, with mods)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5450 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_mgcp.c')
-rwxr-xr-xchannels/chan_mgcp.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 07924cd7c..82ed6edf5 100755
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -375,6 +375,7 @@ struct mgcp_endpoint {
ast_group_t callgroup;
ast_group_t pickupgroup;
int callwaiting;
+ int hascallwaiting;
int transfer;
int threewaycalling;
int singlepath;
@@ -1048,6 +1049,11 @@ 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",
@@ -2646,7 +2652,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);
}
@@ -3192,6 +3198,12 @@ 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);
@@ -3726,6 +3738,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;
@@ -3830,6 +3843,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;