[Serusers] How to do a large number of relay attempts?

Greger V. Teigre greger at teigre.com
Wed Nov 23 08:09:15 CET 2005


Tim,
There are two different types of branches: parallel and serial.  If you 
branch in parallel, you append branches before t_relay and INVITEs are sent 
out to ALL the branches at the same time.  Serial branches are created in 
on_failure and a new INVITE is sent when the first timed out, received busy 
etc.  AFAIK the limit to the number of branches is for parallel branches.
To your last question: A message is by definition (RFC) tightly connected to 
a branch.
g-)

----- Original Message ----- 
From: "Tim Klein" <tkpublic at timklein.fastmail.fm>
To: "Greger V. Teigre" <greger at teigre.com>; <serusers at lists.iptel.org>; 
<serdev at lists.iptel.org>
Sent: Tuesday, November 22, 2005 7:07 PM
Subject: Re: [Serusers] How to do a large number of relay attempts?


> Thank you for the response, Greger!  On your suggestion, I've read about 
> the LCR module, and it does seem useful here.  But the LCR functions (such 
> as next_contacts()) also work by appending branches.
>
> Am I correct in thinking that SER is not able to make more than 31 
> attempts to relay an INVITE, because it is not able to append more than 31 
> branches?  (This question may be better for the developers mailing list, 
> so I'm cross-posting there.)
>
> If I am correct about that, then can anyone suggest a way to statefully 
> forward an INVITE without appending a branch?
>
> Thank you in advance!
>
> Tim
>
> At 6:46 AM +0100 11/22/05, Greger V. Teigre wrote:
>>Yes, you need to append a new branch to initiate a new transaction. Your 
>>best bet, however, is to use lcr module and the q-value to serialize the 
>>contacts. LCR is in CVS head and in the experimental module for 0.9.x.
>>g-)
>>----- Original Message ----- From: "Tim Klein" 
>><tkpublic at timklein.fastmail.fm>
>>To: <serusers at lists.iptel.org>
>>Sent: Tuesday, November 22, 2005 2:39 AM
>>Subject: [Serusers] How to do a large number of relay attempts?
>>
>>>Imagine I have 50 salespeople, and I know the URIs of all of their 
>>>phones. When an INVITE comes in to SER, I want to keep trying to forward 
>>>it to the salespeople, one at a time (in series, not in parallel), 
>>>forever or until one of them accepts the call.  (I randomize the order.)
>>>
>>>QUESTION 1:
>>>At first, I tried rewriting the Request URI in a failure route each time 
>>>t_relay() returned failure, and then calling t_relay() again. But 
>>>t_relay() doesn't work that way -- when used in a failure route, it 
>>>requires you to append a branch, and apparently ignores any changes in 
>>>the Request URI after the failure happens.
>>>
>>>OK, so in my failure route, I'll append a branch instead of rewriting the 
>>>Request URI.  But the default value of MAX_BRANCHES in config.h is only 
>>>12.  I think this means I can never try to relay to more than 13 
>>>salespeople -- the first t_relay() call, plus 12 t_relay() calls in 
>>>failure routes.  Is this correct?
>>>
>>>QUESTION 2:
>>>OK, so I'll make the value of MAX_BRANCHES greater than 12.  But I see in 
>>>modules/tm/tm.c that MAX_BRANCHES cannot be given a value greater than 
>>>31, since each branch occupies one bit in a 32-bit bitmap.  So how can I 
>>>do 50 stateful relays?  Or, for that matter, an indefinite number?
>>>
>>>Thank you for any help!
>>>
>>>Tim
>
> 




More information about the sr-users mailing list