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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 10 15:51:50 CDT 2009


Author: jpeeler
Date: Fri Jul 10 15:51:46 2009
New Revision: 205980

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=205980
Log:
bye analog_off_hook

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=205980&r1=205979&r2=205980
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c Fri Jul 10 15:51:46 2009
@@ -2412,12 +2412,6 @@
 	return dahdi_ring_phone(p);
 }
 
-static int my_off_hook(void *pvt)
-{
-	struct dahdi_pvt *p = pvt;
-	return dahdi_set_hook(p->subs[SUB_REAL].dfd, DAHDI_OFFHOOK);
-}
-
 static int my_start(void *pvt)
 {
 	struct dahdi_pvt *p = pvt;
@@ -2644,7 +2638,6 @@
 	.is_off_hook = my_is_off_hook,
 	.set_echocanceller = my_set_echocanceller,
 	.ring = my_ring,
-	.off_hook = my_off_hook,
 	.dial_digits = my_dial_digits,
 	.train_echocanceller = my_train_echocanceller,
 	.is_dialing = my_is_dialing,

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=205980&r1=205979&r2=205980
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c Fri Jul 10 15:51:46 2009
@@ -440,14 +440,6 @@
 {
 	if (p->calls->lock_private)
 		p->calls->lock_private(p->chan_pvt);
-}
-
-static int analog_off_hook(struct analog_pvt *p)
-{
-	if (p->calls->off_hook)
-		return p->calls->off_hook(p->chan_pvt);
-	else
-		return -1;
 }
 
 static int analog_dsp_set_digitmode(struct analog_pvt *p, enum analog_dsp_digitmode mode)
@@ -1138,7 +1130,7 @@
 		if (p->hanguponpolarityswitch) {
 			gettimeofday(&p->polaritydelaytv, NULL);
 		}
-		res = analog_off_hook(p);
+		res = analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_OFFHOOK);
 		analog_play_tone(p, index, -1);
 		p->dialing = 0;
 		if ((index == ANALOG_SUB_REAL) && p->subs[ANALOG_SUB_THREEWAY].inthreeway) {
@@ -1406,7 +1398,7 @@
 				if (res > 0) {
 					/* if E911, take off hook */
 					if (p->sig == ANALOG_SIG_E911)
-						analog_off_hook(p);
+						analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_OFFHOOK);
 					res = analog_my_getsigstr(chan, dtmfbuf + strlen(dtmfbuf), "#", 3000);
 				}
 				if (res < 1)
@@ -1473,7 +1465,7 @@
 	                        ast_hangup(chan);
 	                        goto quit;
 			}
-			analog_off_hook(p);
+			analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_OFFHOOK);
 			analog_dsp_set_digitmode(p, ANALOG_DIGITMODE_MF);
                         res = analog_my_getsigstr(chan, anibuf, "#", 10000);
                         if ((res > 0) && (strlen(anibuf) > 2)) {
@@ -1924,7 +1916,7 @@
 						if (res == 1) {
 							if (p->cid_signalling == CID_SIG_V23_JP) {
 								if (ev == ANALOG_EVENT_RINGBEGIN) {
-									analog_off_hook(p);
+									analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_OFFHOOK);
 									usleep(1);
 								} 
 							} else {
@@ -2330,7 +2322,7 @@
 				p->subs[index].f.frametype = AST_FRAME_CONTROL;
 				p->subs[index].f.subclass = AST_CONTROL_ANSWER;
 				/* Make sure it stops ringing */
-				analog_off_hook(p);
+				analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_OFFHOOK);
 				ast_debug(1, "channel %d answered\n", p->channel);
 				p->dialing = 0;
 				p->callwaitcas = 0;
@@ -2361,7 +2353,7 @@
 				return &p->subs[index].f;
 			case AST_STATE_UP:
 				/* Make sure it stops ringing */
-				analog_off_hook(p);
+				analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_OFFHOOK);
 				/* Okay -- probably call waiting*/
 				if (ast_bridged_channel(p->owner))
 					ast_queue_control(p->owner, AST_CONTROL_UNHOLD);
@@ -2867,7 +2859,7 @@
 			break;
 		case ANALOG_EVENT_RINGOFFHOOK:
 			analog_set_echocanceller(p, 1);
-			analog_off_hook(p);
+			analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_OFFHOOK);
 			if (p->owner && (p->owner->_state == AST_STATE_RINGING)) {
 				ast_queue_control(p->subs[ANALOG_SUB_REAL].owner, AST_CONTROL_ANSWER);
 				p->dialing = 0;
@@ -2936,7 +2928,7 @@
 		case ANALOG_SIG_FXOLS:
 		case ANALOG_SIG_FXOGS:
 		case ANALOG_SIG_FXOKS:
-			res = analog_off_hook(i);
+			res = analog_ioctl_operation(i, ANALOG_SUB_REAL, ANALOG_OFFHOOK);
 			if (res && (errno == EBUSY))
 				break;
 			if (i->immediate) {
@@ -3063,7 +3055,7 @@
 			analog_set_echocanceller(i, 0);
 			/* Diddle the battery for the zhone */
 #ifdef ZHONE_HACK
-			analog_off_hook(i);
+			analog_ioctl_operation(i, ANALOG_SUB_REAL, ANALOG_OFFHOOK);
 			usleep(1);
 #endif
 			res = analog_play_tone(i, 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=205980&r1=205979&r2=205980
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h Fri Jul 10 15:51:46 2009
@@ -108,8 +108,8 @@
 /* list of "simple" operations on a dahdi fd for use with analog_ioctl_operation,
    all operations here map directly to the defines found in DAHDI (user.h) */
 enum analog_ioctl_operations {
-	ANALOG_ONHOOK, /*< Set channel on hook */
-	ANALOG_OFFHOOK,
+	ANALOG_ONHOOK,		/*< Set channel on hook */
+	ANALOG_OFFHOOK,		/*< Set channel off hook */
 	ANALOG_WINK,
 	ANALOG_FLASH,
 	ANALOG_START,
@@ -141,8 +141,6 @@
 	int (* const start)(void *pvt);
 	int (* const ring)(void *pvt);
 	int (* const flash)(void *pvt);
-	/*! \brief Set channel off hook */
-	int (* const off_hook)(void *pvt);
 	/* We're assuming that we're going to only wink on ANALOG_SUB_REAL - even though in the code there's an argument to the index
 	 * function */
 	int (* const wink)(void *pvt, enum analog_sub sub);




More information about the asterisk-commits mailing list