add wink command patch (still needs more code)

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@614 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale 2008-12-03 16:02:17 +00:00
parent 4291661dab
commit 774372dcea
3 changed files with 11 additions and 4 deletions

View File

@ -262,6 +262,7 @@ typedef enum {
ZAP_COMMAND_OFFHOOK,
ZAP_COMMAND_ONHOOK,
ZAP_COMMAND_FLASH,
ZAP_COMMAND_WINK,
ZAP_COMMAND_ENABLE_PROGRESS_DETECT,
ZAP_COMMAND_DISABLE_PROGRESS_DETECT,
ZAP_COMMAND_TRACE_INPUT,

View File

@ -360,10 +360,7 @@ static void *zap_analog_em_channel_run(zap_thread_t *me, void *obj)
teletone_run(&ts, zchan->span->tone_map[ZAP_TONEMAP_DIAL]);
indicate = 1;
zap_sleep(25);
zap_channel_command(zchan, ZAP_COMMAND_OFFHOOK, NULL);
zap_sleep(200);
zap_channel_command(zchan, ZAP_COMMAND_ONHOOK, NULL);
zap_channel_command(zchan, ZAP_COMMAND_WINK, NULL);
}
break;
case ZAP_CHANNEL_STATE_RING:

View File

@ -452,6 +452,15 @@ static ZIO_COMMAND_FUNCTION(zt_command)
}
}
break;
case ZAP_COMMAND_WINK:
{
int command = ZT_WINK;
if (ioctl(zchan->sockfd, ZT_HOOK, &command)) {
snprintf(zchan->last_error, sizeof(zchan->last_error), "WINK Failed");
return ZAP_FAIL;
}
}
break;
case ZAP_COMMAND_GENERATE_RING_ON:
{
int command = ZT_RING;