I am trying to manually rewrite the RURI for a certain scenario.
The RURI is currently: sip:110219546496707@12.12.12.12;npdi;rate=0.000880
I want to re-write so it's just: sip:110219546496707@12.12.12.12
I have the following snippet which isn't working: xlog("L_INFO","sip:$(ruri{uri.user})@$(ruri{uri.host})"); $ru = "sip:$(ruri{uri.user})@$(ruri{uri.host})"; t_relay();
the log spits out exactly what I want, but writing the $ru variable results in: Jan 29 18:59:36 dev-sipgateway /usr/local/sbin/kamailio[23042]: ERROR: <core> [resolve.c:1733]: sip_hostport2su(): ERROR: sip_hostport2su: could not resolve hostname: "$(ruri{uri.host})" Jan 29 18:59:36 dev-sipgateway /usr/local/sbin/kamailio[23042]: ERROR: tm [ut.h:337]: uri2dst2(): failed to resolve "$(ruri{uri.host})" Jan 29 18:59:36 dev-sipgateway /usr/local/sbin/kamailio[23042]: ERROR: tm [t_fwd.c:1773]: t_forward_nonack(): ERROR: t_forward_nonack: failure to add branches Jan 29 18:59:36 dev-sipgateway /usr/local/sbin/kamailio[23042]: ERROR: tm [tm.c:1502]: _w_t_relay_to(): ERROR: w_t_relay_to: t_relay_to failed Jan 29 18:59:36 dev-sipgateway /usr/local/sbin/kamailio[23042]: ERROR: tm [t_reply.c:1067]: run_failure_handlers(): ERROR: run_failure_handlers: Error in run_top_route
Any hint would be greatly appreciated.
Hi Geoffrey,
On 01/29/2014 08:03 PM, Geoffrey Mina wrote:
I am trying to manually rewrite the RURI for a certain scenario.
The RURI is currently: sip:110219546496707@12.12.12.12 mailto:sip%3A110219546496707@12.12.12.12;npdi;rate=0.000880
I want to re-write so it's just: sip:110219546496707@12.12.12.12 mailto:sip%3A110219546496707@12.12.12.12
I have the following snippet which isn't working: xlog("L_INFO","sip:$(ruri{uri.user})@$(ruri{uri.host})"); $ru = "sip:$(ruri{uri.user})@$(ruri{uri.host})"; t_relay();
PVs are not actually substituted inside string literals on assignment. You'll need to do this:
$ru = "sip:" + $(ruri{uri.user}) + "@" + $(ruri{uri.host});
(I know, it's kind of counterintuitive, because you can xlog() that just fine.)
-- Alex