[svn-commits] rmudgett: mISDNuser/trunk r195 - /mISDNuser/trunk/i4lnet/net_l3.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Sep 18 11:30:06 CDT 2012


Author: rmudgett
Date: Tue Sep 18 11:30:03 2012
New Revision: 195

URL: http://svnview.digium.com/svn/thirdparty?view=rev&rev=195
Log:
Fix loss of available chan_misdn procids in NT PTMP mode.

There are two bugs in mISDNuser lib which eat up the available procids of
chan_misdn when it services a BRI NT PTMP port.  When this happens 256
times, it's not possible anymore to call out to a phone connected to the
NT port until asterisk is restarted.

The misdn driver stack normally sends a CC_RELEASE_CR to chan_misdn call
control when a call is completely released.  chan_misdn will then release
the used call process ID (procid).  But there are two situations where
this does not happen.

Case 1:
When a phone on NT is called and the called party rejects the call with a
cause, CC_RELEASE_CR is not generated.  In this case CC_RELEASE_COMPLETE
indication is also sent twice, which makes no sense at all.

Case 2:
When a phone on NT is called, and the calling party hangs up before the
call is answered, but after timer T312 (6s) has expired, CC_RELEASE_CR is
not generated due to a wrong 3rd argument to send_proc().

JIRA ABE-2811

Modified:
    mISDNuser/trunk/i4lnet/net_l3.c

Modified: mISDNuser/trunk/i4lnet/net_l3.c
URL: http://svnview.digium.com/svn/thirdparty/mISDNuser/trunk/i4lnet/net_l3.c?view=diff&rev=195&r1=194&r2=195
==============================================================================
--- mISDNuser/trunk/i4lnet/net_l3.c (original)
+++ mISDNuser/trunk/i4lnet/net_l3.c Tue Sep 18 11:30:03 2012
@@ -2378,22 +2378,9 @@
 		if (!pc->child) {
 			/* Q.931 5.2.5.3: pass the retained cause (if any) with CC_RELEASE_COMPLETE */
 			if (pc->cause) {
-				msg_t *msg;
-				RELEASE_COMPLETE_t *relc;
-
-				msg = prep_l3data_msg(CC_RELEASE_COMPLETE | INDICATION,
-					pc->ces | (pc->callref << 16),
-					sizeof(RELEASE_COMPLETE_t), 3, NULL);
-				if (msg) {
-					relc = (RELEASE_COMPLETE_t *)(msg->data + mISDNUSER_HEAD_SIZE);
-					relc->CAUSE = msg_put(msg, 3);
-					relc->CAUSE[0] = 2;
-					relc->CAUSE[1] = 0x80;
-					relc->CAUSE[2] = pc->cause | 0x80;
-					if (mISDN_l3up(pc, msg)) {
-						free_msg(msg);
-					}
-				}
+				/* sending the CC_RELEASE_COMPLETE w/ cause will be done by
+				 * calling send_proc(...,IMSG_END_PROC_M,...) below!
+				 */
 			} else {
 				if_link(pc->l3->nst->manager, (ifunc_t)pc->l3->nst->l3_manager,
 					CC_TIMEOUT | INDICATION,pc->ces |
@@ -2717,7 +2704,7 @@
 	switch (master->state) {
 		case 0:
 			if (!master->child) {
-				send_proc(master, IMSG_END_PROC, master);
+				send_proc(master, IMSG_END_PROC, NULL);
 			}
 			break;
 		case 6:
@@ -2798,13 +2785,12 @@
 							free_msg(msg);
 						}
 					}
-				} else {
-					if_link(proc->l3->nst->manager,
-						(ifunc_t)proc->l3->nst->l3_manager,
-						CC_RELEASE_CR | INDICATION,
-						proc->ces | (proc->callref << 16),
-						sizeof(int), &proc->err, 0);
 				}
+				if_link(proc->l3->nst->manager,
+					(ifunc_t)proc->l3->nst->l3_manager,
+					CC_RELEASE_CR | INDICATION,
+					proc->ces | (proc->callref << 16),
+					sizeof(int), &proc->err, 0);
 			}
 			while (proc->child)
 				send_proc(proc->child, IMSG_END_PROC, NULL);




More information about the svn-commits mailing list