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