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

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


Author: jpeeler
Date: Sun Jul 12 16:40:07 2009
New Revision: 206086

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=206086
Log:
remove analog_get_event, analog_ring 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
    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=206086&r1=206085&r2=206086
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/chan_dahdi.c Sun Jul 12 16:40:07 2009
@@ -2028,7 +2028,7 @@
 			x = p->fake_event;
 			p->fake_event = 0;
 		} else
-			x = dahdi_get_event(p->subs[dahdi_sub].dfd);
+			x = dahdi_get_event(p->subs[SUB_REAL].dfd);
 		return dahdievent_to_analogevent(x);
 	case DAHDI_DIALING:
 		if (ioctl(p->subs[dahdi_sub].dfd, DAHDI_DIALING, &x)) {
@@ -2352,20 +2352,6 @@
 	return dahdi_wait_event(p->subs[SUB_REAL].dfd);
 }
 
-static int my_get_event(void *pvt)
-{
-	struct dahdi_pvt *p = pvt;
-	int res;
-
-	if (p->fake_event) {
-		res = p->fake_event;
-		p->fake_event = 0;
-	} else
-		res = dahdi_get_event(p->subs[SUB_REAL].dfd);
-
-	return dahdievent_to_analogevent(res);
-}
-
 static int my_is_off_hook(void *pvt)
 {
 	struct dahdi_pvt *p = pvt;
@@ -2399,13 +2385,6 @@
 		dahdi_disable_ec(p);
 
 	return 0;
-}
-
-static int my_ring(void *pvt)
-{
-	struct dahdi_pvt *p = pvt;
-
-	return dahdi_ring_phone(p);
 }
 
 static int my_dial_digits(void *pvt, enum analog_sub sub, struct analog_dialoperation *dop)
@@ -2621,11 +2600,9 @@
 static struct analog_callback dahdi_analog_callbacks =
 {
 	.play_tone = my_play_tone,
-	.get_event = my_get_event,
 	.wait_event = my_wait_event,
 	.is_off_hook = my_is_off_hook,
 	.set_echocanceller = my_set_echocanceller,
-	.ring = my_ring,
 	.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=206086&r1=206085&r2=206086
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.c Sun Jul 12 16:40:07 2009
@@ -168,14 +168,6 @@
 		return -1;
 }
 
-static int analog_get_event(struct analog_pvt *p)
-{
-	if (p->calls->get_event)
-		return p->calls->get_event(p->chan_pvt);
-	else
-		return -1;
-}
-
 static int analog_wait_event(struct analog_pvt *p)
 {
 	if (p->calls->wait_event)
@@ -388,14 +380,6 @@
 {
 	if (p->calls->is_off_hook)
 		return p->calls->is_off_hook(p->chan_pvt);
-	else
-		return -1;
-}
-
-static int analog_ring(struct analog_pvt *p)
-{
-	if (p->calls->ring)
-		return p->calls->ring(p->chan_pvt);
 	else
 		return -1;
 }
@@ -722,7 +706,7 @@
 				p->dop.dialstr[0] = '\0';
 			}
 
-			if (analog_ring(p)) {
+			if (analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_RING)) {
 				ast_log(LOG_WARNING, "Unable to ring phone: %s\n", strerror(errno));
 				return -1;
 			}
@@ -2101,7 +2085,7 @@
 		ast_log(LOG_ERROR, "We got an event on a non real sub.  Fix it!\n");
 	}
 
-	res = analog_get_event(p);
+	res = analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_GETEVENT);
 
 	ast_debug(1, "Got event %s(%d) on channel %d (index %d)\n", analog_event2str(res), res, p->channel, index);
 
@@ -2181,7 +2165,7 @@
 					/* Don't start streaming audio yet if the incoming call isn't up yet */
 					if (p->subs[ANALOG_SUB_REAL].owner->_state != AST_STATE_UP)
 						p->dialing = 1;
-					analog_ring(p);
+					analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_RING);
 				} else if (p->subs[ANALOG_SUB_THREEWAY].owner) {
 					unsigned int mssinceflash;
 					/* Here we have to retain the lock on both the main channel, the 3-way channel, and
@@ -2222,7 +2206,7 @@
 								analog_swap_subs(p, ANALOG_SUB_THREEWAY, ANALOG_SUB_REAL);
 								p->owner = NULL;
 								/* Ring the phone */
-								analog_ring(p);
+								analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_RING);
 							} else {
 								if ((res = analog_attempt_transfer(p)) < 0) {
 									ast_softhangup_nolock(p->subs[ANALOG_SUB_THREEWAY].owner, AST_SOFTHANGUP_DEV);
@@ -2254,7 +2238,7 @@
 						analog_swap_subs(p, ANALOG_SUB_THREEWAY, ANALOG_SUB_REAL);
 						p->owner = NULL;
 						/* Ring the phone */
-						analog_ring(p);
+						analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_RING);
 					}
 				}
 			} else {
@@ -2820,7 +2804,7 @@
 		   other end hangs up our channel so that it no longer exists, but we
 		   have neither FLASH'd nor ONHOOK'd to signify our desire to
 		   change to the other channel. */
-		res = analog_get_event(p);
+		res = analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_GETEVENT);
 
 		/* Switch to real if there is one and this isn't something really silly... */
 		if ((res != ANALOG_EVENT_RINGEROFF) && (res != ANALOG_EVENT_RINGERON) &&
@@ -2835,7 +2819,7 @@
 			analog_set_echocanceller(p, 0);
 			if (p->owner) {
 				ast_verb(3, "Channel %s still has call, ringing phone\n", p->owner->name);
-				analog_ring(p);
+				analog_ioctl_operation(p, ANALOG_SUB_REAL, ANALOG_RING);
 				analog_stop_callwait(p);
 			} else
 				ast_log(LOG_WARNING, "Absorbed on hook, but nobody is left!?!?\n");

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=206086&r1=206085&r2=206086
==============================================================================
--- team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h (original)
+++ team/jpeeler/asterisk-sigwork-trunk/channels/sig_analog.h Sun Jul 12 16:40:07 2009
@@ -133,17 +133,10 @@
 	 * (CWCID) the library absorbs DTMF events received. */
 	void (* const handle_dtmfup)(void *pvt, struct ast_channel *ast, enum analog_sub analog_index, struct ast_frame **dest);
 
-	int (* const get_event)(void *pvt);
 	int (* const wait_event)(void *pvt);
 	int (* const is_off_hook)(void *pvt);
 	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);
-	int (* const ring)(void *pvt);
 	int (* const flash)(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);
 	int (* const dial_digits)(void *pvt, enum analog_sub sub, struct analog_dialoperation *dop);
 	int (* const send_fsk)(void *pvt, struct ast_channel *ast, char *fsk);
 	int (* const play_tone)(void *pvt, enum analog_sub sub, enum analog_tone tone);




More information about the asterisk-commits mailing list