[OpenSIPS-Users] Using dispatcher and t_replicate()

Bogdan-Andrei Iancu bogdan at voice-system.ro
Wed Dec 22 11:18:30 CET 2010


Hi Jody,

What version / revsion number are you testing with ?

That add-on in still there (trunk and 1.6) as far I checked.

Regards,
Bogdan


Jody Rudolph wrote:
> This was added and working at one time but in the latest SVN it seems to have reverted back to non-working. Am I missing a setting that has changed?
>   
> ds_select_dst("1", "4");
> t_replicate("$du");
>   
> Dec 20 13:16:02 [12858] ERROR:core:parse_uri: uri too short: <$du> (3)
> Dec 20 13:16:02 [12858] ERROR:tm:uri2proxy: bad_uri: $du
>   
> Thanks,
> Jody Rudolph
>   
>   
> On Oct 4, 2010, at 9:57 AM, Razvan Crainea wrote:
>
> >/  Hi Jody,
> />/ 
> />/ I just made a commit with this feature. Now t_replicate can also receive 
> />/ a pseudo-variable as argument.
> />/ Please update from svn (it is both in trunk and 1.6).
> />/ 
> />/ Regards,
> />/ 
> />/ -- 
> />/ Razvan Crainea
> />/ www.voice-system.ro <http://www.voice-system.ro>
> />/ 
> />/ 
> />/ 
> />/ On 10/04/2010 02:17 PM, Bogdan-Andrei Iancu wrote:
> />>/ Hi Jody,
> />>/ 
> />>/ Indeed, this is not a nice solution - let me put on the TODO list the
> />>/ support for variables in t_replicate.
> />>/ 
> />>/ Regards,
> />>/ Bogdan
> />>/ 
> />>/ Jody Rudolph wrote:
> />>>/ Just in case anyone might need a workaround here like I did I thought I would share what I did to get it to work.
> />>>/ 
> />>>/ Since the servers I am load balancing registrations across share a database backend for registrations I am trying to spread the registrations across single servers using dispatcher.
> />>>/ 
> />>>/ Lets say we have the following 3 IPs:
> />>>/ 
> />>>/ 192.168.1.2
> />>>/ 192.168.1.3
> />>>/ 192.168.1.4
> />>>/ 
> />>>/ 
> />>>/ Since we cant use (that I can figure out anyway)
> />>>/ ds_select_dst("1", "4");
> />>>/ t_replicate($du);
> />>>/ 
> />>>/ I used:
> />>>/ 
> />>>/ 	ds_select_dst("1", "4");
> />>>/ 	switch($du)
> />>>/         {
> />>>/             case "sip:192.168.1.2":
> />>>/                 xlog("reg destination address is $du\n");
> />>>/                 t_replicate("sip:192.168.1.2");
> />>>/             break;
> />>>/             case "sip:192.168.1.3":
> />>>/                 xlog("reg destination address is $du\n");
> />>>/                 t_replicate("sip:192.168.1.3");
> />>>/             break;
> />>>/             case "sip:192.168.1.4":
> />>>/                 xlog("reg destination address is $du\n");
> />>>/                 t_replicate("sip:192.168.1.4");
> />>>/             break;
> />>>/             default:
> />>>/                 xlog("Dispatching Reg failed: $du\n");
> />>>/                 sl_reply_error();
> />>>/             break;
> />>>/        }
> />>>/ 	exit;
> />>>/ 
> />>>/ Not the cleanest way of doing it, but it works.
> />>>/ 
> />>>/ 
> />>>/ 
> />>>/ Thanks,
> />>>/ Jody Rudolph
> />>>/ 
> />>>>/ 
> />>>/ 
> />>>/ _______/
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Event - expo, conf, social, bootcamp
2 - 4 February 2011, ITExpo, Miami,  USA
www.voice-system.ro




More information about the Users mailing list