提交 c16c74d9 authored 作者: Anthony Minessale's avatar Anthony Minessale

update show calls to show both 1 legged calls and bridged calls, also show…

update show calls to show both 1 legged calls and bridged calls, also show bridged_calls for previous behaviour of show calls
上级 56d67ead
......@@ -3906,7 +3906,7 @@ SWITCH_STANDARD_API(alias_function)
return SWITCH_STATUS_SUCCESS;
}
#define SHOW_SYNTAX "codec|endpoint|application|api|dialplan|file|timer|calls [count]|channels [count|like <match string>]|distinct_channels|aliases|complete|chat|management|modules|nat_map|say|interfaces|interface_types|tasks|limits"
#define SHOW_SYNTAX "codec|endpoint|application|api|dialplan|file|timer|calls [count]|channels [count|like <match string>]|calls|detailed_calls|bridged_calls|detailed_bridged_calls|aliases|complete|chat|management|modules|nat_map|say|interfaces|interface_types|tasks|limits"
SWITCH_STANDARD_API(show_function)
{
char sql[1024];
......@@ -3995,7 +3995,7 @@ SWITCH_STANDARD_API(show_function)
sprintf(sql, "select name, description, syntax, ikey from interfaces where hostname='%s' and type = '%s' and description != '' order by type,name", hostname, command);
}
} else if (!strcasecmp(command, "calls")) {
sprintf(sql, "select * from calls where hostname='%s' order by call_created_epoch", hostname);
sprintf(sql, "select * from basic_calls where hostname='%s' order by call_created_epoch", hostname);
if (argv[1] && !strcasecmp(argv[1], "count")) {
holder.justcount = 1;
if (argv[3] && !strcasecmp(argv[2], "as")) {
......@@ -4043,19 +4043,18 @@ SWITCH_STANDARD_API(show_function)
as = argv[3];
}
}
} else if (!strcasecmp(command, "distinct_channels")) {
sprintf(sql, "select * from channels left join calls on "
"channels.uuid=calls.caller_uuid where channels.hostname='%s' and channels.uuid not in (select callee_uuid from calls where hostname='%s') order by created_epoch", hostname, hostname);
} else if (!strcasecmp(command, "detailed_calls")) {
sprintf(sql, "select * from detailed_calls where hostname='%s' order by created_epoch", hostname);
if (argv[2] && !strcasecmp(argv[1], "as")) {
as = argv[2];
}
} else if (!strcasecmp(command, "detailed_calls")) {
sprintf(sql, "select * from detailed_calls where hostname='%s' order by created_epoch", hostname);
} else if (!strcasecmp(command, "bridged_calls")) {
sprintf(sql, "select * from basic_calls where b_uuid is not null and hostname='%s' order by created_epoch", hostname);
if (argv[2] && !strcasecmp(argv[1], "as")) {
as = argv[2];
}
} else if (!strcasecmp(command, "detailed_calls")) {
sprintf(sql, "select * from detailed_calls where hostname='%s' order by created_epoch", hostname);
} else if (!strcasecmp(command, "detailed_bridged_calls")) {
sprintf(sql, "select * from detailed_calls where b_uuid is not null and hostname='%s' order by created_epoch", hostname);
if (argv[2] && !strcasecmp(argv[1], "as")) {
as = argv[2];
}
......
......@@ -2016,8 +2016,10 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "SEND");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Name", name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Number", number);
switch_channel_set_profile_var(channel, "callee_id_name", name);
switch_channel_set_profile_var(channel, "callee_id_number", number);
if (uuid) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid);
}
......
......@@ -745,8 +745,8 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "RECV");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Name", name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Number", number);
switch_channel_set_profile_var(channel, "callee_id_name", name);
switch_channel_set_profile_var(channel, "callee_id_number", number);
if (uuid) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid);
}
......
......@@ -2626,10 +2626,6 @@ SWITCH_DECLARE(void) switch_channel_flip_cid(switch_channel_t *channel)
if (switch_event_create(&event, SWITCH_EVENT_CALL_UPDATE) == SWITCH_STATUS_SUCCESS) {
const char *uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Direction", "RECV");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Caller-Name", channel->caller_profile->caller_id_name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Caller-Number", channel->caller_profile->caller_id_number);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Name", channel->caller_profile->callee_id_name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Callee-Number", channel->caller_profile->callee_id_number);
if (uuid) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Bridged-To", uuid);
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论