I want rewrite $tU but I'm not being able, I'm doing the following:
remove_hf("To"); insert_hf("To: sip:$rU@$rd\r\n", "From");
Note that proxies shouldn't be doing that.
On 03/07/2012 01:34 PM, Lucas Alvarez wrote:
I want rewrite $tU but I'm not being able, I'm doing the following:
remove_hf("To");
insert_hf("To: sip:$rU@$rd\r\n", "From");
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
I want rewrite $tU but I'm not being able, I'm doing the following:
remove_hf("To"); insert_hf("To: sip:$rU@$rd\r\n", "From");
Then I'm printing $tU and it is still having the previous value, any help will be appreciated. Thanks in advance.
Lucas Alvarez
Hi,
I think you should use uac_replace_from/uac_replace_to.
Dani
On Wed, Mar 7, 2012 at 8:37 PM, Lucas Alvarez lucasaa@gmail.com wrote:
I want rewrite $tU but I'm not being able, I'm doing the following:
remove_hf("To"); insert_hf("To: sip:$rU@$rd\r\n", "From");
Then I'm printing $tU and it is still having the previous value, any help will be appreciated. Thanks in advance.
Lucas Alvarez
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 03/07/2012 01:41 PM, Dani Popa wrote:
I think you should use uac_replace_from/uac_replace_to.
http://www.kamailio.org/docs/modules/3.2.x/modules_k/uac.html
Where do you see uac_replace_to()? :)
well, you are right, kamailio doesn't have uac_replace_to .
Dani
On Wed, Mar 7, 2012 at 8:43 PM, Alex Balashov abalashov@evaristesys.comwrote:
On 03/07/2012 01:41 PM, Dani Popa wrote:
I think you should use uac_replace_from/uac_replace_**to.
http://www.kamailio.org/docs/**modules/3.2.x/modules_k/uac.**htmlhttp://www.kamailio.org/docs/modules/3.2.x/modules_k/uac.html
Where do you see uac_replace_to()? :)
-- Alex Balashov - Principal Evariste Systems LLC 260 Peachtree Street NW Suite 2200 Atlanta, GA 30303 Tel: +1-678-954-0670 Fax: +1-404-961-1892 Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
______________________________**_________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/**cgi-bin/mailman/listinfo/sr-**usershttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 03/07/2012 07:37 PM, Lucas Alvarez wrote:
I want rewrite $tU but I'm not being able, I'm doing the following:
remove_hf("To"); insert_hf("To: sip:$rU@$rd\r\n", "From");
Then I'm printing $tU and it is still having the previous value, any help will be appreciated. Thanks in advance.
Did you verify what is actually sent on the wire? If it's just a logging issue you need to do msg_apply_changes().
The whole thing is I'm making routing decisions adding prefixes to usernames, for example, suppose I have two boxes: box01 and box02. If I want to dial to an extension in box02 from and extension registered in box01 I was prefixing the box02 to the username. When the call hits kamailio I check if the username has the box02 prefix and if it has I send it to the ip address of that box stripping the prefix before. Something like this:
if(($rU=~"^(box02)[0-9]{2,15}$")) { $rU = $(rU{s.substr,5,0}); $ru = "sip:" + $rU + "@" + $sel(cfg_get.box02.gw_ip) + ":" + $sel(cfg_get.box02.gw_port); }
The problem I'm having is I'm not being able to do blind tranfers. I think the cause is the prefix that remains in the TO field. After rewriting the TO field nothing change. I would appreciate if someone could point me to the right path.
Lucas Alvarez
On Wed, Mar 7, 2012 at 4:22 PM, Andrew Pogrebennyk <apogrebennyk@sipwise.com
wrote:
On 03/07/2012 07:37 PM, Lucas Alvarez wrote:
I want rewrite $tU but I'm not being able, I'm doing the following:
remove_hf("To"); insert_hf("To: sip:$rU@$rd\r\n", "From");
Then I'm printing $tU and it is still having the previous value, any help will be appreciated. Thanks in advance.
Did you verify what is actually sent on the wire? If it's just a logging issue you need to do msg_apply_changes().
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 03/07/2012 08:46 PM, Lucas Alvarez wrote:.
Something like this:
if(($rU=~"^(box02)[0-9]{2,15}$")) { $rU = $(rU{s.substr,5,0}); $ru = "sip:" + $rU + "@" + $sel(cfg_get.box02.gw_ip) + ":"
- $sel(cfg_get.box02.gw_port);
}
BTW alternatively you can use dialplan the module to hold both regexp to match and target IP with added benefit of in-database provisioning.
The problem I'm having is I'm not being able to do blind tranfers. I think the cause is the prefix that remains in the TO field. After rewriting the TO field nothing change. I would appreciate if someone could point me to the right path.
Hmm, the blind transfers should be transparent to the proxy. So the REFER request should go all the way through box02 to box01 and to the caller, which should send a new INVITE so the box01 can apply the same logic of finding out where the subscriber is registered to RURI.
What is the actual call flow that you see after REFER?