[svn-commits] trunk - r7947 /trunk/channels/chan_phone.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Jan 10 15:34:04 CST 2006


Author: mattf
Date: Tue Jan 10 15:34:04 2006
New Revision: 7947

URL: http://svn.digium.com/view/asterisk?rev=7947&view=rev
Log:
Update chan_phone to indicate FLASH properley (#4935)

Modified:
    trunk/channels/chan_phone.c

Modified: trunk/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_phone.c?rev=7947&r1=7946&r2=7947&view=diff
==============================================================================
--- trunk/channels/chan_phone.c (original)
+++ trunk/channels/chan_phone.c Tue Jan 10 15:34:04 2006
@@ -160,6 +160,7 @@
 static struct ast_frame *phone_exception(struct ast_channel *ast);
 static int phone_send_text(struct ast_channel *ast, const char *text);
 static int phone_fixup(struct ast_channel *old, struct ast_channel *new);
+static int phone_indicate(struct ast_channel *chan, int condition);
 
 static const struct ast_channel_tech phone_tech = {
 	.type = type,
@@ -173,6 +174,7 @@
 	.read = phone_read,
 	.write = phone_write,
 	.exception = phone_exception,
+	.indicate = phone_indicate,
 	.fixup = phone_fixup
 };
 
@@ -189,10 +191,30 @@
 	.exception = phone_exception,
 	.write_video = phone_write,
 	.send_text = phone_send_text,
+	.indicate = phone_indicate,
 	.fixup = phone_fixup
 };
 
 static struct ast_channel_tech *cur_tech;
+
+static int phone_indicate(struct ast_channel *chan, int condition)
+{
+	struct phone_pvt *p = chan->tech_pvt;
+	int res=-1;
+	ast_log(LOG_DEBUG, "Requested indication %d on channel %s\n", condition, chan->name);
+	switch(condition) {
+		case AST_CONTROL_FLASH:
+			ioctl(p->fd, IXJCTL_PSTN_SET_STATE, PSTN_ON_HOOK);
+			usleep(320000);
+			ioctl(p->fd, IXJCTL_PSTN_SET_STATE, PSTN_OFF_HOOK);
+			p->lastformat = -1;
+			res = 0;
+			break;
+		default:
+			ast_log(LOG_WARNING, "Condition %d is not supported on channel %s\n", condition, chan->name);
+	}
+	return res;
+}
 
 static int phone_fixup(struct ast_channel *old, struct ast_channel *new)
 {



More information about the svn-commits mailing list