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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jul 12 16:27:21 CDT 2009


Author: jpeeler
Date: Sun Jul 12 16:27:17 2009
New Revision: 206084

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=206084
Log:
remove analog_start, analog_wink and use analog_ioctl_operation instead

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

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=206084&r1=206083&r2=206084
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c Sun Jul 12 16:27:17 2009
@@ -1886,14 +1886,6 @@
 	return 0;
 }
 
-static int dahdi_wink(struct dahdi_pvt *p, int index);
-static int my_wink(void *pvt, enum analog_sub sub)
-{
-	struct dahdi_pvt *p = pvt;
-	int index = analogsub_to_dahdisub(sub);
-	return dahdi_wink(p, index);
-}
-
 static void wakeup_sub(struct dahdi_pvt *p, int a);
 
 static int reset_conf(struct dahdi_pvt *p);
@@ -2004,6 +1996,7 @@
 
 static inline int dahdi_set_hook(int fd, int hs);
 static int dahdi_ring_phone(struct dahdi_pvt *p);
+static int dahdi_wink(struct dahdi_pvt *p, int index);
 
 static int my_ioctl_operation(void *pvt, enum analog_sub sub, enum analog_ioctl_operations op)
 {
@@ -2018,11 +2011,14 @@
 	case DAHDI_OFFHOOK:
 		return dahdi_set_hook(p->subs[dahdi_sub].dfd, DAHDI_OFFHOOK);
 	case DAHDI_WINK:
+		/* assumed to only wink on SUB_REAL - even though in the code
+ 		 * there's an argument to the index function */
 		return dahdi_wink(p, dahdi_sub);
 	case DAHDI_FLASH:
 		x = DAHDI_FLASH;
 		return ioctl(p->subs[dahdi_sub].dfd, DAHDI_HOOK, &x);
 	case DAHDI_START:
+		/* Start a trunk type signalling protocol (everything except phone ports basically) */
 		x = DAHDI_START; 
 		return ioctl(p->subs[dahdi_sub].dfd, DAHDI_HOOK, &x);
 	case DAHDI_RING:
@@ -2412,14 +2408,6 @@
 	return dahdi_ring_phone(p);
 }
 
-static int my_start(void *pvt)
-{
-	struct dahdi_pvt *p = pvt;
-	int x = DAHDI_START;
-
-	return ioctl(p->subs[SUB_REAL].dfd, DAHDI_HOOK, &x);
-}
-
 static int my_dial_digits(void *pvt, enum analog_sub sub, struct analog_dialoperation *dop)
 {
 	int index = analogsub_to_dahdisub(sub);
@@ -2649,12 +2637,10 @@
 	.conf_add = my_conf_add,
 	.conf_del = my_conf_del,
 	.complete_conference_update = my_complete_conference_update,
-	.start = my_start,
 	.all_subchannels_hungup = my_all_subchannels_hungup,
 	.lock_private = my_lock_private,
 	.unlock_private = my_unlock_private,
 	.handle_dtmfup = my_handle_dtmfup,
-	.wink = my_wink,
 	.new_ast_channel = my_new_analog_ast_channel,
 	.dsp_set_digitmode = my_dsp_set_digitmode,
 	.dsp_reset_and_flush_digits = my_dsp_reset_and_flush_digits,

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=206084&r1=206083&r2=206084
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c Sun Jul 12 16:27:17 2009
@@ -400,14 +400,6 @@
 		return -1;
 }
 
-static int analog_start(struct analog_pvt *p)
-{
-	if (p->calls->start)
-		return p->calls->start(p->chan_pvt);
-	else
-		return -1;
-}
-
 static int analog_dial_digits(struct analog_pvt *p, enum analog_sub sub, struct analog_dialoperation *dop)
 {
 	if (p->calls->dial_digits)
@@ -454,14 +446,6 @@
 {
 	if (p->calls->handle_dtmfup)
 		p->calls->handle_dtmfup(p->chan_pvt, ast, analog_index, dest);
-}
-
-static int analog_wink(struct analog_pvt *p, enum analog_sub index)
-{
-	if (p->calls->wink)
-		return p->calls->wink(p->chan_pvt, index);
-	else
-		return -1;
 }
 
 static int analog_has_voicemail(struct analog_pvt *p)
@@ -817,7 +801,7 @@
 			ast_log(LOG_WARNING, "Number '%s' is shorter than stripmsd (%d)\n", c, p->stripmsd);
 			return -1;
 		}
-		res = analog_start(p);
+		res = analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_START);
 		if (res < 0) {
 			if (errno != EINPROGRESS) {
 				return -1;
@@ -1333,7 +1317,7 @@
 	case ANALOG_SIG_SF_FEATDMF:
 	case ANALOG_SIG_SF_FEATB:
 	case ANALOG_SIG_SFWINK:
-		if (analog_wink(p, index))
+		if (analog_ioctl_operation(p, index, ANALOG_WINK))
 			goto quit;
 		/* Fall through */
 	case ANALOG_SIG_EM:
@@ -1372,7 +1356,7 @@
 				res = analog_my_getsigstr(chan, dtmfbuf + 1, "#", 3000);
 				if (res < 1)
 					analog_dsp_reset_and_flush_digits(p);
-				if (analog_wink(p, index)) goto quit;
+				if (analog_ioctl_operation(p, index, ANALOG_WINK)) goto quit;
 				dtmfbuf[0] = 0;
 				/* Wait for the first digit (up to 5 seconds). */
 				res = ast_waitfordigit(chan, 5000);
@@ -1387,7 +1371,7 @@
 				/* if international caca, do it again to get real ANO */
 				if ((p->sig == ANALOG_SIG_FEATDMF) && (dtmfbuf[1] != '0') && (strlen(dtmfbuf) != 14))
 				{
-					if (analog_wink(p, index)) goto quit;
+					if (analog_ioctl_operation(p, index, ANALOG_WINK)) goto quit;
 					dtmfbuf[0] = 0;
 					/* Wait for the first digit (up to 5 seconds). */
 					res = ast_waitfordigit(chan, 5000);
@@ -1548,7 +1532,7 @@
 				ast_log(LOG_WARNING, "Got a non-Feature Group B input on channel %d.  Assuming E&M Wink instead\n", p->channel);
 		}
 		if ((p->sig == ANALOG_SIG_FEATDMF) || (p->sig == ANALOG_SIG_FEATDMF_TA)) {
-			analog_wink(p, index);
+			analog_ioctl_operation(p, index, ANALOG_WINK);
 			/* some switches require a minimum guard time between
 			the last FGD wink and something that answers
 			immediately. This ensures it */




More information about the asterisk-commits mailing list