/*!
\brief Hangup a channel flagging it's state machine to end
\param channel channel to hangup
- \return SWITCH_STATUS_SUCCESS if channel state was set to hangup
+ \return the resulting channel state.
*/
-SWITCH_DECLARE(switch_status) switch_channel_hangup(switch_channel *channel);
+SWITCH_DECLARE(switch_channel_state) switch_channel_hangup(switch_channel *channel);
/*!
\brief Test for presence of DTMF on a given channel
pri_sr_free(sr);
return SWITCH_STATUS_GENERR;
}
- if ((tech_pvt->socket = sangoma_create_socket_intr(spri->span, channo)) < 0) {
+
+ if ((tech_pvt->socket = sangoma_open_tdmapi_span_chan(spri->span, channo)) < 0) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Can't open fd!\n");
switch_core_session_destroy(new_session);
pri_sr_free(sr);
memset(tech_pvt, 0, sizeof(*tech_pvt));
channel = switch_core_session_get_channel(session);
switch_core_session_set_private(session, tech_pvt);
- sprintf(name, "w%dg%d", spri->span, event->ring.channel);
+ sprintf(name, "s%dc%d", spri->span, event->ring.channel);
switch_channel_set_name(channel, name);
} else {
tech_pvt->callno = event->ring.channel;
tech_pvt->span = spri->span;
- if ((fd = sangoma_create_socket_intr(spri->span, event->ring.channel)) < 0) {
+ if ((fd = sangoma_open_tdmapi_span_chan(spri->span, event->ring.channel)) < 0) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Can't open fd!\n");
}
//sangoma_tdm_set_hw_period(fd, &tdm_api, 480);
switch_channel_hangup(channel);
}
- if ((fd = sangoma_create_socket_intr(spri->span, event->restart.channel)) < 0) {
+ if ((fd = sangoma_open_tdmapi_span_chan(spri->span, event->restart.channel)) < 0) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Can't open fd [%s]!\n", strerror(errno));
} else {
close(fd);
other_audio_thread.objs[0] = session;
other_audio_thread.objs[1] = peer_session;
other_audio_thread.objs[2] = &stream_id;
- other_audio_thread.objs[3] = dtmf_callback;
+ other_audio_thread.objs[3] = (void *) dtmf_callback;
other_audio_thread.objs[4] = session_data;
other_audio_thread.objs[5] = &this_audio_thread.running;
other_audio_thread.running = 5;
this_audio_thread.objs[0] = peer_session;
this_audio_thread.objs[1] = session;
this_audio_thread.objs[2] = &stream_id;
- this_audio_thread.objs[3] = dtmf_callback;
+ this_audio_thread.objs[3] = (void *) dtmf_callback;
this_audio_thread.objs[4] = peer_session_data;
this_audio_thread.objs[5] = &other_audio_thread.running;
this_audio_thread.running = 2;