[Asterisk-cvs] asterisk/channels chan_phone.c,1.7,1.8
markster at lists.digium.com
markster at lists.digium.com
Tue Sep 16 23:38:15 CDT 2003
Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv30337/channels
Modified Files:
chan_phone.c
Log Message:
DTMF enhancements
Index: chan_phone.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_phone.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- chan_phone.c 16 Aug 2003 05:10:35 -0000 1.7
+++ chan_phone.c 17 Sep 2003 04:39:22 -0000 1.8
@@ -110,6 +110,7 @@
struct phone_pvt *p;
int outdigit;
p = ast->pvt->pvt;
+ ast_log(LOG_NOTICE, "Dialed %c\n", digit);
switch(digit) {
case '0':
case '1':
@@ -121,7 +122,7 @@
case '7':
case '8':
case '9':
- outdigit = digit - '0' + 1;
+ outdigit = digit - '0';
break;
case '*':
outdigit = 11;
@@ -129,11 +130,19 @@
case '#':
outdigit = 12;
break;
+ case 'f': //flash
+ case 'F':
+ 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;
+ return 0;
default:
ast_log(LOG_WARNING, "Unknown digit '%c'\n", digit);
return -1;
}
- ioctl(p->fd, PHONE_PLAY_TONE, digit);
+ ast_log(LOG_NOTICE, "Dialed %i\n", outdigit);
+ ioctl(p->fd, PHONE_PLAY_TONE, outdigit);
p->lastformat = -1;
return 0;
}
@@ -277,6 +286,9 @@
ast_log(LOG_WARNING, "Failed to start recording\n");
return -1;
}
+ //set the DTMF times (the default is too short)
+ ioctl(p->fd, PHONE_SET_TONE_ON_TIME, 300);
+ ioctl(p->fd, PHONE_SET_TONE_OFF_TIME, 200);
return 0;
}
More information about the svn-commits
mailing list