[asterisk-commits] jpeeler: branch jpeeler/asterisk-sigwork-trunk r206227 - /team/jpeeler/asteri...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 13 13:57:08 CDT 2009


Author: jpeeler
Date: Mon Jul 13 13:57:04 2009
New Revision: 206227

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=206227
Log:
prune dahdi_hangup of code that is now handled by sig_analog

Modified:
    team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c
    team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c
    team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h

Modified: team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c?view=diff&rev=206227&r1=206226&r2=206227
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c Mon Jul 13 13:57:04 2009
@@ -2314,7 +2314,7 @@
 	return dahdievent_to_analogevent(res);
 }
 
-static int my_is_off_hook(void *pvt)
+static int my_is_off_hook(void *pvt, int debug)
 {
 	struct dahdi_pvt *p = pvt;
 	int res;
@@ -2329,6 +2329,9 @@
 	}
 	if (res) {
 		ast_log(LOG_WARNING, "Unable to check hook state on channel %d: %s\n", p->channel, strerror(errno));
+	}
+	if (debug) {
+		ast_debug(1, "Channel %d, offhook = %d\n", p->channel, par.rxisoffhook);
 	}
 
 	return (par.rxbits > -1) || par.rxisoffhook;
@@ -4854,7 +4857,6 @@
 	struct dahdi_pvt *p = ast->tech_pvt;
 	struct dahdi_pvt *tmp = NULL;
 	struct dahdi_pvt *prev = NULL;
-	struct dahdi_params par;
 
 	ast_debug(1, "dahdi_hangup(%s)\n", ast->name);
 	if (!ast->tech_pvt) {
@@ -5136,37 +5138,6 @@
 			res = dahdi_set_hook(p->subs[SUB_REAL].dfd, DAHDI_ONHOOK);
 		if (res < 0) {
 			ast_log(LOG_WARNING, "Unable to hangup line %s\n", ast->name);
-		}
-		switch (p->sig) {
-		case SIG_FXOGS:
-		case SIG_FXOLS:
-		case SIG_FXOKS:
-			memset(&par, 0, sizeof(par));
-			res = ioctl(p->subs[SUB_REAL].dfd, DAHDI_GET_PARAMS, &par);
-			if (!res) {
-#if 0
-				ast_debug(1, "Hanging up channel %d, offhook = %d\n", p->channel, par.rxisoffhook);
-#endif
-				/* If they're off hook, try playing congestion */
-				if ((par.rxisoffhook) && (!(p->radio || (p->oprmode < 0))))
-					tone_zone_play_tone(p->subs[SUB_REAL].dfd, DAHDI_TONE_CONGESTION);
-				else
-					tone_zone_play_tone(p->subs[SUB_REAL].dfd, -1);
-				p->fxsoffhookstate = par.rxisoffhook;
-			}
-			break;
-		case SIG_FXSGS:
-		case SIG_FXSLS:
-		case SIG_FXSKS:
-			/* Make sure we're not made available for at least two seconds assuming
-			   we were actually used for an inbound or outbound call. */
-			if (ast->_state != AST_STATE_RESERVED) {
-				time(&p->guardtime);
-				p->guardtime += 2;
-			}
-			break;
-		default:
-			tone_zone_play_tone(p->subs[SUB_REAL].dfd, -1);
 		}
 		if (p->sig)
 			dahdi_disable_ec(p);

Modified: team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c?view=diff&rev=206227&r1=206226&r2=206227
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c Mon Jul 13 13:57:04 2009
@@ -384,10 +384,10 @@
 		return -1;
 }
 
-static int analog_is_off_hook(struct analog_pvt *p)
+static int analog_is_off_hook(struct analog_pvt *p, int debug)
 {
 	if (p->calls->is_off_hook)
-		return p->calls->is_off_hook(p->chan_pvt);
+		return p->calls->is_off_hook(p->chan_pvt, debug);
 	else
 		return -1;
 }
@@ -621,7 +621,7 @@
 		if (p->sig == ANALOG_SIG_FXSLS)
 			return 1;
 
-		offhook = analog_is_off_hook(p);
+		offhook = analog_is_off_hook(p, 0);
 
 		if ((p->sig == ANALOG_SIG_FXSKS) || (p->sig == ANALOG_SIG_FXSGS)) {
 			/* When "onhook" that means no battery on the line, and thus
@@ -1066,7 +1066,7 @@
 		case ANALOG_SIG_FXOLS:
 		case ANALOG_SIG_FXOKS:
 			/* If they're off hook, try playing congestion */
-			if (analog_is_off_hook(p))
+			if (analog_is_off_hook(p, 1))
 				analog_play_tone(p, ANALOG_SUB_REAL, ANALOG_TONE_CONGESTION);
 			else
 				analog_play_tone(p, ANALOG_SUB_REAL, -1);

Modified: team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h?view=diff&rev=206227&r1=206226&r2=206227
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h Mon Jul 13 13:57:04 2009
@@ -123,7 +123,7 @@
 
 	int (* const get_event)(void *pvt);
 	int (* const wait_event)(void *pvt);
-	int (* const is_off_hook)(void *pvt);
+	int (* const is_off_hook)(void *pvt, int debug);
 	int (* const is_dialing)(void *pvt, enum analog_sub sub);
 	/* Start a trunk type signalling protocol (everything except phone ports basically */
 	int (* const start)(void *pvt);




More information about the asterisk-commits mailing list