show signaling status on oz list
git-svn-id: http://svn.openzap.org/svn/openzap/branches/sangoma_boost@907 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
bc25bc771c
commit
2ea4c03e81
|
@ -2742,6 +2742,7 @@ SWITCH_STANDARD_API(oz_function)
|
|||
for (j = 0 ; j < ZAP_MAX_SPANS_INTERFACE; j++) {
|
||||
if (SPAN_CONFIG[j].span) {
|
||||
const char *flags = "none";
|
||||
zap_channel_sig_status_t chanstatus;
|
||||
|
||||
if (SPAN_CONFIG[j].analog_options & ANALOG_OPTION_3WAY) {
|
||||
flags = "3way";
|
||||
|
@ -2749,28 +2750,56 @@ SWITCH_STANDARD_API(oz_function)
|
|||
flags = "call swap";
|
||||
}
|
||||
|
||||
stream->write_function(stream,
|
||||
"+OK\n"
|
||||
"span: %u (%s)\n"
|
||||
"type: %s\n"
|
||||
"chan_count: %u\n"
|
||||
"dialplan: %s\n"
|
||||
"context: %s\n"
|
||||
"dial_regex: %s\n"
|
||||
"fail_dial_regex: %s\n"
|
||||
"hold_music: %s\n"
|
||||
"analog_options %s\n",
|
||||
j,
|
||||
SPAN_CONFIG[j].span->name,
|
||||
SPAN_CONFIG[j].type,
|
||||
SPAN_CONFIG[j].span->chan_count,
|
||||
SPAN_CONFIG[j].dialplan,
|
||||
SPAN_CONFIG[j].context,
|
||||
SPAN_CONFIG[j].dial_regex,
|
||||
SPAN_CONFIG[j].fail_dial_regex,
|
||||
SPAN_CONFIG[j].hold_music,
|
||||
flags
|
||||
);
|
||||
/* check signaling status just in the first span channel */
|
||||
if ((ZAP_SUCCESS == zap_channel_get_sig_status(SPAN_CONFIG[j].span->channels[1], &chanstatus))) {
|
||||
stream->write_function(stream,
|
||||
"+OK\n"
|
||||
"span: %u (%s)\n"
|
||||
"type: %s\n"
|
||||
"signaling_status: %s\n"
|
||||
"chan_count: %u\n"
|
||||
"dialplan: %s\n"
|
||||
"context: %s\n"
|
||||
"dial_regex: %s\n"
|
||||
"fail_dial_regex: %s\n"
|
||||
"hold_music: %s\n"
|
||||
"analog_options %s\n",
|
||||
j,
|
||||
SPAN_CONFIG[j].span->name,
|
||||
SPAN_CONFIG[j].type,
|
||||
zap_sig_status2str(chanstatus),
|
||||
SPAN_CONFIG[j].span->chan_count,
|
||||
SPAN_CONFIG[j].dialplan,
|
||||
SPAN_CONFIG[j].context,
|
||||
SPAN_CONFIG[j].dial_regex,
|
||||
SPAN_CONFIG[j].fail_dial_regex,
|
||||
SPAN_CONFIG[j].hold_music,
|
||||
flags
|
||||
);
|
||||
} else {
|
||||
stream->write_function(stream,
|
||||
"+OK\n"
|
||||
"span: %u (%s)\n"
|
||||
"type: %s\n"
|
||||
"chan_count: %u\n"
|
||||
"dialplan: %s\n"
|
||||
"context: %s\n"
|
||||
"dial_regex: %s\n"
|
||||
"fail_dial_regex: %s\n"
|
||||
"hold_music: %s\n"
|
||||
"analog_options %s\n",
|
||||
j,
|
||||
SPAN_CONFIG[j].span->name,
|
||||
SPAN_CONFIG[j].type,
|
||||
SPAN_CONFIG[j].span->chan_count,
|
||||
SPAN_CONFIG[j].dialplan,
|
||||
SPAN_CONFIG[j].context,
|
||||
SPAN_CONFIG[j].dial_regex,
|
||||
SPAN_CONFIG[j].fail_dial_regex,
|
||||
SPAN_CONFIG[j].hold_music,
|
||||
flags
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (!strcasecmp(argv[0], "stop") || !strcasecmp(argv[0], "start")) {
|
||||
|
|
|
@ -1259,18 +1259,15 @@ 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 *sigstatus)
|
||||
{
|
||||
zap_status_t status;
|
||||
|
||||
zap_assert(zchan != NULL, ZAP_FAIL, "Null channel\n");
|
||||
zap_assert(sigstatus != NULL, ZAP_FAIL, "Null sig status");
|
||||
|
||||
if (zchan->span->get_sig_status) {
|
||||
status = zchan->span->get_sig_status(zchan, sigstatus);
|
||||
return zchan->span->get_sig_status(zchan, sigstatus);
|
||||
} else {
|
||||
zap_log(ZAP_LOG_ERROR, "get_sig_status method not implemented!\n");
|
||||
return ZAP_FAIL;
|
||||
}
|
||||
|
||||
return ZAP_FAIL;
|
||||
}
|
||||
|
||||
OZ_DECLARE(zap_status_t) zap_channel_done(zap_channel_t *zchan)
|
||||
|
|
Loading…
Reference in New Issue