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

Modified Files:
        chan_mgcp.c 
Log Message:
Fix MGCP call waiting (bug #3971, with mods)


Index: chan_mgcp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- chan_mgcp.c 5 Apr 2005 21:40:37 -0000       1.114
+++ chan_mgcp.c 11 Apr 2005 05:48:58 -0000      1.115
@@ -375,6 +375,7 @@
        ast_group_t callgroup;
        ast_group_t pickupgroup;
        int callwaiting;
+       int hascallwaiting;
        int transfer;
        int threewaycalling;
        int singlepath;
@@ -1048,6 +1049,11 @@
 
        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 [EMAIL PROTECTED] set vmwi(+)\n", 
@@ -2646,7 +2652,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);
                        }
@@ -3192,6 +3198,12 @@
                                }
                        }
                        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/[EMAIL PROTECTED]", 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([EMAIL PROTECTED]) set vmwi(+)\n", p->name, 
p->parent->name);
@@ -3726,6 +3738,7 @@
                                        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 @@
                                        e->canreinvite = canreinvite;
                                        e->singlepath = singlepath;
                                        e->callwaiting = callwaiting;
+                                       e->hascallwaiting = callwaiting;
                                        e->slowsequence = slowsequence;
                                        e->transfer = transfer;
                                        e->threewaycalling = threewaycalling;

_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to