mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-05 02:34:18 +00:00
wtf
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@259 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
9a94699be8
commit
3234f987d6
@ -355,17 +355,15 @@ static unsigned wp_open_range(zap_span_t *span, unsigned spanno, unsigned start,
|
|||||||
wanpipe_tdm_api_t tdm_api;
|
wanpipe_tdm_api_t tdm_api;
|
||||||
|
|
||||||
tdm_api.wp_tdm_cmd.cmd = SIOC_WP_TDM_SET_EVENT;
|
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;
|
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_mode = WP_TDMAPI_EVENT_ENABLE;
|
||||||
wp_tdm_cmd_exec(chan, &tdm_api);
|
wp_tdm_cmd_exec(chan, &tdm_api);
|
||||||
#if 0
|
#if 0
|
||||||
if (type == ZAP_CHAN_TYPE_FXS) {
|
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_type = WP_TDMAPI_EVENT_TXSIG_KEWL;
|
||||||
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_mode = WP_TDMAPI_EVENT_ENABLE;
|
tdm_api.wp_tdm_cmd.event.wp_tdm_api_event_mode = WP_TDMAPI_EVENT_ENABLE;
|
||||||
wp_tdm_cmd_exec(chan, &tdm_api);
|
wp_tdm_cmd_exec(chan, &tdm_api);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tdm_api.wp_tdm_cmd.cmd = SIOC_WP_TDM_GET_HW_CODING;
|
tdm_api.wp_tdm_cmd.cmd = SIOC_WP_TDM_GET_HW_CODING;
|
||||||
wp_tdm_cmd_exec(chan, &tdm_api);
|
wp_tdm_cmd_exec(chan, &tdm_api);
|
||||||
if (tdm_api.wp_tdm_cmd.hw_tdm_coding) {
|
if (tdm_api.wp_tdm_cmd.hw_tdm_coding) {
|
||||||
@ -526,6 +524,54 @@ static ZIO_COMMAND_FUNCTION(wanpipe_command)
|
|||||||
memset(&tdm_api, 0, sizeof(tdm_api));
|
memset(&tdm_api, 0, sizeof(tdm_api));
|
||||||
|
|
||||||
switch(command) {
|
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:
|
case ZAP_COMMAND_GET_INTERVAL:
|
||||||
{
|
{
|
||||||
tdm_api.wp_tdm_cmd.cmd = SIOC_WP_TDM_GET_USR_PERIOD;
|
tdm_api.wp_tdm_cmd.cmd = SIOC_WP_TDM_GET_USR_PERIOD;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user