[asterisk-users] SIP failover between Sip Providers

2007-04-18 Thread Knud Müller

Hi all,

lets say I've registered at several Sip-Providers. Provider A offers 
best rates but is often too busy to get a line. Sip Provider B is stable 
(but more expensive). The asterisk box has a high call volume therefore 
problems at provider A will get obvious after a few calls stalled. In 
this case astersik shall switch temporarily to provider B but shall test 
periodically for selected calls if provider A is available again. I 
think it can be done by using the dialplan and the database to store the 
statistical information but maybe there is an easier way that integrates 
better with asterisk!?


regards,

--
Knud A. Müller

___
--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


Re: [asterisk-users] SIP failover between Sip Providers

2007-04-18 Thread Dinesh Nair
On Wed, 18 Apr 2007 09:04:22 +0200, Knud Müller wrote:

 I 
 think it can be done by using the dialplan and the database to store the 
 statistical information but maybe there is an easier way that integrates 
 better with asterisk!?

i dont think you'd even need a database with statistics. just have all
calls sent to provider A with an automatic failover to provider B if the
call can't be completed through A. you'd need to go look at the DIALSTATUS
variable for that.

-- 
Regards,   /\_/\   All dogs go to heaven.
[EMAIL PROTECTED](0 0)   http://www.openmalaysiablog.com/
+==oOO--(_)--OOo==+
| for a in past present future; do|
|   for b in clients employers associates relatives neighbours pets; do   |
|   echo The opinions here in no way reflect the opinions of my $a $b.  |
| done; done  |
+=+
___
--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


Re: [asterisk-users] SIP failover between Sip Providers

2007-04-18 Thread Knud Müller

Dinesh Nair wrote:


On Wed, 18 Apr 2007 09:04:22 +0200, Knud Müller wrote:

 

I 
think it can be done by using the dialplan and the database to store the 
statistical information but maybe there is an easier way that integrates 
better with asterisk!?
   



i dont think you'd even need a database with statistics. just have all
calls sent to provider A with an automatic failover to provider B if the
call can't be completed through A. you'd need to go look at the DIALSTATUS
variable for that.

 

The disadvantage of that solution is, that I'll always try to make a 
connection with a provider for that I know by experience it wouldn't 
work. In the failover case the time between starting to dial and the 
first ring gets longer. If I know that Provider A fails 60% of Calls 
then I don't need to start with a but can start with b directly.


--
Knud A. Müller


___
--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


Re: [asterisk-users] SIP failover between Sip Providers

2007-04-18 Thread Anselm Martin Hoffmeister
Am Mittwoch, den 18.04.2007, 13:18 +0200 schrieb Knud Müller:
 Dinesh Nair wrote:
 On Wed, 18 Apr 2007 09:04:22 +0200, Knud Müller wrote:
 
 I 
 think it can be done by using the dialplan and the database to store the 
 statistical information but maybe there is an easier way that integrates 
 better with asterisk!?
 
 i dont think you'd even need a database with statistics. just have all
 calls sent to provider A with an automatic failover to provider B if the
 call can't be completed through A. you'd need to go look at the DIALSTATUS
 variable for that.
 
 The disadvantage of that solution is, that I'll always try to make a 
 connection with a provider for that I know by experience it wouldn't 
 work. In the failover case the time between starting to dial and the 
 first ring gets longer. If I know that Provider A fails 60% of Calls 
 then I don't need to start with a but can start with b directly.

Hi Knud,

I think what you want is a combination of both.

If indeed DIALSTATUS reveals that provider A is having his five
minutes (again), the first call that notices this could set a database
flag, say, DB(a-is-crappy) to the current time value.

All calls could, before trying provider A, retrieve this value - if the
last crap moment was less than 300 seconds ago, just skip A and go for
B immediately. This way, no more than one call per 300 seconds should be
delayed - except of course, when those 300 timed out and two outgoing
calls start before any of those returns the bad DIALSTATUS. Anyway, they
will block the provider A again if he continues having moments, but
will allow using A as long as that works fine.

You should take extra care to distinguish DIALSTATUS cases; a call that
could not be terminated because the number was invalid should better not
block provider A if this can be distinguished.

Anselm('s 2 cent)

___
--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


Re: [asterisk-users] SIP failover between Sip Providers

2007-04-18 Thread Knud Müller

Anselm Martin Hoffmeister wrote:


Am Mittwoch, den 18.04.2007, 13:18 +0200 schrieb Knud Müller:
 


Dinesh Nair wrote:
   


On Wed, 18 Apr 2007 09:04:22 +0200, Knud Müller wrote:

 

I 
think it can be done by using the dialplan and the database to store the 
statistical information but maybe there is an easier way that integrates 
better with asterisk!?
   


i dont think you'd even need a database with statistics. just have all
calls sent to provider A with an automatic failover to provider B if the
call can't be completed through A. you'd need to go look at the DIALSTATUS
variable for that.

 

The disadvantage of that solution is, that I'll always try to make a 
connection with a provider for that I know by experience it wouldn't 
work. In the failover case the time between starting to dial and the 
first ring gets longer. If I know that Provider A fails 60% of Calls 
then I don't need to start with a but can start with b directly.
   



Hi Knud,

I think what you want is a combination of both.

If indeed DIALSTATUS reveals that provider A is having his five
minutes (again), the first call that notices this could set a database
flag, say, DB(a-is-crappy) to the current time value.

All calls could, before trying provider A, retrieve this value - if the
last crap moment was less than 300 seconds ago, just skip A and go for
B immediately. This way, no more than one call per 300 seconds should be
delayed - except of course, when those 300 timed out and two outgoing
calls start before any of those returns the bad DIALSTATUS. Anyway, they
will block the provider A again if he continues having moments, but
will allow using A as long as that works fine.

You should take extra care to distinguish DIALSTATUS cases; a call that
could not be terminated because the number was invalid should better not
block provider A if this can be distinguished.

Anselm('s 2 cent)

___
--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

 


Yeah,

I think that would be a solution. I'm a little confused. It seems like 
I'm the first one with such a demand? I'd expected that there is 
something out of the box as asterisk has for nearly every problem 
something someone already solved


When I made it I'll post it...

Knud

--
Knud A. Müller


___
--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


Re: [asterisk-users] SIP failover between Sip Providers

2007-04-18 Thread Alex Balashov


On Wed, 18 Apr 2007, Knud Müller said something to this effect:


Hi all,

lets say I've registered at several Sip-Providers. Provider A offers best 
rates but is often too busy to get a line. Sip Provider B is stable (but 
more expensive). The asterisk box has a high call volume therefore 
problems at provider A will get obvious after a few calls stalled. In 
this case astersik shall switch temporarily to provider B but shall test 
periodically for selected calls if provider A is available again. I think 
it can be done by using the dialplan and the database to store the 
statistical information but maybe there is an easier way that integrates 
better with asterisk!?


  Best way to do this in my opinion is to deputise this logic to a SIP 
proxy and have Asterisk trunk all of its calls through that.


--
Alex Balashov [EMAIL PROTECTED]___
--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