mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-14 05:59:34 +00:00
add all modifier to break command
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10093 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
67e9790bfb
commit
fa266f5349
@ -1604,10 +1604,11 @@ SWITCH_STANDARD_API(session_displace_function)
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define BREAK_SYNTAX "<uuid>"
|
#define BREAK_SYNTAX "<uuid> [all]"
|
||||||
SWITCH_STANDARD_API(break_function)
|
SWITCH_STANDARD_API(break_function)
|
||||||
{
|
{
|
||||||
switch_core_session_t *psession = NULL;
|
switch_core_session_t *psession = NULL;
|
||||||
|
char *mycmd, *flag;
|
||||||
|
|
||||||
if (session) {
|
if (session) {
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
@ -1618,11 +1619,22 @@ SWITCH_STANDARD_API(break_function)
|
|||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(psession = switch_core_session_locate(cmd))) {
|
mycmd = strdup(cmd);
|
||||||
|
switch_assert(mycmd);
|
||||||
|
|
||||||
|
if ((flag = strchr(mycmd, ' '))) {
|
||||||
|
*flag++ = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(psession = switch_core_session_locate(mycmd))) {
|
||||||
stream->write_function(stream, "-ERR No Such Channel!\n");
|
stream->write_function(stream, "-ERR No Such Channel!\n");
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (flag && !strcasecmp(flag, "all")) {
|
||||||
|
switch_core_session_flush_private_events(session);
|
||||||
|
}
|
||||||
|
|
||||||
switch_channel_set_flag(switch_core_session_get_channel(psession), CF_BREAK);
|
switch_channel_set_flag(switch_core_session_get_channel(psession), CF_BREAK);
|
||||||
switch_core_session_rwunlock(psession);
|
switch_core_session_rwunlock(psession);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user