[asterisk-commits] mattf: branch mattf/asterisk-trunk-ntptmp r216221 - /team/mattf/asterisk-trun...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 3 17:56:49 CDT 2009


Author: mattf
Date: Thu Sep  3 17:56:46 2009
New Revision: 216221

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=216221
Log:
First true NT-PTMP version doing broadcast calling that passes all of my tests: 1.) Hangup initiated by network before any response received, 2.) Hangup initiated by network or user after response(s) are received but nobody picks up, and 3.) Someone picked up, call is connected, other calls competing are hung up, and finally, either we or other side initiates clearing at the end of the call.  This has been tested in true PTMP broadcast mode, with multiple phones connected to the same NT port, and assigned the same MSN so that multiple phones are competing for broadcasted call.

Modified:
    team/mattf/asterisk-trunk-ntptmp/channels/sig_pri.c

Modified: team/mattf/asterisk-trunk-ntptmp/channels/sig_pri.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/mattf/asterisk-trunk-ntptmp/channels/sig_pri.c?view=diff&rev=216221&r1=216220&r2=216221
==============================================================================
--- team/mattf/asterisk-trunk-ntptmp/channels/sig_pri.c (original)
+++ team/mattf/asterisk-trunk-ntptmp/channels/sig_pri.c Thu Sep  3 17:56:46 2009
@@ -848,27 +848,29 @@
 				pri_find_dchan(pri);
 				if (!pri_is_up(pri)) {
 					pri->resetting = 0;
-					/* Hangup active channels and put them in alarm mode */
-					for (i = 0; i < pri->numchans; i++) {
-						struct sig_pri_chan *p = pri->pvts[i];
-						if (p) {
-							if (!p->pri || !p->pri->pri || pri_get_timer(p->pri->pri, PRI_TIMER_T309) < 0) {
-								/* T309 is not enabled : hangup calls when alarm occurs */
-								if (p->call) {
-									if (p->pri && p->pri->pri) {
-										pri_hangup(p->pri->pri, p->call, -1);
-										pri_destroycall(p->pri->pri, p->call);
-										p->call = NULL;
-									} else
-										ast_log(LOG_WARNING, "The PRI Call have not been destroyed\n");
+					if (pri->sig != SIG_BRI_PTMP) {
+						/* Hangup active channels and put them in alarm mode */
+						for (i = 0; i < pri->numchans; i++) {
+							struct sig_pri_chan *p = pri->pvts[i];
+							if (p) {
+								if (!p->pri || !p->pri->pri || pri_get_timer(p->pri->pri, PRI_TIMER_T309) < 0) {
+									/* T309 is not enabled : hangup calls when alarm occurs */
+									if (p->call) {
+										if (p->pri && p->pri->pri) {
+											pri_hangup(p->pri->pri, p->call, -1);
+											pri_destroycall(p->pri->pri, p->call);
+											p->call = NULL;
+										} else
+											ast_log(LOG_WARNING, "The PRI Call have not been destroyed\n");
+									}
+									if (p->owner)
+										ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_DEV);
 								}
-								if (p->owner)
-									ast_softhangup_nolock(p->owner, AST_SOFTHANGUP_DEV);
-							}
-							/* For PTMP connections with non persistent layer 2 we want
-							 * to *not* declare inalarm unless there actually is an alarm */
-							if (p->pri->sig != SIG_BRI_PTMP) {
-								p->inalarm = 1;
+								/* For PTMP connections with non persistent layer 2 we want
+								 * to *not* declare inalarm unless there actually is an alarm */
+								if (p->pri->sig != SIG_BRI_PTMP) {
+									p->inalarm = 1;
+								}
 							}
 						}
 					}
@@ -1409,6 +1411,7 @@
 				}
 				break;				
 			case PRI_EVENT_HANGUP:
+				ast_log(LOG_ERROR, "HANGUP\n");
 				chanpos = pri_find_principle(pri, e->hangup.channel);
 				if (chanpos < 0) {
 					ast_log(LOG_WARNING, "Hangup requested on unconfigured channel %d/%d span %d\n", 
@@ -1479,6 +1482,7 @@
 #error please update libpri
 #endif
 			case PRI_EVENT_HANGUP_REQ:
+				ast_log(LOG_ERROR, "HANGUP_REQ\n");
 				chanpos = pri_find_principle(pri, e->hangup.channel);
 				if (chanpos < 0) {
 					ast_log(LOG_WARNING, "Hangup REQ requested on unconfigured channel %d/%d span %d\n", 
@@ -1539,6 +1543,7 @@
 				} 
 				break;
 			case PRI_EVENT_HANGUP_ACK:
+				ast_log(LOG_ERROR, "HANGUP_ACK\n");
 				chanpos = pri_find_principle(pri, e->hangup.channel);
 				if (chanpos < 0) {
 					ast_log(LOG_WARNING, "Hangup ACK requested on unconfigured channel number %d/%d span %d\n", 




More information about the asterisk-commits mailing list