[Home]

Summary:ASTERISK-02928: [PATCH] Send DLCX to MGCP gateway when channel is already dead in Asterisk
Reporter:Ben Klang (bklang)Labels:
Date Opened:2004-12-05 14:28:14.000-0600Date Closed:2008-01-15 15:17:35.000-0600
Priority:TrivialRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) mgcp-dlcx-patch.diff
( 1) mgcp-dlcx-patch-v2.diff
Description:Under certain conditions, (mostly when slowsequence=no or undefined in mgcp.conf) going offhook will trigger a "400 <seqno> Endpt in transient state." from the IAD to Asterisk since the channel is not fully up yet.  When this happens, Asterisk drops the call but the IAD still thinks the channel is active, thus blocking any further attempts to use the channel (both inbound calls and going off-hook).  

Subseqent attempts to access the channel will return a "502 <seqno> Active connection exists." from the IAD and the user will hear congestion.

In both cases when the user goes to hang up, the hu event received by Asterisk causes and error message to be printed but no action is taken.

This patch will send a DLCX (delete connection) when Asterisk receives a hangup request for a channel it thinks is already destroyed.

****** ADDITIONAL INFORMATION ******

Index: chan_mgcp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v
retrieving revision 1.95
diff -u -r1.95 chan_mgcp.c
--- chan_mgcp.c 17 Nov 2004 19:11:33 -0000      1.95
+++ chan_mgcp.c 5 Dec 2004 20:13:07 -0000
@@ -3109,7 +3109,11 @@
                    if (option_verbose > 2) {
                        ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s-%d) ast_channel already destroyed\n",
                                    p->name, p->parent->name, sub->id);
-                    }
+                       /* Instruct the other side to remove the connection since it apparently *
+                        * still thinks the channel is active. *
+                        * For Cisco IAD2421 /BAK/ */
+                       transmit_connection_del(sub);
+                   }
                }
            }
            if ((p->hookstate == MGCP_ONHOOK) && (!sub->rtp) && (!sub->next->rtp)) {
Comments:By: Ben Klang (bklang) 2004-12-05 14:29:27.000-0600

Forgot to mention: This is for communication between a Cisco IAD2421 and Asterisk using MGCP.  Also, disclaimer is on file.
/BAK/

By: Mark Spencer (markster) 2004-12-06 01:04:06.000-0600

Great, can you please attach a cvs diff -u?

By: Ben Klang (bklang) 2004-12-06 10:30:54.000-0600

cvs diff -u has been attached.
/BAK/

By: litw (litw) 2004-12-06 12:25:08.000-0600

why transmit_connection_del(sub); - inside if (option_verbose > 2) { ... ???

in other words - it will work only for verbose level > 2 ...

By: Ben Klang (bklang) 2004-12-06 13:29:50.000-0600

You're absolutely right...my mistake.  Thanks for catching that.

Updated patch (mgcp-dlcx-patch-v2.diff) attached and below.
/BAK/

Index: chan_mgcp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v
retrieving revision 1.95
diff -u -r1.95 chan_mgcp.c
--- chan_mgcp.c 17 Nov 2004 19:11:33 -0000      1.95
+++ chan_mgcp.c 6 Dec 2004 19:27:18 -0000
@@ -3107,9 +3107,13 @@
                } else {
                    /* SC: verbose level check */
                    if (option_verbose > 2) {
-                        ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s-%d) ast_channel already destroyed\n",
+                        ast_verbose(VERBOSE_PREFIX_3 "MGCP handle_request(%s@%s-%d) ast_channel already destroyed, resending DLCX.\n",
                                    p->name, p->parent->name, sub->id);
                    }
+                    /* Instruct the other side to remove the connection since it apparently *
+                     * still thinks the channel is active. *
+                     * For Cisco IAD2421 /BAK/ */
+                    transmit_connection_del(sub);
                }
            }
            if ((p->hookstate == MGCP_ONHOOK) && (!sub->rtp) && (!sub->next->rtp)) {

By: Andrey S Pankov (casper) 2004-12-10 03:20:57.000-0600

And please add .txt to diff file names. Thanks.

By: Mark Spencer (markster) 2004-12-18 18:36:32.000-0600

Added to CVS, thanks!

By: Russell Bryant (russell) 2004-12-21 15:14:34.000-0600

fixed in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:17:05.000-0600

Repository: asterisk
Revision: 4480

U   trunk/channels/chan_mgcp.c

------------------------------------------------------------------------
r4480 | markster | 2008-01-15 15:17:04 -0600 (Tue, 15 Jan 2008) | 2 lines

Make sure we del any remaining connections (bug ASTERISK-2928)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=4480

By: Digium Subversion (svnbot) 2008-01-15 15:17:35.000-0600

Repository: asterisk
Revision: 4514

U   branches/v1-0/channels/chan_mgcp.c

------------------------------------------------------------------------
r4514 | russell | 2008-01-15 15:17:35 -0600 (Tue, 15 Jan 2008) | 2 lines

Make sure we del any remaining connections (bug ASTERISK-2928)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=4514