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 Something like this would work: exten => 1234,1,Dial(SIP/providerA) exten => 1234,2,Dial(providerB) exten => 1234,3,Hangup But what if I want to put in a delay? If I put 30 seconds on each of them, I'll wait a total of 60. I want to wait only 30 seconds before the hang up. Also, if ProviderA has a main server and a backup server, am I now forced to have 3 Dial commands, or can I setup ProviderA with host and backuphost in the same SIP entry? Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20070511/9c4a2fc4/attachment.htm
>From: Mike <list@virtutel.ca> >Date: Fri, 11 May 2007 11:06:35 -0400 > >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 > >Something like this would work: >exten => 1234,1,Dial(SIP/providerA) >exten => 1234,2,Dial(providerB) >exten => 1234,3,Hangup > >But what if I want to put in a delay? If I put 30 seconds on each of them, >I'll wait a total of 60. I want to wait only 30 seconds before the hang >up.Like put 15 seconds on each? It's quite hard to understand what exactly the requirements are. Yuan Liu>Also, if ProviderA has a main server and a backup server, am I now forced >to >have 3 Dial commands, or can I setup ProviderA with host and backuphost in >the same SIP entry? > >Mike
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 > availableWhat 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.
You can just do it in the dialplan without changing an code. Thanks, Steve Totaro http://www.asteriskhelpdesk.com KB3OPB> -----Original Message----- > From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users- > bounces@lists.digium.com] On Behalf Of Brad Templeton > Sent: Saturday, May 19, 2007 12:22 AM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] Dealing with 2 SIP providers > > 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 haveprovider A> and > > provider B, and I would like my calls to go to A, and then B if Awasn`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 5seconds)> 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. > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
I would suggest you at least look into DIALSTATUS. Guys: The dialplan is not a toy. You need to consider with care the results of your actions. What Mike posted is an example of a bad dialplan in the works. On 5/11/07, Mike <list@virtutel.ca> 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 > > Something like this would work: > exten => 1234,1,Dial(SIP/providerA) > exten => 1234,2,Dial(providerB) > exten => 1234,3,Hangup > > But what if I want to put in a delay? If I put 30 seconds on each of them, > I'll wait a total of 60. I want to wait only 30 seconds before the hang up. > > Also, if ProviderA has a main server and a backup server, am I now forced to > have 3 Dial commands, or can I setup ProviderA with host and backuphost in > the same SIP entry? > > Mike > > > > > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > > http://lists.digium.com/mailman/listinfo/asterisk-users > >