FS-5231 --resolve
This commit is contained in:
parent
f7408f8829
commit
3b50675d25
|
@ -591,6 +591,15 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_nomedia(const char *uuid, switch_medi
|
||||||
*/
|
*/
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(const char *uuid, const char *message, switch_bool_t moh);
|
SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(const char *uuid, const char *message, switch_bool_t moh);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\brief Toggles channel hold state of session
|
||||||
|
\param uuid the uuid of the session to hold
|
||||||
|
\param message optional message
|
||||||
|
\param moh play music-on-hold
|
||||||
|
\return SWITCH_STATUS_SUCCESS if all is well
|
||||||
|
*/
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_ivr_hold_toggle_uuid(const char *uuid, const char *message, switch_bool_t moh);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Signal the session with a protocol specific unhold message.
|
\brief Signal the session with a protocol specific unhold message.
|
||||||
\param uuid the uuid of the session to hold
|
\param uuid the uuid of the session to hold
|
||||||
|
|
|
@ -3184,7 +3184,7 @@ SWITCH_STANDARD_API(sched_broadcast_function)
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define HOLD_SYNTAX "[off] <uuid> [<display>]"
|
#define HOLD_SYNTAX "[off|toggle] <uuid> [<display>]"
|
||||||
SWITCH_STANDARD_API(uuid_hold_function)
|
SWITCH_STANDARD_API(uuid_hold_function)
|
||||||
{
|
{
|
||||||
char *mycmd = NULL, *argv[4] = { 0 };
|
char *mycmd = NULL, *argv[4] = { 0 };
|
||||||
|
@ -3200,6 +3200,8 @@ SWITCH_STANDARD_API(uuid_hold_function)
|
||||||
} else {
|
} else {
|
||||||
if (!strcasecmp(argv[0], "off")) {
|
if (!strcasecmp(argv[0], "off")) {
|
||||||
status = switch_ivr_unhold_uuid(argv[1]);
|
status = switch_ivr_unhold_uuid(argv[1]);
|
||||||
|
} else if (!strcasecmp(argv[0], "toggle")) {
|
||||||
|
status = switch_ivr_hold_toggle_uuid(argv[1], argv[2], 1);
|
||||||
} else {
|
} else {
|
||||||
status = switch_ivr_hold_uuid(argv[0], argv[1], 1);
|
status = switch_ivr_hold_uuid(argv[0], argv[1], 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1445,6 +1445,28 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_hold_uuid(const char *uuid, const cha
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SWITCH_DECLARE(switch_status_t) switch_ivr_hold_toggle_uuid(const char *uuid, const char *message, switch_bool_t moh)
|
||||||
|
{
|
||||||
|
switch_core_session_t *session;
|
||||||
|
switch_channel_t *channel;
|
||||||
|
switch_channel_callstate_t callstate;
|
||||||
|
|
||||||
|
if ((session = switch_core_session_locate(uuid))) {
|
||||||
|
if ((channel = switch_core_session_get_channel(session))) {
|
||||||
|
callstate = switch_channel_get_callstate(channel);
|
||||||
|
|
||||||
|
if (callstate == CCS_ACTIVE) {
|
||||||
|
switch_ivr_hold(session, message, moh);
|
||||||
|
} else if (callstate == CCS_HELD) {
|
||||||
|
switch_ivr_unhold(session);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch_core_session_rwunlock(session);
|
||||||
|
}
|
||||||
|
|
||||||
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
SWITCH_DECLARE(switch_status_t) switch_ivr_unhold(switch_core_session_t *session)
|
SWITCH_DECLARE(switch_status_t) switch_ivr_unhold(switch_core_session_t *session)
|
||||||
{
|
{
|
||||||
switch_core_session_message_t msg = { 0 };
|
switch_core_session_message_t msg = { 0 };
|
||||||
|
|
Loading…
Reference in New Issue