提交 40c29a10 authored 作者: Michael Jerris's avatar Michael Jerris

merge patch from MODENDP-24, add to-domain param to gateway that overrides the…

merge patch from MODENDP-24, add to-domain param to gateway that overrides the proxy domain for the to header

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5712 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 31c71767
......@@ -500,7 +500,8 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
*context = "default",
*expire_seconds = "3600",
*retry_seconds = "30",
*from_domain = "";
*from_domain = "",
*to_domain = "";
gateway->pool = profile->pool;
gateway->profile = profile;
......@@ -536,9 +537,15 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
retry_seconds = val;
} else if (!strcmp(var, "from-domain")) {
from_domain = val;
} else if (!strcmp(var, "to-domain")) {
to_domain = val;
}
}
if (switch_strlen_zero(to_domain)) {
to_domain = proxy;
}
if (switch_strlen_zero(realm)) {
realm = name;
}
......@@ -586,12 +593,12 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag)
gateway->register_contact = switch_core_sprintf(gateway->pool, "sip:%s@%s:%d", extension,
profile->extsipip ? profile->extsipip : profile->sipip, profile->sip_port);
if (!strncasecmp(proxy, "sip:", 4)) {
if (!strncasecmp(to_domain, "sip:", 4)) {
gateway->register_proxy = switch_core_strdup(gateway->pool, proxy);
gateway->register_to = switch_core_sprintf(gateway->pool, "sip:%s@%s", username, proxy + 4);
gateway->register_to = switch_core_sprintf(gateway->pool, "sip:%s@%s", username, to_domain + 4);
} else {
gateway->register_proxy = switch_core_sprintf(gateway->pool, "sip:%s", proxy);
gateway->register_to = switch_core_sprintf(gateway->pool, "sip:%s@%s", username, proxy);
gateway->register_to = switch_core_sprintf(gateway->pool, "sip:%s@%s", username, to_domain);
}
gateway->expires_str = switch_core_strdup(gateway->pool, expire_seconds);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论