The documentation specify that the address field in dr_gateways table is a SIP URI.
When a SIP URI is populated into the table, drouting fails to load.
The first thing that needs to be fixed is creating the URI that needs to be parsed in routing.c:add_dst():
@@ -491,8 +491,9 @@
pgw->type = type;
/* add address in the list */
- if(pgw->ip_str.len<5 || (strncasecmp("sip:", ip, 4)
- && strncasecmp("sips:", ip, 5)))
+ if(pgw->ip_str.len<5 ||
+ (strncasecmp("sip:",ip,4) != 0 &&
+ strncasecmp("sips:",ip,5) != 0))
LM_ERR("GW address (%d) longer "
But after that, the code still expects an IP:port in pgw->ip_str (but we have a SIP URI).
When the new destination URI is created, the resulting SIP URI is bogus because the host part of the new URI is startin with "sip:"
drouting:push_gw_for_usage: adding gw [blah] as "sip:username@sip:host" in order 0