[asterisk-users] Dealing with 2 SIP providers

Brad Templeton brad+aster at templetons.com
Fri May 18 21:21:38 MST 2007


On Fri, May 11, 2007 at 11:06:35AM -0400, Mike wrote:
> Hi,
>  
> I have a question of using 2 SIP providers.  Let's say I have provider A and
> provider B, and I would like my calls to go to A, and then B if A wasn`t
> available


What would be really cool, but require special code in the chan_sip
dialer, would be automatic support of multiple providers in a similar
fashion to the way Asterisk can ring two channels and only talk to
the first to answer.

You can't just do this with outgoing providers, because if you try to
ring two at once, you may very well have the second one go to
a voicemail and thus answer right away (because the first is
ringing) and you would treat that as the success.

What I have in mind is something like this:

    a) Invite to main provider
    b) Await some intermediate response, such as a RINGING code
       or some early media
    c) If you don't get that after a short timeout (more like 5 seconds)
       then INVITE the second provider
    d) Upon the receipt of a ringing or early media code from either,
       CANCEL the other.

Now you would have to get your timings right because there could still
be risk of doing something bad, such as a 2nd call going to voice mail
or residual ringing making a call waiting on the recipient.  (I don't
know what typical 5ess do with a 2nd call that comes in while still
ringing, anybody known?)

Anyway, this could be a good course when a provider has known
unreliability.   Long timeouts and restarts are very annoying to
users.


More information about the asterisk-users mailing list