case SWITCH_INPUT_TYPE_DTMF:
{
switch_dtmf_t *dtmf = (switch_dtmf_t *) input;
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+ switch_dtmf_t *exit_key_pvt = (switch_dtmf_t *) switch_channel_get_private(channel, "_orbit_exit_key_");
+
+ if (dtmf->digit == exit_key_pvt->digit) {
+ const char *dp;
+ const char *exten;
+ const char *context;
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "valet_on_dtmf() - digit pressed '%d' matched valet_parking_orbit_exit_key '%d'\n", dtmf->digit, exit_key_pvt->digit);
+
+ dp = switch_channel_get_variable(channel, "valet_parking_orbin_dialplan");
+ if (zstr(dp)) {
+ dp = switch_channel_get_variable(channel, "XML");
+ }
+
+ context = switch_channel_get_variable(channel, "valet_parking_orbit_context");
+ if (zstr(context)) {
+ context = switch_channel_get_variable(channel, "context");
+ }
+
+ exten = switch_channel_get_variable(channel, "valet_parking_orbit_exten");
+ if (!zstr(exten)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "valet_on_dtmf() - transferring session to '%s %s %s'\n", exten, dp, context);
+ switch_ivr_session_transfer(session, exten, dp, context);
+ }
+
+ return SWITCH_STATUS_BREAK;
+ }
if (dtmf->digit == '#') {
return SWITCH_STATUS_BREAK;
char *dest;
int in = -1;
- const char *timeout, *orbit_exten, *orbit_dialplan, *orbit_context;
- char *timeout_str = "", *orbit_exten_str = "", *orbit_dialplan_str = "", *orbit_context_str = "";
+ const char *timeout, *orbit_exten, *orbit_dialplan, *orbit_context, *orbit_exit_key;
+ char *timeout_str = "", *orbit_exten_str = "", *orbit_dialplan_str = "", *orbit_context_str = "", *orbit_exit_key_str = "";
lot = valet_find_lot(lot_name, SWITCH_TRUE);
switch_assert(lot);
orbit_context_str = switch_core_session_sprintf(session, "set:valet_parking_orbit_context=%s,", orbit_context);
}
+ if ((orbit_exit_key = switch_channel_get_variable(channel, "valet_parking_orbit_exit_key"))) {
+ orbit_exit_key_str = switch_core_session_sprintf(session, "set:valet_parking_orbit_exit_key=%s,", orbit_exit_key);
+
+ switch_channel_set_private(channel, "_orbit_exit_key_", orbit_exit_key);
+ }
+
if ((timeout = switch_channel_get_variable(channel, "valet_parking_timeout"))) {
timeout_str = switch_core_session_sprintf(session, "set:valet_parking_timeout=%s,", timeout);
}
- dest = switch_core_session_sprintf(session, "%s%s%s%s"
+ dest = switch_core_session_sprintf(session, "%s%s%s%s%s"
"set:valet_ticket=%s,set:valet_hold_music='%s',sleep:1000,valet_park:%s %s",
timeout_str,
orbit_exten_str,
orbit_dialplan_str,
orbit_context_str,
+ orbit_exit_key_str,
token->uuid, music, lot_name, ext);
switch_channel_set_variable(channel, "inline_destination", dest);