added span signaling status APIs
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@947 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
5ff8716e8e
commit
5aa9ff86a8
|
@ -568,7 +568,10 @@ struct zap_span {
|
||||||
teletone_multi_tone_t tone_finder[ZAP_TONEMAP_INVALID+1];
|
teletone_multi_tone_t tone_finder[ZAP_TONEMAP_INVALID+1];
|
||||||
zap_channel_t *channels[ZAP_MAX_CHANNELS_SPAN+1];
|
zap_channel_t *channels[ZAP_MAX_CHANNELS_SPAN+1];
|
||||||
zio_channel_outgoing_call_t outgoing_call;
|
zio_channel_outgoing_call_t outgoing_call;
|
||||||
zio_channel_get_sig_status_t get_sig_status;
|
zio_channel_set_sig_status_t set_channel_sig_status;
|
||||||
|
zio_channel_get_sig_status_t get_channel_sig_status;
|
||||||
|
zio_span_set_sig_status_t set_span_sig_status;
|
||||||
|
zio_span_get_sig_status_t get_span_sig_status;
|
||||||
zio_channel_request_t channel_request;
|
zio_channel_request_t channel_request;
|
||||||
zap_span_start_t start;
|
zap_span_start_t start;
|
||||||
zap_span_stop_t stop;
|
zap_span_stop_t stop;
|
||||||
|
@ -697,7 +700,10 @@ OZ_DECLARE(zap_status_t) zap_fsk_data_add_mdmf(zap_fsk_data_state_t *state, zap_
|
||||||
OZ_DECLARE(zap_status_t) zap_fsk_data_add_checksum(zap_fsk_data_state_t *state);
|
OZ_DECLARE(zap_status_t) zap_fsk_data_add_checksum(zap_fsk_data_state_t *state);
|
||||||
OZ_DECLARE(zap_status_t) zap_fsk_data_add_sdmf(zap_fsk_data_state_t *state, const char *date, char *number);
|
OZ_DECLARE(zap_status_t) zap_fsk_data_add_sdmf(zap_fsk_data_state_t *state, const char *date, char *number);
|
||||||
OZ_DECLARE(zap_status_t) zap_channel_outgoing_call(zap_channel_t *zchan);
|
OZ_DECLARE(zap_status_t) zap_channel_outgoing_call(zap_channel_t *zchan);
|
||||||
OZ_DECLARE(zap_status_t) zap_channel_get_sig_status(zap_channel_t *zchan, zap_channel_sig_status_t *status);
|
OZ_DECLARE(zap_status_t) zap_channel_set_sig_status(zap_channel_t *zchan, zap_signaling_status_t status);
|
||||||
|
OZ_DECLARE(zap_status_t) zap_channel_get_sig_status(zap_channel_t *zchan, zap_signaling_status_t *status);
|
||||||
|
OZ_DECLARE(zap_status_t) zap_span_set_sig_status(zap_span_t *span, zap_signaling_status_t status);
|
||||||
|
OZ_DECLARE(zap_status_t) zap_span_get_sig_status(zap_span_t *span, zap_signaling_status_t *status);
|
||||||
OZ_DECLARE(void) zap_channel_rotate_tokens(zap_channel_t *zchan);
|
OZ_DECLARE(void) zap_channel_rotate_tokens(zap_channel_t *zchan);
|
||||||
OZ_DECLARE(void) zap_channel_clear_detected_tones(zap_channel_t *zchan);
|
OZ_DECLARE(void) zap_channel_clear_detected_tones(zap_channel_t *zchan);
|
||||||
OZ_DECLARE(void) zap_channel_clear_needed_tones(zap_channel_t *zchan);
|
OZ_DECLARE(void) zap_channel_clear_needed_tones(zap_channel_t *zchan);
|
||||||
|
|
|
@ -187,20 +187,20 @@ typedef enum {
|
||||||
} zap_signal_type_t;
|
} zap_signal_type_t;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Signaling status on the channel
|
\brief Signaling status on a given span or specific channel on protocols that support it
|
||||||
*/
|
*/
|
||||||
typedef enum {
|
typedef enum {
|
||||||
/* The channel signaling link is down (no d-chans up in the span/group, MFC-R2 bit pattern unidentified) */
|
/* The signaling link is down (no d-chans up in the span/group, MFC-R2 bit pattern unidentified) */
|
||||||
ZAP_SIG_STATE_DOWN,
|
ZAP_SIG_STATE_DOWN,
|
||||||
/* The channel signaling link is suspended (MFC-R2 bit pattern blocked, ss7 blocked?) */
|
/* The signaling link is suspended (MFC-R2 bit pattern blocked, ss7 blocked?) */
|
||||||
ZAP_SIG_STATE_SUSPENDED,
|
ZAP_SIG_STATE_SUSPENDED,
|
||||||
/* The channel signaling link is ready and calls can be placed */
|
/* The signaling link is ready and calls can be placed */
|
||||||
ZAP_SIG_STATE_UP,
|
ZAP_SIG_STATE_UP,
|
||||||
/* Invalid status */
|
/* Invalid status */
|
||||||
ZAP_SIG_STATE_INVALID
|
ZAP_SIG_STATE_INVALID
|
||||||
} zap_channel_sig_status_t;
|
} zap_signaling_status_t;
|
||||||
#define SIGSTATUS_STRINGS "DOWN", "SUSPENDED", "UP", "INVALID"
|
#define SIGSTATUS_STRINGS "DOWN", "SUSPENDED", "UP", "INVALID"
|
||||||
ZAP_STR2ENUM_P(zap_str2zap_channel_sig_status, zap_sig_status2str, zap_channel_sig_status_t)
|
ZAP_STR2ENUM_P(zap_str2zap_signaling_status, zap_signaling_status2str, zap_signaling_status_t)
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ZAP_SIGEVENT_START,
|
ZAP_SIGEVENT_START,
|
||||||
|
@ -470,7 +470,10 @@ typedef zap_status_t (*zap_stream_handle_write_function_t) (zap_stream_handle_t
|
||||||
|
|
||||||
#define ZIO_CHANNEL_REQUEST_ARGS (zap_span_t *span, uint32_t chan_id, zap_direction_t direction, zap_caller_data_t *caller_data, zap_channel_t **zchan)
|
#define ZIO_CHANNEL_REQUEST_ARGS (zap_span_t *span, uint32_t chan_id, zap_direction_t direction, zap_caller_data_t *caller_data, zap_channel_t **zchan)
|
||||||
#define ZIO_CHANNEL_OUTGOING_CALL_ARGS (zap_channel_t *zchan)
|
#define ZIO_CHANNEL_OUTGOING_CALL_ARGS (zap_channel_t *zchan)
|
||||||
#define ZIO_CHANNEL_GET_SIG_STATUS_ARGS (zap_channel_t *zchan, zap_channel_sig_status_t *status)
|
#define ZIO_CHANNEL_SET_SIG_STATUS_ARGS (zap_channel_t *zchan, zap_signaling_status_t status)
|
||||||
|
#define ZIO_CHANNEL_GET_SIG_STATUS_ARGS (zap_channel_t *zchan, zap_signaling_status_t *status)
|
||||||
|
#define ZIO_SPAN_SET_SIG_STATUS_ARGS (zap_span_t *span, zap_signaling_status_t status)
|
||||||
|
#define ZIO_SPAN_GET_SIG_STATUS_ARGS (zap_span_t *span, zap_signaling_status_t *status)
|
||||||
#define ZIO_SPAN_POLL_EVENT_ARGS (zap_span_t *span, uint32_t ms)
|
#define ZIO_SPAN_POLL_EVENT_ARGS (zap_span_t *span, uint32_t ms)
|
||||||
#define ZIO_SPAN_NEXT_EVENT_ARGS (zap_span_t *span, zap_event_t **event)
|
#define ZIO_SPAN_NEXT_EVENT_ARGS (zap_span_t *span, zap_event_t **event)
|
||||||
#define ZIO_SIGNAL_CB_ARGS (zap_sigmsg_t *sigmsg)
|
#define ZIO_SIGNAL_CB_ARGS (zap_sigmsg_t *sigmsg)
|
||||||
|
@ -497,7 +500,10 @@ typedef zap_status_t (*zap_stream_handle_write_function_t) (zap_stream_handle_t
|
||||||
|
|
||||||
typedef zap_status_t (*zio_channel_request_t) ZIO_CHANNEL_REQUEST_ARGS ;
|
typedef zap_status_t (*zio_channel_request_t) ZIO_CHANNEL_REQUEST_ARGS ;
|
||||||
typedef zap_status_t (*zio_channel_outgoing_call_t) ZIO_CHANNEL_OUTGOING_CALL_ARGS ;
|
typedef zap_status_t (*zio_channel_outgoing_call_t) ZIO_CHANNEL_OUTGOING_CALL_ARGS ;
|
||||||
|
typedef zap_status_t (*zio_channel_set_sig_status_t) ZIO_CHANNEL_SET_SIG_STATUS_ARGS;
|
||||||
typedef zap_status_t (*zio_channel_get_sig_status_t) ZIO_CHANNEL_GET_SIG_STATUS_ARGS;
|
typedef zap_status_t (*zio_channel_get_sig_status_t) ZIO_CHANNEL_GET_SIG_STATUS_ARGS;
|
||||||
|
typedef zap_status_t (*zio_span_set_sig_status_t) ZIO_SPAN_SET_SIG_STATUS_ARGS;
|
||||||
|
typedef zap_status_t (*zio_span_get_sig_status_t) ZIO_SPAN_GET_SIG_STATUS_ARGS;
|
||||||
typedef zap_status_t (*zio_span_poll_event_t) ZIO_SPAN_POLL_EVENT_ARGS ;
|
typedef zap_status_t (*zio_span_poll_event_t) ZIO_SPAN_POLL_EVENT_ARGS ;
|
||||||
typedef zap_status_t (*zio_span_next_event_t) ZIO_SPAN_NEXT_EVENT_ARGS ;
|
typedef zap_status_t (*zio_span_next_event_t) ZIO_SPAN_NEXT_EVENT_ARGS ;
|
||||||
typedef zap_status_t (*zio_signal_cb_t) ZIO_SIGNAL_CB_ARGS ;
|
typedef zap_status_t (*zio_signal_cb_t) ZIO_SIGNAL_CB_ARGS ;
|
||||||
|
@ -525,7 +531,10 @@ typedef zap_status_t (*zio_api_t) ZIO_API_ARGS ;
|
||||||
|
|
||||||
#define ZIO_CHANNEL_REQUEST_FUNCTION(name) zap_status_t name ZIO_CHANNEL_REQUEST_ARGS
|
#define ZIO_CHANNEL_REQUEST_FUNCTION(name) zap_status_t name ZIO_CHANNEL_REQUEST_ARGS
|
||||||
#define ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(name) zap_status_t name ZIO_CHANNEL_OUTGOING_CALL_ARGS
|
#define ZIO_CHANNEL_OUTGOING_CALL_FUNCTION(name) zap_status_t name ZIO_CHANNEL_OUTGOING_CALL_ARGS
|
||||||
|
#define ZIO_CHANNEL_SET_SIG_STATUS_FUNCTION(name) zap_status_t name ZIO_CHANNEL_SET_SIG_STATUS_ARGS
|
||||||
#define ZIO_CHANNEL_GET_SIG_STATUS_FUNCTION(name) zap_status_t name ZIO_CHANNEL_GET_SIG_STATUS_ARGS
|
#define ZIO_CHANNEL_GET_SIG_STATUS_FUNCTION(name) zap_status_t name ZIO_CHANNEL_GET_SIG_STATUS_ARGS
|
||||||
|
#define ZIO_SPAN_SET_SIG_STATUS_FUNCTION(name) zap_status_t name ZIO_SPAN_SET_SIG_STATUS_ARGS
|
||||||
|
#define ZIO_SPAN_GET_SIG_STATUS_FUNCTION(name) zap_status_t name ZIO_SPAN_GET_SIG_STATUS_ARGS
|
||||||
#define ZIO_SPAN_POLL_EVENT_FUNCTION(name) zap_status_t name ZIO_SPAN_POLL_EVENT_ARGS
|
#define ZIO_SPAN_POLL_EVENT_FUNCTION(name) zap_status_t name ZIO_SPAN_POLL_EVENT_ARGS
|
||||||
#define ZIO_SPAN_NEXT_EVENT_FUNCTION(name) zap_status_t name ZIO_SPAN_NEXT_EVENT_ARGS
|
#define ZIO_SPAN_NEXT_EVENT_FUNCTION(name) zap_status_t name ZIO_SPAN_NEXT_EVENT_ARGS
|
||||||
#define ZIO_SIGNAL_CB_FUNCTION(name) zap_status_t name ZIO_SIGNAL_CB_ARGS
|
#define ZIO_SIGNAL_CB_FUNCTION(name) zap_status_t name ZIO_SIGNAL_CB_ARGS
|
||||||
|
|
|
@ -1770,7 +1770,7 @@ static BOOST_SIG_STATUS_CB_FUNCTION(zap_boost_sig_status_change)
|
||||||
{
|
{
|
||||||
zap_sigmsg_t sig;
|
zap_sigmsg_t sig;
|
||||||
zap_sangoma_boost_data_t *sangoma_boost_data = zchan->span->signal_data;
|
zap_sangoma_boost_data_t *sangoma_boost_data = zchan->span->signal_data;
|
||||||
zap_log(ZAP_LOG_DEBUG, "%d:%d Signaling link status changed to %s\n", zchan->span_id, zchan->chan_id, zap_sig_status2str(status));
|
zap_log(ZAP_LOG_NOTICE, "%d:%d Signaling link status changed to %s\n", zchan->span_id, zchan->chan_id, zap_signaling_status2str(status));
|
||||||
|
|
||||||
memset(&sig, 0, sizeof(sig));
|
memset(&sig, 0, sizeof(sig));
|
||||||
sig.chan_id = zchan->chan_id;
|
sig.chan_id = zchan->chan_id;
|
||||||
|
@ -1782,14 +1782,60 @@ static BOOST_SIG_STATUS_CB_FUNCTION(zap_boost_sig_status_change)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ZIO_CHANNEL_GET_SIG_STATUS_FUNCTION(sangoma_boost_get_sig_status)
|
static ZIO_CHANNEL_SET_SIG_STATUS_FUNCTION(sangoma_boost_set_channel_sig_status)
|
||||||
|
{
|
||||||
|
zap_sangoma_boost_data_t *sangoma_boost_data = zchan->span->signal_data;
|
||||||
|
if (!sangoma_boost_data->sigmod) {
|
||||||
|
zap_log(ZAP_LOG_ERROR, "Cannot set signaling status in boost channel with no signaling module configured\n");
|
||||||
|
return ZAP_FAIL;
|
||||||
|
}
|
||||||
|
if (!sangoma_boost_data->sigmod->set_channel_sig_status) {
|
||||||
|
zap_log(ZAP_LOG_ERROR, "Cannot set signaling status in boost channel: method not implemented\n");
|
||||||
|
return ZAP_NOTIMPL;
|
||||||
|
}
|
||||||
|
return sangoma_boost_data->sigmod->set_channel_sig_status(zchan, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ZIO_CHANNEL_GET_SIG_STATUS_FUNCTION(sangoma_boost_get_channel_sig_status)
|
||||||
{
|
{
|
||||||
zap_sangoma_boost_data_t *sangoma_boost_data = zchan->span->signal_data;
|
zap_sangoma_boost_data_t *sangoma_boost_data = zchan->span->signal_data;
|
||||||
if (!sangoma_boost_data->sigmod) {
|
if (!sangoma_boost_data->sigmod) {
|
||||||
zap_log(ZAP_LOG_ERROR, "Cannot get signaling status in boost channel with no signaling module configured\n");
|
zap_log(ZAP_LOG_ERROR, "Cannot get signaling status in boost channel with no signaling module configured\n");
|
||||||
return ZAP_FAIL;
|
return ZAP_FAIL;
|
||||||
}
|
}
|
||||||
return sangoma_boost_data->sigmod->get_sig_status(zchan, status);
|
if (!sangoma_boost_data->sigmod->get_channel_sig_status) {
|
||||||
|
zap_log(ZAP_LOG_ERROR, "Cannot get signaling status in boost channel: method not implemented\n");
|
||||||
|
return ZAP_NOTIMPL;
|
||||||
|
}
|
||||||
|
return sangoma_boost_data->sigmod->get_channel_sig_status(zchan, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ZIO_SPAN_SET_SIG_STATUS_FUNCTION(sangoma_boost_set_span_sig_status)
|
||||||
|
{
|
||||||
|
zap_sangoma_boost_data_t *sangoma_boost_data = span->signal_data;
|
||||||
|
if (!sangoma_boost_data->sigmod) {
|
||||||
|
zap_log(ZAP_LOG_ERROR, "Cannot set signaling status in boost span with no signaling module configured\n");
|
||||||
|
return ZAP_FAIL;
|
||||||
|
}
|
||||||
|
if (!sangoma_boost_data->sigmod->set_span_sig_status) {
|
||||||
|
zap_log(ZAP_LOG_ERROR, "Cannot set signaling status in boost span: method not implemented\n");
|
||||||
|
return ZAP_NOTIMPL;
|
||||||
|
}
|
||||||
|
return sangoma_boost_data->sigmod->set_span_sig_status(span, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ZIO_SPAN_GET_SIG_STATUS_FUNCTION(sangoma_boost_get_span_sig_status)
|
||||||
|
{
|
||||||
|
zap_sangoma_boost_data_t *sangoma_boost_data = span->signal_data;
|
||||||
|
if (!sangoma_boost_data->sigmod) {
|
||||||
|
zap_log(ZAP_LOG_ERROR, "Cannot get signaling status in boost span with no signaling module configured\n");
|
||||||
|
return ZAP_FAIL;
|
||||||
|
}
|
||||||
|
if (!sangoma_boost_data->sigmod->get_span_sig_status) {
|
||||||
|
zap_log(ZAP_LOG_ERROR, "Cannot get signaling status in boost span: method not implemented\n");
|
||||||
|
return ZAP_NOTIMPL;
|
||||||
|
}
|
||||||
|
return sangoma_boost_data->sigmod->get_span_sig_status(span, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1910,7 +1956,10 @@ static ZIO_CONFIGURE_SPAN_SIGNALING_FUNCTION(zap_sangoma_boost_configure_span)
|
||||||
span->signal_type = ZAP_SIGTYPE_SANGOMABOOST;
|
span->signal_type = ZAP_SIGTYPE_SANGOMABOOST;
|
||||||
span->outgoing_call = sangoma_boost_outgoing_call;
|
span->outgoing_call = sangoma_boost_outgoing_call;
|
||||||
span->channel_request = sangoma_boost_channel_request;
|
span->channel_request = sangoma_boost_channel_request;
|
||||||
span->get_sig_status = sangoma_boost_get_sig_status;
|
span->get_channel_sig_status = sangoma_boost_get_channel_sig_status;
|
||||||
|
span->set_channel_sig_status = sangoma_boost_set_channel_sig_status;
|
||||||
|
span->get_span_sig_status = sangoma_boost_get_span_sig_status;
|
||||||
|
span->set_span_sig_status = sangoma_boost_set_span_sig_status;
|
||||||
span->state_map = &boost_state_map;
|
span->state_map = &boost_state_map;
|
||||||
zap_set_flag_locked(span, ZAP_SPAN_SUSPENDED);
|
zap_set_flag_locked(span, ZAP_SPAN_SUSPENDED);
|
||||||
return ZAP_SUCCESS;
|
return ZAP_SUCCESS;
|
||||||
|
|
|
@ -47,7 +47,7 @@ extern "C" {
|
||||||
\param zchan The openzap channel where the signaling status just changed
|
\param zchan The openzap channel where the signaling status just changed
|
||||||
\param status The new signaling status
|
\param status The new signaling status
|
||||||
*/
|
*/
|
||||||
#define BOOST_SIG_STATUS_CB_ARGS (zap_channel_t *zchan, zap_channel_sig_status_t status)
|
#define BOOST_SIG_STATUS_CB_ARGS (zap_channel_t *zchan, zap_signaling_status_t status)
|
||||||
typedef void (*boost_sig_status_cb_func_t) BOOST_SIG_STATUS_CB_ARGS;
|
typedef void (*boost_sig_status_cb_func_t) BOOST_SIG_STATUS_CB_ARGS;
|
||||||
#define BOOST_SIG_STATUS_CB_FUNCTION(name) void name BOOST_SIG_STATUS_CB_ARGS
|
#define BOOST_SIG_STATUS_CB_FUNCTION(name) void name BOOST_SIG_STATUS_CB_ARGS
|
||||||
|
|
||||||
|
@ -78,6 +78,16 @@ typedef zap_status_t (*boost_write_msg_func_t) BOOST_WRITE_MSG_ARGS;
|
||||||
typedef void (*boost_set_write_msg_cb_func_t) BOOST_SET_WRITE_MSG_CB_ARGS;
|
typedef void (*boost_set_write_msg_cb_func_t) BOOST_SET_WRITE_MSG_CB_ARGS;
|
||||||
#define BOOST_SET_WRITE_MSG_CB_FUNCTION(name) void name BOOST_SET_WRITE_MSG_CB_ARGS
|
#define BOOST_SET_WRITE_MSG_CB_FUNCTION(name) void name BOOST_SET_WRITE_MSG_CB_ARGS
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Notify hardware status change
|
||||||
|
\param zchan The openzap channel
|
||||||
|
\param status The hw status
|
||||||
|
\return ZAP_SUCCESS or ZAP_FAIL
|
||||||
|
*/
|
||||||
|
#define BOOST_ON_HW_LINK_STATUS_CHANGE_ARGS (zap_channel_t *zchan, zap_channel_hw_link_status_t status)
|
||||||
|
typedef void (*boost_on_hw_link_status_change_func_t) BOOST_ON_HW_LINK_STATUS_CHANGE_ARGS;
|
||||||
|
#define BOOST_ON_HW_LINK_STATUS_CHANGE_FUNCTION(name) void name BOOST_ON_HW_LINK_STATUS_CHANGE_ARGS
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Set signaling status callback used by the signaling module to report signaling status changes
|
\brief Set signaling status callback used by the signaling module to report signaling status changes
|
||||||
\param callback The callback to be used by the signaling module
|
\param callback The callback to be used by the signaling module
|
||||||
|
@ -89,24 +99,14 @@ typedef void (*boost_set_write_msg_cb_func_t) BOOST_SET_WRITE_MSG_CB_ARGS;
|
||||||
typedef void (*boost_set_sig_status_cb_func_t) BOOST_SET_SIG_STATUS_CB_ARGS;
|
typedef void (*boost_set_sig_status_cb_func_t) BOOST_SET_SIG_STATUS_CB_ARGS;
|
||||||
#define BOOST_SET_SIG_STATUS_CB_FUNCTION(name) void name BOOST_SET_SIG_STATUS_CB_ARGS
|
#define BOOST_SET_SIG_STATUS_CB_FUNCTION(name) void name BOOST_SET_SIG_STATUS_CB_ARGS
|
||||||
|
|
||||||
/*!
|
|
||||||
\brief Notify hardware status change
|
|
||||||
\param zchan The openzap channel
|
|
||||||
\param status The hw status
|
|
||||||
\return ZAP_SUCCESS or ZAP_FAIL
|
|
||||||
*/
|
|
||||||
#define BOOST_GET_SIG_STATUS_ARGS (zap_channel_t *zchan, zap_channel_sig_status_t *status)
|
|
||||||
typedef zap_status_t (*boost_get_sig_status_func_t) BOOST_GET_SIG_STATUS_ARGS;
|
|
||||||
#define BOOST_GET_SIG_STATUS_FUNCTION(name) zap_status_t name BOOST_GET_SIG_STATUS_ARGS
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Get the signaling status on the given channel.
|
\brief Get the signaling status on the given channel.
|
||||||
\param zchan The openzap channel
|
\param zchan The openzap channel
|
||||||
\param status The status pointer where the current signaling status will be set
|
\param status The status pointer where the current signaling status will be set
|
||||||
*/
|
*/
|
||||||
#define BOOST_ON_HW_LINK_STATUS_CHANGE_ARGS (zap_channel_t *zchan, zap_channel_hw_link_status_t status)
|
#define BOOST_GET_CHANNEL_SIG_STATUS_ARGS (zap_channel_t *zchan, zap_signaling_status_t *status)
|
||||||
typedef void (*boost_on_hw_link_status_change_func_t) BOOST_ON_HW_LINK_STATUS_CHANGE_ARGS;
|
typedef zap_status_t (*boost_get_channel_sig_status_func_t) BOOST_GET_CHANNEL_SIG_STATUS_ARGS;
|
||||||
#define BOOST_ON_HW_LINK_STATUS_CHANGE_FUNCTION(name) void name BOOST_ON_HW_LINK_STATUS_CHANGE_ARGS
|
#define BOOST_GET_CHANNEL_SIG_STATUS_FUNCTION(name) zap_status_t name BOOST_GET_CHANNEL_SIG_STATUS_ARGS
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Set the signaling status on the given channel.
|
\brief Set the signaling status on the given channel.
|
||||||
|
@ -114,9 +114,28 @@ typedef void (*boost_on_hw_link_status_change_func_t) BOOST_ON_HW_LINK_STATUS_CH
|
||||||
\param status The new status for the channel
|
\param status The new status for the channel
|
||||||
\return ZAP_SUCCESS or ZAP_FAIL
|
\return ZAP_SUCCESS or ZAP_FAIL
|
||||||
*/
|
*/
|
||||||
#define BOOST_SET_SIG_STATUS_ARGS (zap_channel_t *zchan, zap_channel_sig_status_t status)
|
#define BOOST_SET_CHANNEL_SIG_STATUS_ARGS (zap_channel_t *zchan, zap_signaling_status_t status)
|
||||||
typedef zap_status_t (*boost_set_sig_status_func_t) BOOST_SET_SIG_STATUS_ARGS;
|
typedef zap_status_t (*boost_set_channel_sig_status_func_t) BOOST_SET_CHANNEL_SIG_STATUS_ARGS;
|
||||||
#define BOOST_SET_SIG_STATUS_FUNCTION(name) zap_status_t name BOOST_SET_SIG_STATUS_ARGS
|
#define BOOST_SET_CHANNEL_SIG_STATUS_FUNCTION(name) zap_status_t name BOOST_SET_CHANNEL_SIG_STATUS_ARGS
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Get the signaling status on the given span.
|
||||||
|
\param span The openzap span
|
||||||
|
\param status The status pointer where the current signaling status will be set
|
||||||
|
*/
|
||||||
|
#define BOOST_GET_SPAN_SIG_STATUS_ARGS (zap_span_t *span, zap_signaling_status_t *status)
|
||||||
|
typedef zap_status_t (*boost_get_span_sig_status_func_t) BOOST_GET_SPAN_SIG_STATUS_ARGS;
|
||||||
|
#define BOOST_GET_SPAN_SIG_STATUS_FUNCTION(name) zap_status_t name BOOST_GET_SPAN_SIG_STATUS_ARGS
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Set the signaling status on the given span.
|
||||||
|
\param zchan The openzap span
|
||||||
|
\param status The new status for the span
|
||||||
|
\return ZAP_SUCCESS or ZAP_FAIL
|
||||||
|
*/
|
||||||
|
#define BOOST_SET_SPAN_SIG_STATUS_ARGS (zap_span_t *span, zap_signaling_status_t status)
|
||||||
|
typedef zap_status_t (*boost_set_span_sig_status_func_t) BOOST_SET_SPAN_SIG_STATUS_ARGS;
|
||||||
|
#define BOOST_SET_SPAN_SIG_STATUS_FUNCTION(name) zap_status_t name BOOST_SET_SPAN_SIG_STATUS_ARGS
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Configure the given span signaling
|
\brief Configure the given span signaling
|
||||||
|
@ -174,9 +193,13 @@ typedef struct boost_sigmod_interface_s {
|
||||||
/*! \brief set the user signaling status function */
|
/*! \brief set the user signaling status function */
|
||||||
boost_set_sig_status_cb_func_t set_sig_status_cb;
|
boost_set_sig_status_cb_func_t set_sig_status_cb;
|
||||||
/*! \brief get channel signaling status */
|
/*! \brief get channel signaling status */
|
||||||
boost_get_sig_status_func_t get_sig_status;
|
boost_get_channel_sig_status_func_t get_channel_sig_status;
|
||||||
/*! \brief set channel signaling status */
|
/*! \brief set channel signaling status */
|
||||||
boost_set_sig_status_func_t set_sig_status;
|
boost_set_channel_sig_status_func_t set_channel_sig_status;
|
||||||
|
/*! \brief get span signaling status */
|
||||||
|
boost_get_span_sig_status_func_t get_span_sig_status;
|
||||||
|
/*! \brief set span signaling status */
|
||||||
|
boost_set_span_sig_status_func_t set_span_sig_status;
|
||||||
/*! \brief set notify hardware link status change */
|
/*! \brief set notify hardware link status change */
|
||||||
boost_on_hw_link_status_change_func_t on_hw_link_status_change;
|
boost_on_hw_link_status_change_func_t on_hw_link_status_change;
|
||||||
/*! \brief configure span signaling */
|
/*! \brief configure span signaling */
|
||||||
|
|
|
@ -119,8 +119,8 @@ ZAP_STR2ENUM(zap_str2zap_mdmf_type, zap_mdmf_type2str, zap_mdmf_type_t, MDMF_TYP
|
||||||
ZAP_ENUM_NAMES(CHAN_TYPE_NAMES, CHAN_TYPE_STRINGS)
|
ZAP_ENUM_NAMES(CHAN_TYPE_NAMES, CHAN_TYPE_STRINGS)
|
||||||
ZAP_STR2ENUM(zap_str2zap_chan_type, zap_chan_type2str, zap_chan_type_t, CHAN_TYPE_NAMES, ZAP_CHAN_TYPE_COUNT)
|
ZAP_STR2ENUM(zap_str2zap_chan_type, zap_chan_type2str, zap_chan_type_t, CHAN_TYPE_NAMES, ZAP_CHAN_TYPE_COUNT)
|
||||||
|
|
||||||
ZAP_ENUM_NAMES(CHAN_SIG_STATUS_NAMES, SIGSTATUS_STRINGS)
|
ZAP_ENUM_NAMES(SIGNALING_STATUS_NAMES, SIGSTATUS_STRINGS)
|
||||||
ZAP_STR2ENUM(zap_str2zap_channel_sig_status, zap_sig_status2str, zap_channel_sig_status_t, CHAN_SIG_STATUS_NAMES, ZAP_SIG_STATE_INVALID)
|
ZAP_STR2ENUM(zap_str2zap_signaling_status, zap_signaling_status2str, zap_signaling_status_t, SIGNALING_STATUS_NAMES, ZAP_SIG_STATE_INVALID)
|
||||||
|
|
||||||
static const char *cut_path(const char *in)
|
static const char *cut_path(const char *in)
|
||||||
{
|
{
|
||||||
|
@ -1397,15 +1397,54 @@ OZ_DECLARE(zap_status_t) zap_channel_outgoing_call(zap_channel_t *zchan)
|
||||||
return ZAP_FAIL;
|
return ZAP_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
OZ_DECLARE(zap_status_t) zap_channel_get_sig_status(zap_channel_t *zchan, zap_channel_sig_status_t *sigstatus)
|
OZ_DECLARE(zap_status_t) zap_channel_set_sig_status(zap_channel_t *zchan, zap_signaling_status_t sigstatus)
|
||||||
{
|
{
|
||||||
zap_assert_return(zchan != NULL, ZAP_FAIL, "Null channel\n");
|
zap_assert_return(zchan != NULL, ZAP_FAIL, "Null channel\n");
|
||||||
zap_assert_return(sigstatus != NULL, ZAP_FAIL, "Null sig status");
|
zap_assert_return(zchan->span != NULL, ZAP_FAIL, "Null span\n");
|
||||||
|
|
||||||
if (zchan->span->get_sig_status) {
|
if (zchan->span->set_channel_sig_status) {
|
||||||
return zchan->span->get_sig_status(zchan, sigstatus);
|
return zchan->span->set_channel_sig_status(zchan, sigstatus);
|
||||||
} else {
|
} else {
|
||||||
zap_log(ZAP_LOG_ERROR, "get_sig_status method not implemented!\n");
|
zap_log(ZAP_LOG_ERROR, "set_channel_sig_status method not implemented!\n");
|
||||||
|
return ZAP_FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OZ_DECLARE(zap_status_t) zap_channel_get_sig_status(zap_channel_t *zchan, zap_signaling_status_t *sigstatus)
|
||||||
|
{
|
||||||
|
zap_assert_return(zchan != NULL, ZAP_FAIL, "Null channel\n");
|
||||||
|
zap_assert_return(zchan->span != NULL, ZAP_FAIL, "Null span\n");
|
||||||
|
zap_assert_return(sigstatus != NULL, ZAP_FAIL, "Null sig status parameter\n");
|
||||||
|
|
||||||
|
if (zchan->span->get_channel_sig_status) {
|
||||||
|
return zchan->span->get_channel_sig_status(zchan, sigstatus);
|
||||||
|
} else {
|
||||||
|
zap_log(ZAP_LOG_ERROR, "get_channel_sig_status method not implemented!\n");
|
||||||
|
return ZAP_FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OZ_DECLARE(zap_status_t) zap_span_set_sig_status(zap_span_t *span, zap_signaling_status_t sigstatus)
|
||||||
|
{
|
||||||
|
zap_assert_return(span != NULL, ZAP_FAIL, "Null span\n");
|
||||||
|
|
||||||
|
if (span->set_span_sig_status) {
|
||||||
|
return span->set_span_sig_status(span, sigstatus);
|
||||||
|
} else {
|
||||||
|
zap_log(ZAP_LOG_ERROR, "set_span_sig_status method not implemented!\n");
|
||||||
|
return ZAP_FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OZ_DECLARE(zap_status_t) zap_span_get_sig_status(zap_span_t *span, zap_signaling_status_t *sigstatus)
|
||||||
|
{
|
||||||
|
zap_assert_return(span != NULL, ZAP_FAIL, "Null span\n");
|
||||||
|
zap_assert_return(sigstatus != NULL, ZAP_FAIL, "Null sig status parameter\n");
|
||||||
|
|
||||||
|
if (span->get_span_sig_status) {
|
||||||
|
return span->get_span_sig_status(span, sigstatus);
|
||||||
|
} else {
|
||||||
|
zap_log(ZAP_LOG_ERROR, "get_span_sig_status method not implemented!\n");
|
||||||
return ZAP_FAIL;
|
return ZAP_FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue