Hello Kamailions,
Im trying to manipulate the username from the from uri, but not having any luck, I must be doing something wrong.
I receive a from uri username that is prefixed with 888, now I am trying to remove the triple 8.
I have configured the following:
line 1090 if($fU=~"^888"){ 1091 strip(3); 1092 } 1093 route(GETGROUP);
But I do not get any result, the debug shows the following:
29(9610) exec: *** cfgtrace:request_route=[MOMANX] c=[/usr/local/etc/kamailio/kamailio.cfg] l=1093 a=16 n=if 29(9610) exec: *** cfgtrace:request_route=[MOMANX] c=[/usr/local/etc/kamailio/kamailio.cfg] l=1091 a=45 n=strip 29(9610) exec: *** cfgtrace:request_route=[MOMANX] c=[/usr/local/etc/kamailio/kamailio.cfg] l=1093 a=5 n=route
Does anyone see what I am doing wrong?
Help would be appreciated.
Rgds,
Gertjan Wolzak
try $U=$(fU{s.substr,3,0});
2017-10-04 11:34 GMT+03:00 Gertjan Wolzak g.wolzak@kazlow.nl:
Hello Kamailions,
Im trying to manipulate the username from the from uri, but not having any luck, I must be doing something wrong.
I receive a from uri username that is prefixed with 888, now I am trying to remove the triple 8.
I have configured the following:
line 1090 if($fU=~"^888"){ 1091 strip(3); 1092 } 1093 route(GETGROUP);
But I do not get any result, the debug shows the following:
29(9610) exec: *** cfgtrace:request_route=[MOMANX] c=[/usr/local/etc/kamailio/kamailio.cfg] l=1093 a=16 n=if 29(9610) exec: *** cfgtrace:request_route=[MOMANX] c=[/usr/local/etc/kamailio/kamailio.cfg] l=1091 a=45 n=strip 29(9610) exec: *** cfgtrace:request_route=[MOMANX] c=[/usr/local/etc/kamailio/kamailio.cfg] l=1093 a=5 n=route
Does anyone see what I am doing wrong?
Help would be appreciated.
Rgds,
Gertjan Wolzak
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Wed, Oct 04, 2017 at 10:34:34AM +0200, Gertjan Wolzak wrote:
Im trying to manipulate the username from the from uri, but not having any luck, I must be doing something wrong.
I receive a from uri username that is prefixed with 888, now I am trying to remove the triple 8.
I have configured the following:
line 1090 if($fU=~"^888"){ 1091 strip(3); 1092 } 1093 route(GETGROUP);
strip(/prefix/striptail) manipulates $rU, not $fU. You need to use uac_replace_from and you can call this function only once. I have some horrible routes that normalize $fU/$tU:
route[INTERNATIONALPLUS] { $avp(nfU)=$fU; $avp(ntU)=$tU;
if($tU=~"^00[1-9][0-9]+$") { $avp(ntU)="+"+$(tU{s.substr,2,0}); } else if($tU=~"^0[1-9][0-9]+$") { $avp(ntU)="+31"+$(tU{s.substr,1,0}); } ...
if($tU!=$avp(ntU)) { if($tn=~"^+?[0-1]+$") { $avp(uacreplacetodisplay)=1; $avp(uactodisplay)=""; }
$avp(uacreplacetouri)=1; $avp(uactouri)="sip:"+$avp(ntU)+"@"+$td; }
And check those avps in branches to call uac_replace_to/uac_replace_from
use this function :
uac_replace_from("sip:batman@gotham.org");
https://www.kamailio.org/docs/modules/stable/modules/uac.html
On Wed, Oct 4, 2017 at 10:34 AM, Gertjan Wolzak g.wolzak@kazlow.nl wrote:
Hello Kamailions,
Im trying to manipulate the username from the from uri, but not having any luck, I must be doing something wrong.
I receive a from uri username that is prefixed with 888, now I am trying to remove the triple 8.
I have configured the following:
line 1090 if($fU=~"^888"){ 1091 strip(3); 1092 } 1093 route(GETGROUP);
But I do not get any result, the debug shows the following:
29(9610) exec: *** cfgtrace:request_route=[MOMANX] c=[/usr/local/etc/kamailio/kamailio.cfg] l=1093 a=16 n=if 29(9610) exec: *** cfgtrace:request_route=[MOMANX] c=[/usr/local/etc/kamailio/kamailio.cfg] l=1091 a=45 n=strip 29(9610) exec: *** cfgtrace:request_route=[MOMANX] c=[/usr/local/etc/kamailio/kamailio.cfg] l=1093 a=5 n=route
Does anyone see what I am doing wrong?
Help would be appreciated.
Rgds,
Gertjan Wolzak
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users