}
if (!strchr(dest, '@')) {
- tech_pvt->dest = switch_core_session_sprintf(nsession, "sip:%s@%s", dest, sofia_glue_strip_proto(gateway_ptr->register_proxy));
+ tech_pvt->dest = switch_core_session_sprintf(nsession, "sip:%s%s@%s", gateway_ptr->destination_prefix, dest, sofia_glue_strip_proto(gateway_ptr->register_proxy));
} else {
- tech_pvt->dest = switch_core_session_sprintf(nsession, "sip:%s", dest);
+ tech_pvt->dest = switch_core_session_sprintf(nsession, "sip:%s%s", gateway_ptr->destination_prefix, dest);
}
if ((host = switch_core_session_strdup(nsession, tech_pvt->dest))) {
gateway->ob_calls = 0;
gateway->ib_failed_calls = 0;
gateway->ob_failed_calls = 0;
+ gateway->destination_prefix = "";
if ((x_params = switch_xml_child(gateway_tag, "variables"))) {
param = switch_xml_child(x_params, "variable");
outbound_proxy = val;
} else if (!strcmp(var, "distinct-to")) {
distinct_to = switch_true(val);
+ } else if (!strcmp(var, "destination-prefix")) {
+ if (!zstr(val)) {
+ gateway->destination_prefix = switch_core_strdup(gateway->pool, val);
+ }
} else if (!strcmp(var, "rfc-5626")) {
rfc_5626 = switch_true(val);
} else if (!strcmp(var, "reg-id")) {