mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-06 02:22:56 +00:00
FS-11977 [mod_signalwire] add configuration param override-context
This commit is contained in:
parent
26e1400bb4
commit
263a83bf7c
@ -6,5 +6,7 @@
|
|||||||
<!--param name="adoption-service" value="https://adopt.signalwire.com/adoption"/-->
|
<!--param name="adoption-service" value="https://adopt.signalwire.com/adoption"/-->
|
||||||
<!--param name="stun-server" value="stun.freeswitch.org"/-->
|
<!--param name="stun-server" value="stun.freeswitch.org"/-->
|
||||||
<!-- <authentication></authentication> -->
|
<!-- <authentication></authentication> -->
|
||||||
|
<!-- override dialplan context for calls on connector -->
|
||||||
|
<!--<param name="override-context" value="signalwire"/>-->
|
||||||
</settings>
|
</settings>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -76,6 +76,7 @@ static struct {
|
|||||||
char adoption_service[1024];
|
char adoption_service[1024];
|
||||||
char stun_server[1024];
|
char stun_server[1024];
|
||||||
char adoption_token[64];
|
char adoption_token[64];
|
||||||
|
char override_context[64];
|
||||||
ks_size_t adoption_backoff;
|
ks_size_t adoption_backoff;
|
||||||
ks_time_t adoption_next;
|
ks_time_t adoption_next;
|
||||||
|
|
||||||
@ -657,6 +658,8 @@ static switch_status_t load_config()
|
|||||||
switch_set_string(globals.stun_server, val);
|
switch_set_string(globals.stun_server, val);
|
||||||
} else if (!strcasecmp(var, "ssl-verify")) {
|
} else if (!strcasecmp(var, "ssl-verify")) {
|
||||||
globals.ssl_verify = switch_true(val) ? 1 : 0;
|
globals.ssl_verify = switch_true(val) ? 1 : 0;
|
||||||
|
} else if (!strcasecmp(var, "override-context") && !ks_zstr(val)) {
|
||||||
|
switch_set_string(globals.override_context, val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((tmp = switch_xml_child(settings, "authentication"))) {
|
if ((tmp = switch_xml_child(settings, "authentication"))) {
|
||||||
@ -749,6 +752,11 @@ SWITCH_STANDARD_DIALPLAN(dialplan_hunt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (globals.override_context[0] != '\0') {
|
||||||
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Overriding dialplan context from %s to %s\n",caller_profile->context,globals.override_context);
|
||||||
|
caller_profile->context = globals.override_context;
|
||||||
|
}
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Processing %s <%s>->%s in context %s\n",
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_INFO, "Processing %s <%s>->%s in context %s\n",
|
||||||
caller_profile->caller_id_name, caller_profile->caller_id_number, caller_profile->destination_number, caller_profile->context);
|
caller_profile->caller_id_name, caller_profile->caller_id_number, caller_profile->destination_number, caller_profile->context);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user