Hi Sindrek,
look to this example from opensips documentation :# replace the uri in to: with
the value of avp
sip_address subst('/^To:(.*)sip:[^@]*@[a-zA-Z0-9.]+(.*)$/t:\1$avp(sip_address)\2/ig')
regards//Binan
--- On Mon, 8/20/12, sindrek <[email protected]> wrote:
From: sindrek <[email protected]>
Subject: [OpenSIPS-Users] textops replace and variables ..
To: [email protected]
Date: Monday, August 20, 2012, 4:07 AM
Hi,
I'm stuck with an idiotic thing her .. probably an easy thing which I can
not see ..
I want to add "something" in front of a register contact uri.
This static way works:
if(is_method("REGISTER")){
replace("Contact: <sip:", "Contact: <sip:something");
};
This dynamic way does not:
if(is_method("REGISTER")){
$var(contact) = "something";
replace("Contact: <sip:", "Contact: <sip:"+$var(contact));
#or this:
replace("Contact: <sip:", "Contact: <sip: $var(contact)"); #does not get
the variable content, just it's name
};
I guess the replace method in the textops module does see the variable as
text/string? It migth need somethings like a .toString?
/BR
Sindre
--
View this message in context:
http://opensips-open-sip-server.1449251.n2.nabble.com/textops-replace-and-variables-tp7581301.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users