[svn-commits] moy: branch moy/tap-1.4 r2177 - /team/moy/tap-1.4/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Dec 31 17:48:13 UTC 2010


Author: moy
Date: Fri Dec 31 11:48:09 2010
New Revision: 2177

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=2177
Log:
hack - I must stop using libpri for tapping -_-

Modified:
    team/moy/tap-1.4/Makefile
    team/moy/tap-1.4/libpri.h
    team/moy/tap-1.4/pri.c
    team/moy/tap-1.4/pri_internal.h
    team/moy/tap-1.4/q931.c

Modified: team/moy/tap-1.4/Makefile
URL: http://svnview.digium.com/svn/libpri/team/moy/tap-1.4/Makefile?view=diff&rev=2177&r1=2176&r2=2177
==============================================================================
--- team/moy/tap-1.4/Makefile (original)
+++ team/moy/tap-1.4/Makefile Fri Dec 31 11:48:09 2010
@@ -83,7 +83,7 @@
 	rose_qsig_mwi.lo \
 	rose_qsig_name.lo \
 	version.lo
-CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC $(ALERTING) $(LIBPRI_COUNTERS) $(LIBPRI_OPT)
+CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -ggdb3 -fPIC $(ALERTING) $(LIBPRI_COUNTERS) $(LIBPRI_OPT)
 INSTALL_PREFIX=$(DESTDIR)
 INSTALL_BASE=/usr
 libdir?=$(INSTALL_BASE)/lib
@@ -116,7 +116,7 @@
 PROC=ultrasparc
 LIBPRI_OPT = -mtune=$(PROC) -O3 -pipe -fomit-frame-pointer -mcpu=v8
 else
-LIBPRI_OPT = -O2
+LIBPRI_OPT = -O0
 endif
 
 all: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)

Modified: team/moy/tap-1.4/libpri.h
URL: http://svnview.digium.com/svn/libpri/team/moy/tap-1.4/libpri.h?view=diff&rev=2177&r1=2176&r2=2177
==============================================================================
--- team/moy/tap-1.4/libpri.h (original)
+++ team/moy/tap-1.4/libpri.h Fri Dec 31 11:48:09 2010
@@ -809,6 +809,7 @@
 
 #define PRI_DESTROYCALL
 void pri_destroycall(struct pri *pri, q931_call *call);
+void pri_passive_destroycall(struct pri *pri, q931_call *call);
 
 #define PRI_RESTART
 int pri_restart(struct pri *pri);

Modified: team/moy/tap-1.4/pri.c
URL: http://svnview.digium.com/svn/libpri/team/moy/tap-1.4/pri.c?view=diff&rev=2177&r1=2176&r2=2177
==============================================================================
--- team/moy/tap-1.4/pri.c (original)
+++ team/moy/tap-1.4/pri.c Fri Dec 31 11:48:09 2010
@@ -582,6 +582,15 @@
 	return;
 }
 
+void pri_passive_destroycall(struct pri *pri, q931_call *call)
+{
+	if (pri && call) {
+		call->magic = 0xDEADDEAD;
+		__q931_destroycall(pri, call);
+	}
+	return;
+}
+
 int pri_need_more_info(struct pri *pri, q931_call *call, int channel, int nonisdn)
 {
 	if (!pri || !call)

Modified: team/moy/tap-1.4/pri_internal.h
URL: http://svnview.digium.com/svn/libpri/team/moy/tap-1.4/pri_internal.h?view=diff&rev=2177&r1=2176&r2=2177
==============================================================================
--- team/moy/tap-1.4/pri_internal.h (original)
+++ team/moy/tap-1.4/pri_internal.h Fri Dec 31 11:48:09 2010
@@ -335,6 +335,7 @@
 
 /* q931_call datastructure */
 struct q931_call {
+	int magic;
 	struct pri *pri;	/* PRI */
 	int cr;				/* Call Reference */
 	q931_call *next;

Modified: team/moy/tap-1.4/q931.c
URL: http://svnview.digium.com/svn/libpri/team/moy/tap-1.4/q931.c?view=diff&rev=2177&r1=2176&r2=2177
==============================================================================
--- team/moy/tap-1.4/q931.c (original)
+++ team/moy/tap-1.4/q931.c Fri Dec 31 11:48:09 2010
@@ -3056,6 +3056,10 @@
 	if (!cur) {
 		return NULL;
 	}
+	if (ctrl->debug & PRI_DEBUG_Q931_STATE) {
+		pri_message(ctrl, "-- Created new call %p for cr %d\n", cur, cr);
+		cur->magic = 0xDEADBEEF;
+	}
 
 	/* Initialize call structure. */
 	cur->cr = cr;
@@ -3143,17 +3147,28 @@
 	cur = *ctrl->callpool;
 	while(cur) {
 		if ((c && (cur == c)) || (!c && (cur->cr == cr))) {
+
+			if (cur->magic != 0xDEADDEAD) {
+				pri_message(ctrl,
+					"NEW_HANGUP DEBUG: NOT Destroying the call %d (%p), ourstate %s, peerstate %s with magic %d\n",
+					cr, cur, q931_call_state_str(cur->ourcallstate),
+					q931_call_state_str(cur->peercallstate), cur->magic);
+				return;
+			}
+
 			if (prev)
 				prev->next = cur->next;
 			else
 				*ctrl->callpool = cur->next;
-			if (ctrl->debug & PRI_DEBUG_Q931_STATE)
+			if (ctrl->debug & PRI_DEBUG_Q931_STATE) {
 				pri_message(ctrl,
-					"NEW_HANGUP DEBUG: Destroying the call, ourstate %s, peerstate %s\n",
-					q931_call_state_str(cur->ourcallstate),
+					"NEW_HANGUP DEBUG: Destroying the call %d (%p), ourstate %s, peerstate %s\n",
+					cr, cur, q931_call_state_str(cur->ourcallstate),
 					q931_call_state_str(cur->peercallstate));
+			}
 			pri_schedule_del(ctrl, cur->retranstimer);
 			pri_call_apdu_queue_cleanup(cur);
+			cur->magic = 0x0;
 			free(cur);
 			return;
 		}
@@ -5033,10 +5048,10 @@
 		ctrl->ev.hangup.aoc_units = c->aoc_units;
 		libpri_copy_string(ctrl->ev.hangup.useruserinfo, c->useruserinfo, sizeof(ctrl->ev.hangup.useruserinfo));
 		c->useruserinfo[0] = '\0';
-		if (c->alive)
+		//if (c->alive)
 			return Q931_RES_HAVEEVENT;
-		else
-			q931_hangup(ctrl,c,c->cause);
+		//else
+		//	q931_hangup(ctrl,c,c->cause);
 		break;
 	case Q931_RESTART_ACKNOWLEDGE:
 		UPDATE_OURCALLSTATE(ctrl, c, Q931_CALL_STATE_NULL);




More information about the svn-commits mailing list