[sr-dev] Delayed branches?

Nathan Angelacos nangelacos at genericconf.com
Wed Jun 30 20:56:26 CEST 2010


Hi jasmin,

On 06/30/10 07:25, Iñaki Baz Castillo wrote:
> 2010/6/30 Jasmin Schnatterbeck<js at data-cmr.net>:
>> Hi,
>>
>> the idea is to do parallel forking (not wait for reply or timeout), but
>> wait (for each branch) a specific amount of seconds, before sending out
>> the INVITE request to the contact.

if I understand you correctly,

You have 3 contacts:  UA-A, UA-B, UA-C

You want:

	INVITE to UA-A
	[no response then] INVITE UA-A *and* UA-B
	[no response then] INVITE UA-A *and* UA-B *and* UA-C
	
So its a serial set of parallel forks?

In that case, its just a case of loading up your branches correctly.

I am not an expert, and my experience is with kamailio 1.5, but it seems 
that from your initial contact lookup you should have 3 contacts with 
different q values.

For example, if we were building it by hand, it might be:

	append_branch ("ua-a at foo.com", "0.9")
	append_branch ("ua-b at bar.com", "0.5")
	append_branch ("ua-c at baz.com", "0.2")


You'd just make sure that you *additionally* had:
	append_branch ("ua-a at foo.com", "0.5")

	append_branch ("ua-a at foo.com", "0.2")
	append_branch ("ua-b at bar.com", "0.2")

When you do the t_load_contacts, it would sort all the branches into 3 
sets (0.9, 0.5, 0.2), with increasing numbers of contacts (a, a+b, a+b+c)

your failure route just re-arms itself and loads the next group of contacts:
failure_route[1] { 

         t_on_failure("1");
         if (t_next_contacts()) {
                 t_relay();
                 } 









More information about the sr-dev mailing list