[asterisk-commits] alecdavis: branch 1.8 r355850 - /branches/1.8/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Feb 18 01:55:16 CST 2012


Author: alecdavis
Date: Sat Feb 18 01:55:11 2012
New Revision: 355850

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=355850
Log:
push 'outgoing' flag from sig_XXX up to chan_dahdi

'p->outgoing' in chan_dahdi and sig_analog wern't kept in sync, particulary FXS ast_hangup didn't clear the 'outgoing' flag.
sig_pri and sig_ss7 were keeping 'outgoing' flag insync.

Now provides a callback for all the low level sig_XXX modules.

(issue ASTERISK-19316)

alecdavis (license 585)
Reported by: Jeremy Pepper
Tested by: alecdavis
 
Review: https://reviewboard.asterisk.org/r/1747/

Modified:
    branches/1.8/channels/chan_dahdi.c
    branches/1.8/channels/sig_analog.c
    branches/1.8/channels/sig_analog.h
    branches/1.8/channels/sig_pri.c
    branches/1.8/channels/sig_pri.h
    branches/1.8/channels/sig_ss7.c
    branches/1.8/channels/sig_ss7.h

Modified: branches/1.8/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_dahdi.c?view=diff&rev=355850&r1=355849&r2=355850
==============================================================================
--- branches/1.8/channels/chan_dahdi.c (original)
+++ branches/1.8/channels/chan_dahdi.c Sat Feb 18 01:55:11 2012
@@ -2240,6 +2240,13 @@
 	p->dialing = is_dialing;
 }
 
+static void my_set_outgoing(void *pvt, int is_outgoing)
+{
+	struct dahdi_pvt *p = pvt;
+
+	p->outgoing = is_outgoing;
+}
+
 #if defined(HAVE_PRI) || defined(HAVE_SS7)
 static void my_set_digital(void *pvt, int is_digital)
 {
@@ -3362,6 +3369,7 @@
 	.fixup_chans = my_pri_fixup_chans,
 	.set_alarm = my_set_alarm,
 	.set_dialing = my_set_dialing,
+	.set_outgoing = my_set_outgoing,
 	.set_digital = my_set_digital,
 	.set_callerid = my_set_callerid,
 	.set_dnid = my_set_dnid,
@@ -3532,6 +3540,7 @@
 	.handle_link_exception = my_handle_link_exception,
 	.set_alarm = my_set_alarm,
 	.set_dialing = my_set_dialing,
+	.set_outgoing = my_set_outgoing,
 	.set_digital = my_set_digital,
 	.set_inservice = my_set_inservice,
 	.set_locallyblocked = my_set_locallyblocked,
@@ -3673,6 +3682,7 @@
 	.set_cadence = my_set_cadence,
 	.set_alarm = my_set_alarm,
 	.set_dialing = my_set_dialing,
+	.set_outgoing = my_set_outgoing,
 	.set_ringtimeout = my_set_ringtimeout,
 	.set_waitingfordt = my_set_waitingfordt,
 	.check_waitingfordt = my_check_waitingfordt,

Modified: branches/1.8/channels/sig_analog.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sig_analog.c?view=diff&rev=355850&r1=355849&r2=355850
==============================================================================
--- branches/1.8/channels/sig_analog.c (original)
+++ branches/1.8/channels/sig_analog.c Sat Feb 18 01:55:11 2012
@@ -512,6 +512,14 @@
 	return -1;
 }
 
+static void analog_set_outgoing(struct analog_pvt *p, int is_outgoing)
+{
+	p->outgoing = is_outgoing;
+	if (p->calls->set_outgoing) {
+		p->calls->set_outgoing(p->chan_pvt, is_outgoing);
+	}
+}
+
 static int analog_check_for_conference(struct analog_pvt *p)
 {
 	if (p->calls->check_for_conference) {
@@ -793,11 +801,11 @@
 		}
 	}
 
-	p->outgoing = 1;
+	analog_set_outgoing(p, 1);
 	ast = analog_new_ast_channel(p, AST_STATE_RESERVED, 0,
 		p->owner ? ANALOG_SUB_CALLWAIT : ANALOG_SUB_REAL, requestor);
 	if (!ast) {
-		p->outgoing = 0;
+		analog_set_outgoing(p, 0);
 	}
 	return ast;
 }
@@ -1023,7 +1031,7 @@
 	}
 
 	p->dialednone = 0;
-	p->outgoing = 1;
+	analog_set_outgoing(p, 1);
 
 	mysig = p->sig;
 	if (p->outsigmod > -1) {
@@ -1426,7 +1434,7 @@
 		analog_set_ringtimeout(p, 0);
 		analog_set_confirmanswer(p, 0);
 		analog_set_pulsedial(p, 0);
-		p->outgoing = 0;
+		analog_set_outgoing(p, 0);
 		p->onhooktime = time(NULL);
 		p->cidrings = 1;
 

Modified: branches/1.8/channels/sig_analog.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sig_analog.h?view=diff&rev=355850&r1=355849&r2=355850
==============================================================================
--- branches/1.8/channels/sig_analog.h (original)
+++ branches/1.8/channels/sig_analog.h Sat Feb 18 01:55:11 2012
@@ -223,6 +223,7 @@
 	void (* const set_cadence)(void *pvt, int *cidrings, struct ast_channel *chan);
 	void (* const set_alarm)(void *pvt, int in_alarm);
 	void (* const set_dialing)(void *pvt, int is_dialing);
+	void (* const set_outgoing)(void *pvt, int is_outgoing);
 	void (* const set_ringtimeout)(void *pvt, int ringt);
 	void (* const set_waitingfordt)(void *pvt, struct ast_channel *ast);
 	int (* const check_waitingfordt)(void *pvt);

Modified: branches/1.8/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sig_pri.c?view=diff&rev=355850&r1=355849&r2=355850
==============================================================================
--- branches/1.8/channels/sig_pri.c (original)
+++ branches/1.8/channels/sig_pri.c Sat Feb 18 01:55:11 2012
@@ -177,6 +177,14 @@
 	p->digital = is_digital;
 	if (p->calls->set_digital) {
 		p->calls->set_digital(p->chan_pvt, is_digital);
+	}
+}
+
+static void sig_pri_set_outgoing(struct sig_pri_chan *p, int is_outgoing)
+{
+	p->outgoing = is_outgoing;
+	if (p->calls->set_outgoing) {
+		p->calls->set_outgoing(p->chan_pvt, is_outgoing);
 	}
 }
 
