From dedbb3a8cb455caf46b158dd4058e756e9f63931 Mon Sep 17 00:00:00 2001 From: Giovanni Maruzzelli Date: Tue, 6 Nov 2012 12:31:32 +0100 Subject: [PATCH] FS-4692 gsmopen: patch from Ivan Mironov allowing for values 'context', 'dialplan', 'destination' and 'hold_music' from configuration file global_settings used by default for individual interfaces --- src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp index 026db9eb8d..1474f77908 100644 --- a/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp +++ b/src/mod/endpoints/mod_gsmopen/mod_gsmopen.cpp @@ -1223,6 +1223,14 @@ static switch_status_t load_config(int reload_type) } switch_mutex_lock(globals.mutex); + + set_global_dialplan("XML"); + DEBUGA_GSMOPEN("Default globals.dialplan=%s\n", GSMOPEN_P_LOG, globals.dialplan); + set_global_destination("5000"); + DEBUGA_GSMOPEN("Default globals.destination=%s\n", GSMOPEN_P_LOG, globals.destination); + set_global_context("default"); + DEBUGA_GSMOPEN("Default globals.context=%s\n", GSMOPEN_P_LOG, globals.context); + if ((global_settings = switch_xml_child(cfg, "global_settings"))) { for (param = switch_xml_child(global_settings, "param"); param; param = param->next) { char *var = (char *) switch_xml_attr_soft(param, "name"); @@ -1256,16 +1264,16 @@ static switch_status_t load_config(int reload_type) for (myinterface = switch_xml_child(interfaces, "interface"); myinterface; myinterface = myinterface->next) { char *id = (char *) switch_xml_attr(myinterface, "id"); char *name = (char *) switch_xml_attr(myinterface, "name"); - const char *context = "default"; - const char *dialplan = "XML"; - const char *destination = "5000"; + const char *context = globals.context; + const char *dialplan = globals.dialplan; + const char *destination = globals.destination; const char *controldevice_name = "/dev/ttyUSB3"; const char *controldevice_audio_name = "/dev/ttyUSB2"; char *digit_timeout = NULL; char *max_digits = NULL; char *hotline = NULL; char *dial_regex = NULL; - char *hold_music = NULL; + char *hold_music = globals.hold_music; char *fail_dial_regex = NULL; const char *enable_callerid = "true";