mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 00:41:41 +00:00
MODENDP-232 part 2
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14589 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
e25389a643
commit
7820dc0a94
@ -1777,23 +1777,20 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
|
||||
cb.profile = profile;
|
||||
cb.stream = stream;
|
||||
|
||||
if (argv[3]) {
|
||||
if (argv[4]) {
|
||||
if (!strcasecmp(argv[3], "pres")) {
|
||||
if (!sql && argv[2] && !strcasecmp(argv[2], "pres") && argv[3]) {
|
||||
sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
|
||||
"rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
|
||||
"network_ip,network_port,sip_username,sip_realm"
|
||||
" from sip_registrations where profile_name='%q' and presence_hosts like '%%%q%%'",
|
||||
profile->name, argv[4]);
|
||||
profile->name, argv[3]);
|
||||
}
|
||||
} else {
|
||||
if (!sql && argv[2] && !strcasecmp(argv[2], "reg") && argv[3]) {
|
||||
sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
|
||||
"rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
|
||||
"network_ip,network_port,sip_username,sip_realm"
|
||||
" from sip_registrations where profile_name='%q' and contact like '%%%q%%'",
|
||||
profile->name, argv[3]);
|
||||
}
|
||||
}
|
||||
if (!sql && argv[2] && !strcasecmp(argv[2], "user") && argv[3]) {
|
||||
char *dup = strdup(argv[3]);
|
||||
char *host = NULL, *user = NULL;
|
||||
@ -1834,7 +1831,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
|
||||
}
|
||||
|
||||
sofia_glue_execute_sql_callback(profile, SWITCH_FALSE, profile->ireg_mutex, sql, show_reg_callback, &cb);
|
||||
free(sql);
|
||||
switch_safe_free(sql);
|
||||
|
||||
stream->write_function(stream, "%s\n", line);
|
||||
|
||||
@ -1999,23 +1996,22 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
|
||||
cb.profile = profile;
|
||||
cb.stream = stream;
|
||||
|
||||
if (argv[3]) {
|
||||
if (argv[4]) {
|
||||
if (!strcasecmp(argv[3], "pres")) {
|
||||
if (!sql && argv[2] && !strcasecmp(argv[2], "pres") && argv[3]) {
|
||||
|
||||
sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
|
||||
"rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
|
||||
"network_ip,network_port,sip_username,sip_realm"
|
||||
" from sip_registrations where profile_name='%q' and presence_hosts like '%%%q%%'",
|
||||
profile->name, argv[4]);
|
||||
profile->name, argv[3]);
|
||||
}
|
||||
} else {
|
||||
if (!sql && argv[2] && !strcasecmp(argv[2], "reg") && argv[3]) {
|
||||
|
||||
sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,"
|
||||
"rpid,expires,user_agent,server_user,server_host,profile_name,hostname,"
|
||||
"network_ip,network_port,sip_username,sip_realm"
|
||||
" from sip_registrations where profile_name='%q' and contact like '%%%q%%'",
|
||||
profile->name, argv[3]);
|
||||
}
|
||||
}
|
||||
if (!sql && argv[2] && !strcasecmp(argv[2], "user") && argv[3]) {
|
||||
char *dup = strdup(argv[3]);
|
||||
char *host = NULL, *user = NULL;
|
||||
@ -2056,7 +2052,7 @@ static switch_status_t cmd_xml_status(char **argv, int argc, switch_stream_handl
|
||||
}
|
||||
|
||||
sofia_glue_execute_sql_callback(profile, SWITCH_FALSE, profile->ireg_mutex, sql, show_reg_callback_xml, &cb);
|
||||
free(sql);
|
||||
switch_safe_free(sql);
|
||||
|
||||
stream->write_function(stream, " </registrations>\n");
|
||||
stream->write_function(stream, "</profile>\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user