@@ -993,10 +1001,10 @@
 
 	ast_log(LOG_DEBUG, "%s %d\n", __FUNCTION__, p->channel);
 
-	p->outgoing = 1;
+	sig_pri_set_outgoing(p, 1);
 	ast = sig_pri_new_ast_channel(p, AST_STATE_RESERVED, law, transfercapability, p->exten, requestor);
 	if (!ast) {
-		p->outgoing = 0;
+		sig_pri_set_outgoing(p, 0);
 	}
 	return ast;
 }
@@ -6330,7 +6338,7 @@
 		return 0;
 	}
 
-	p->outgoing = 0;
+	sig_pri_set_outgoing(p, 0);
 	sig_pri_set_digital(p, 0);	/* push up to parent for EC*/
 #if defined(HAVE_PRI_CALL_WAITING)
 	if (p->is_call_waiting) {
@@ -6541,7 +6549,7 @@
 	}
 
 	p->dialdest[0] = '\0';
-	p->outgoing = 1;
+	sig_pri_set_outgoing(p, 1);
 
 	ast_copy_string(dest, rdest, sizeof(dest));
 	AST_NONSTANDARD_APP_ARGS(args, dest, '/');

Modified: branches/1.8/channels/sig_pri.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sig_pri.h?view=diff&rev=355850&r1=355849&r2=355850
==============================================================================
--- branches/1.8/channels/sig_pri.h (original)
+++ branches/1.8/channels/sig_pri.h Sat Feb 18 01:55:11 2012
@@ -129,6 +129,7 @@
 	void (* const set_alarm)(void *pvt, int in_alarm);
 	void (* const set_dialing)(void *pvt, int is_dialing);
 	void (* const set_digital)(void *pvt, int is_digital);
+	void (* const set_outgoing)(void *pvt, int is_outgoing);
 	void (* const set_callerid)(void *pvt, const struct ast_party_caller *caller);
 	void (* const set_dnid)(void *pvt, const char *dnid);
 	void (* const set_rdnis)(void *pvt, const char *rdnis);

Modified: branches/1.8/channels/sig_ss7.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sig_ss7.c?view=diff&rev=355850&r1=355849&r2=355850
==============================================================================
--- branches/1.8/channels/sig_ss7.c (original)
+++ branches/1.8/channels/sig_ss7.c Sat Feb 18 01:55:11 2012
@@ -107,6 +107,14 @@
 {
 	if (p->calls->set_digital) {
 		p->calls->set_digital(p->chan_pvt, is_digital);
+	}
+}
+
+static void sig_ss7_set_outgoing(struct sig_ss7_chan *p, int is_outgoing)
+{
+	p->outgoing = is_outgoing;
+	if (p->calls->set_outgoing) {
+		p->calls->set_outgoing(p->chan_pvt, is_outgoing);
 	}
 }
 
@@ -1560,7 +1568,7 @@
 
 	p->owner = NULL;
 	sig_ss7_set_dialing(p, 0);
-	p->outgoing = 0;
+	sig_ss7_set_outgoing(p, 0);
 	p->progress = 0;
 	p->rlt = 0;
 	p->exten[0] = '\0';
@@ -1745,10 +1753,10 @@
 {
 	struct ast_channel *ast;
 
-	p->outgoing = 1;
+	sig_ss7_set_outgoing(p, 1);
 	ast = sig_ss7_new_ast_channel(p, AST_STATE_RESERVED, law, transfercapability, p->exten, requestor);
 	if (!ast) {
-		p->outgoing = 0;
+		sig_ss7_set_outgoing(p, 0);
 
 		/* Release the allocated channel.  Only have to deal with the linkset lock. */
 		ast_mutex_lock(&p->ss7->lock);

Modified: branches/1.8/channels/sig_ss7.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/sig_ss7.h?view=diff&rev=355850&r1=355849&r2=355850
==============================================================================
--- branches/1.8/channels/sig_ss7.h (original)
+++ branches/1.8/channels/sig_ss7.h Sat Feb 18 01:55:11 2012
@@ -140,6 +140,7 @@
 	void (* const set_alarm)(void *pvt, int in_alarm);
 	void (* const set_dialing)(void *pvt, int is_dialing);
 	void (* const set_digital)(void *pvt, int is_digital);
+	void (* const set_outgoing)(void *pvt, int is_outgoing);
 	void (* const set_inservice)(void *pvt, int is_inservice);
 	void (* const set_locallyblocked)(void *pvt, int is_blocked);
 	void (* const set_remotelyblocked)(void *pvt, int is_blocked);




More information about the asterisk-commits mailing list