[Users] Routing Examples

Douglas Garstang dgarstang at oneeighty.com
Wed Dec 14 17:25:31 CET 2005


Bogdan...

Thanks for the info. Ok... well I think I need to do serial forking. I don't want to have a situation where the registration  gets delivered to two IP's on the same host because both happen to be available. I don't think Asterisk will have a problem with it, but to be safe I'd like to avoid that. So, back to my original logic of trying first ip on first Asterisk box, if that fails try second ip on first Asterisk box. Then, move onto the next and repeat the process.

With pareallel forking, what happens with failures? Does a failure of any single host in destination set cause an error that can be handled with failure_route? Or, do all hosts have to fail before you can detect an error? How can you determine which one failed?

I don't think parallel forking is what I need, but thanks for clearing that up for me.

Doug.

-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:bogdan at voice-system.ro]
Sent: Wednesday, December 14, 2005 8:55 AM
To: Douglas Garstang
Cc: users at openser.org
Subject: Re: [Users] Routing Examples


Hi Doug,

if you have:

rewritehostport("192.168.10.7:5060");
t_on_failure("2");
t_relay();

failure_route[2] {
	rewritehostport("192.168.10.7:5060");
	append_branch();
	t_relay();
}

you do serial forking - try first destination and if fails, o for the 
second one.

for:

rewritehostport("192.168.10.7:5060");
append_branch("192.168.10.7:5060");
t_relay()

you do parallel forking - the request will be sent in the same time to 
all destinations.

regards,
bogdan

Douglas Garstang wrote:

>I'm having a terrible time trying to get failure routes to work. Can someone point me to some USEFUL examples please? The examples that come with OpenSER are trivial. They all use append_branch("sip:user at domain") which in the real world is barely useful. I need to try sending messages to a specified host with the current user's URI.
>
>For example, is this the correct usage for trying to connect in sequence to multple destinations?
>
>rewritehostport("192.168.10.7:5060");
>append_branch();
>t_on_failure("2");
>t_relay();
>
>failure_route[2] {
>	rewritehostport("192.168.10.7:5060");
>	append_branch();
>	t_relay();
>}
>
>The second route is never tried. In general, what should I be doing here? 
>Which is correct?
>
>rewritehostport(ip-addr)
>append_branch()
>t_relay()
>
>or maybe...
>append_branch(ip-addr)
>t_relay()
>
>or maybe...
>append_branch(ip-addr1)
>append_branch(ip-addr2)
>t_relay()
>
>Do you get my point? The docs are really bad and don't cover exactly how this stuff is supposed to be implemented! if I do a google search on this stuff, I get almost no matches. There's no books either. I'm out of ideas.
>
>I'm just trying to connect to multiple destinations in sequence....
>
>
>
>
>_______________________________________________
>Users mailing list
>Users at openser.org
>http://openser.org/cgi-bin/mailman/listinfo/users
>
>  
>





More information about the sr-users mailing list