From e0b2b0928cc7c1ecedf316dbb4bc03d561bd54fa Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Fri, 20 Jan 2012 13:00:11 -0600 Subject: [PATCH] copy more variables over on an attended transfer to valet --- .../mod_valet_parking/mod_valet_parking.c | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_valet_parking/mod_valet_parking.c b/src/mod/applications/mod_valet_parking/mod_valet_parking.c index e51192809f..9a237ac44a 100644 --- a/src/mod/applications/mod_valet_parking/mod_valet_parking.c +++ b/src/mod/applications/mod_valet_parking/mod_valet_parking.c @@ -428,6 +428,9 @@ SWITCH_STANDARD_APP(valet_parking_function) 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 = ""; + lot = valet_find_lot(lot_name, SWITCH_TRUE); switch_assert(lot); @@ -586,7 +589,28 @@ SWITCH_STANDARD_APP(valet_parking_function) music = "silence_stream://-1"; } - dest = switch_core_session_sprintf(session, "set:valet_ticket=%s,set:valet_hold_music=%s,sleep:1000,valet_park:%s %s", + if ((orbit_exten = switch_channel_get_variable(channel, "valet_parking_orbit_exten"))) { + orbit_exten_str = switch_core_session_sprintf(session, "set:valet_parking_orbit_exten=%s,", orbit_exten); + } + + if ((orbit_dialplan = switch_channel_get_variable(channel, "valet_parking_orbit_dialplan"))) { + orbit_dialplan_str = switch_core_session_sprintf(session, "set:valet_parking_orbit_dialplan=%s,", orbit_dialplan); + } + + if ((orbit_context = switch_channel_get_variable(channel, "valet_parking_orbit_context"))) { + orbit_context_str = switch_core_session_sprintf(session, "set:valet_parking_orbit_context=%s,", orbit_context); + } + + 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" + "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, token->uuid, music, lot_name, ext); switch_channel_set_variable(channel, "inline_destination", dest);