[Asterisk-cvs] asterisk/channels chan_mgcp.c,1.79.2.15,1.79.2.16

russell at lists.digium.com russell at lists.digium.com
Fri Jun 24 18:19:55 CDT 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv30689/channels

Modified Files:
      Tag: v1-0
	chan_mgcp.c 
Log Message:
after a *70, re-enable call waiting on hangup (bug #3971)


Index: chan_mgcp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v
retrieving revision 1.79.2.15
retrieving revision 1.79.2.16
diff -u -d -r1.79.2.15 -r1.79.2.16
--- chan_mgcp.c	31 May 2005 04:39:24 -0000	1.79.2.15
+++ chan_mgcp.c	24 Jun 2005 22:20:22 -0000	1.79.2.16
@@ -365,6 +365,7 @@
     unsigned int callgroup;
     unsigned int pickupgroup;
 	int callwaiting;
+	int hascallwaiting;
     int transfer;
     int threewaycalling;
 	int singlepath;
@@ -937,6 +938,12 @@
 
     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 @@
             /*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 @@
                 }
             }
             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 @@
             		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 @@
                     e->canreinvite = canreinvite;
                     e->singlepath = singlepath;
                     e->callwaiting = callwaiting;
+			e->hascallwaiting = callwaiting;
             		e->slowsequence = slowsequence;
                     e->transfer = transfer;
                     e->threewaycalling = threewaycalling;




More information about the svn-commits mailing list