wtf
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@259 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
ca93ff3fcc
commit
8d50ec5b9c
|
@ -355,17 +355,15 @@ static unsigned wp_open_range(zap_span_t *span, unsigned spanno, unsigned start,
|
|||
wanpipe_tdm_api_t tdm_api;
|
||||
|
||||
tdm_api.wp_tdm_cmd.cmd = SIOC_WP_TDM_SET_EVENT;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_type = WP_TDMAPI_EVENT_RXHOOK;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_type = WP_TDMAPI_EVENT_RING_DETECT;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_mode = WP_TDMAPI_EVENT_ENABLE;
|
||||
wp_tdm_cmd_exec(chan, &tdm_api);
|
||||
#if 0
|
||||
tdm_api.wp_tdm_cmd.cmd=SIOC_WP_TDM_SET_EVENT;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_type = WP_TDMAPI_EVENT_TXSIG_KEWL;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_mode = WP_TDMAPI_EVENT_ENABLE;
|
||||
wp_tdm_cmd_exec(chan, &tdm_api);
|
||||
#if 0
|
||||
if (type == ZAP_CHAN_TYPE_FXS) {
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_type = WP_TDMAPI_EVENT_RING;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_mode = WP_TDMAPI_EVENT_ENABLE;
|
||||
wp_tdm_cmd_exec(chan, &tdm_api);
|
||||
}
|
||||
#endif
|
||||
|
||||
tdm_api.wp_tdm_cmd.cmd = SIOC_WP_TDM_GET_HW_CODING;
|
||||
wp_tdm_cmd_exec(chan, &tdm_api);
|
||||
if (tdm_api.wp_tdm_cmd.hw_tdm_coding) {
|
||||
|
@ -526,10 +524,58 @@ static ZIO_COMMAND_FUNCTION(wanpipe_command)
|
|||
memset(&tdm_api, 0, sizeof(tdm_api));
|
||||
|
||||
switch(command) {
|
||||
case ZAP_COMMAND_OFFHOOK:
|
||||
{
|
||||
tdm_api.wp_tdm_cmd.cmd=SIOC_WP_TDM_SET_EVENT;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_type = WP_TDMAPI_EVENT_TXSIG_OFFHOOK;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_mode = WP_TDMAPI_EVENT_ENABLE;
|
||||
if ((err = wp_tdm_cmd_exec(zchan, &tdm_api))) {
|
||||
snprintf(zchan->last_error, sizeof(zchan->last_error), "OFFHOOK Failed");
|
||||
return ZAP_FAIL;
|
||||
}
|
||||
zap_set_flag_locked(zchan, ZAP_CHANNEL_OFFHOOK);
|
||||
}
|
||||
break;
|
||||
case ZAP_COMMAND_ONHOOK:
|
||||
{
|
||||
tdm_api.wp_tdm_cmd.cmd=SIOC_WP_TDM_SET_EVENT;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_type = WP_TDMAPI_EVENT_TXSIG_OFFHOOK;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_mode=WP_TDMAPI_EVENT_DISABLE;
|
||||
if ((err = wp_tdm_cmd_exec(zchan, &tdm_api))) {
|
||||
snprintf(zchan->last_error, sizeof(zchan->last_error), "ONHOOK Failed");
|
||||
return ZAP_FAIL;
|
||||
}
|
||||
zap_clear_flag_locked(zchan, ZAP_CHANNEL_OFFHOOK);
|
||||
}
|
||||
break;
|
||||
case ZAP_COMMAND_GENERATE_RING_ON:
|
||||
{
|
||||
tdm_api.wp_tdm_cmd.cmd=SIOC_WP_TDM_SET_EVENT;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_type = WP_TDMAPI_EVENT_RING;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_mode = WP_TDMAPI_EVENT_ENABLE;
|
||||
if ((err = wp_tdm_cmd_exec(zchan, &tdm_api))) {
|
||||
snprintf(zchan->last_error, sizeof(zchan->last_error), "Ring Failed");
|
||||
return ZAP_FAIL;
|
||||
}
|
||||
zap_set_flag_locked(zchan, ZAP_CHANNEL_RINGING);
|
||||
}
|
||||
break;
|
||||
case ZAP_COMMAND_GENERATE_RING_OFF:
|
||||
{
|
||||
tdm_api.wp_tdm_cmd.cmd=SIOC_WP_TDM_SET_EVENT;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_type = WP_TDMAPI_EVENT_RING;
|
||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_mode=WP_TDMAPI_EVENT_ENABLE;
|
||||
if ((err = wp_tdm_cmd_exec(zchan, &tdm_api))) {
|
||||
snprintf(zchan->last_error, sizeof(zchan->last_error), "Ring-off Failed");
|
||||
return ZAP_FAIL;
|
||||
}
|
||||
zap_clear_flag_locked(zchan, ZAP_CHANNEL_RINGING);
|
||||
}
|
||||
break;
|
||||
case ZAP_COMMAND_GET_INTERVAL:
|
||||
{
|
||||
tdm_api.wp_tdm_cmd.cmd = SIOC_WP_TDM_GET_USR_PERIOD;
|
||||
|
||||
|
||||
if (!(err = wp_tdm_cmd_exec(zchan, &tdm_api))) {
|
||||
ZAP_COMMAND_OBJ_INT = tdm_api.wp_tdm_cmd.usr_period;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue