提交 263a83bf authored 作者: David Grant's avatar David Grant

FS-11977 [mod_signalwire] add configuration param override-context

上级 26e1400b
......@@ -6,5 +6,7 @@
<!--param name="adoption-service" value="https://adopt.signalwire.com/adoption"/-->
<!--param name="stun-server" value="stun.freeswitch.org"/-->
<!-- <authentication></authentication> -->
<!-- override dialplan context for calls on connector -->
<!--<param name="override-context" value="signalwire"/>-->
</settings>
</configuration>
......@@ -76,6 +76,7 @@ static struct {
char adoption_service[1024];
char stun_server[1024];
char adoption_token[64];
char override_context[64];
ks_size_t adoption_backoff;
ks_time_t adoption_next;
......@@ -657,6 +658,8 @@ static switch_status_t load_config()
switch_set_string(globals.stun_server, val);
} else if (!strcasecmp(var, "ssl-verify")) {
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"))) {
......@@ -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",
caller_profile->caller_id_name, caller_profile->caller_id_number, caller_profile->destination_number, caller_profile->context);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论