switch_endpoint_interface_t *openzap_endpoint_interface;
static switch_memory_pool_t *module_pool = NULL;
-static int running = 1;
struct span_config {
zap_span_t *span;
};
-static struct span_config SPAN_CONFIG[ZAP_MAX_SPANS_INTERFACE] = {0};
+static struct span_config SPAN_CONFIG[ZAP_MAX_SPANS_INTERFACE] = {{0}};
typedef enum {
TFLAG_IO = (1 << 0),
static switch_status_t channel_on_transmit(switch_core_session_t *session);
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
- switch_core_session_t **new_session, switch_memory_pool_t **pool);
+ switch_core_session_t **new_session,
+ switch_memory_pool_t **pool,
+ switch_originate_flag_t flags);
static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout, switch_io_flag_t flags, int stream_id);
static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout, switch_io_flag_t flags, int stream_id);
static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
dname = "L16";
}
break;
+ default:
+ abort();
}
*/
static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *session,
switch_caller_profile_t *outbound_profile,
- switch_core_session_t **new_session, switch_memory_pool_t **pool)
+ switch_core_session_t **new_session, switch_memory_pool_t **pool,
+ switch_originate_flag_t flags)
{
char *p, *dest = NULL;
zap_channel_clear_token(sigmsg->channel, 0);
channel = switch_core_session_get_channel(session);
switch_channel_hangup(channel, sigmsg->channel->caller_data.hangup_cause);
+ zap_channel_clear_token(sigmsg->channel, switch_core_session_get_uuid(session));
switch_core_session_rwunlock(session);
}
}
}
}
break;
+
+ default:
+ {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unhandled type for channel %d:%d\n",
+ sigmsg->channel->span_id, sigmsg->channel->chan_id);
+ }
+ break;
+
}
return ZAP_SUCCESS;
case ZAP_SIGEVENT_STOP:
{
while((session = zap_channel_get_session(sigmsg->channel, 0))) {
- zap_channel_clear_token(sigmsg->channel, 0);
channel = switch_core_session_get_channel(session);
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
+ zap_channel_clear_token(sigmsg->channel, switch_core_session_get_uuid(session));
switch_core_session_rwunlock(session);
}
}
}
break;
+
+ default:
+ {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unhandled type for channel %d:%d\n",
+ sigmsg->channel->span_id, sigmsg->channel->chan_id);
+ }
+ break;
+
}
return status;
case ZAP_SIGEVENT_STOP:
{
while((session = zap_channel_get_session(sigmsg->channel, 0))) {
- zap_channel_clear_token(sigmsg->channel, 0);
channel = switch_core_session_get_channel(session);
switch_channel_hangup(channel, sigmsg->channel->caller_data.hangup_cause);
+ zap_channel_clear_token(sigmsg->channel, switch_core_session_get_uuid(session));
switch_core_session_rwunlock(session);
}
}
}
}
break;
+
+ default:
+ {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Unhandled type for channel %d:%d\n",
+ sigmsg->channel->span_id, sigmsg->channel->chan_id);
+ }
+ break;
}
return ZAP_SUCCESS;
static ZIO_SIGNAL_CB_FUNCTION(on_analog_signal)
{
- switch_status_t status;
+ switch_status_t status = SWITCH_STATUS_FALSE;
switch (sigmsg->channel->type) {
case ZAP_CHAN_TYPE_FXO: