Re: [asterisk-users] PSTN failover

2007-10-16 Thread Atis Lezdins
On Tuesday 16 October 2007 06:21:45 Andrew Kohlsmith wrote:
 GotoIf($[${DIALSTATUS} = BUSY]?busy)
 GotoIf($[${DIALSTATUS} = NOANSWER]?noanswer)
 GotoIf($[${DIALSTATUS} = ANSWERED]?answered)
 Dial(Zap/...)

 Of course, I do this inside a macro, and I emit correct CDR and correct
 hangupcauses for those who use my system.

 Dialing twice like that without checking your return value is an invitation
 for future problems.

Well, as far as i have tried - i never get ANSWERED in DIALSTATUS. Only thing 
that continues is h extension.

Regards,
Atis

-- 
Atis Lezdins
VoIP Developer,
IQ Labs Inc.
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Work phone: +1 800 7502835

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] PSTN failover

2007-10-16 Thread Dovid B

- Original Message - 
From: Mojo with Horan  Company, LLC [EMAIL PROTECTED]
To: Asterisk Users Mailing List - Non-Commercial Discussion 
asterisk-users@lists.digium.com
Sent: Tuesday, October 16, 2007 1:20 AM
Subject: Re: [asterisk-users] PSTN failover


 Dovid B wrote:
 Chanisavail does not work well for this. I would use priority jumping
 (n+101).

 Using ChanIsAvail with the 's' option is supposed to assume a SIP
 channel is occupied if it's in use ANYWHERE under asterisk's wing.   For
 clarification, Dovid, have your poor experiences occurred with the 's'
 or without?  I tell myself I've been meaning to switch away from
 priority jumping into using chanisavail, but always just assumed that
 the 's' options was all I would need to use when it came time

It was not with s.  I was with Exten = 
_X.,ChanisAvail(.. 



___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] PSTN failover

2007-10-16 Thread Dovid B

- Original Message - 
From: Alex Balashov [EMAIL PROTECTED]
To: Asterisk Users Mailing List - Non-Commercial Discussion 
asterisk-users@lists.digium.com
Sent: Tuesday, October 16, 2007 1:12 AM
Subject: Re: [asterisk-users] PSTN failover


 On Tue, 16 Oct 2007, Dovid B wrote:

 Chanisavail does not work well for this. I would use priority jumping
 (n+101).

   Why not?

I have seen where it will go to n+101 when the trunk was in use as well as 
the carrier may be up but it may reject the call. First see if they take the 
call if not we can always send it else where. 



___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] PSTN failover

2007-10-16 Thread Andrew Kohlsmith
On Tuesday 16 October 2007 03:49:37 Atis Lezdins wrote:
 Well, as far as i have tried - i never get ANSWERED in DIALSTATUS. Only
 thing that continues is h extension.

You must of course use 'g' in the Dial flags so that it continues on in the 
dialplan after hangup...

-A.

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] PSTN failover

2007-10-15 Thread Robert McNaught
Hi,

Does anyone have any advice in how to implement PSTN failover should an
internet connection for IAX trunking go down? to route outbound to
analog lines

Can this be written into the dialplan using a GotoIf statement by
testing the whether the internet connection is up, or from a IAX/SIP
response?

Thanks

Robert McNaught
___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] PSTN failover

2007-10-15 Thread Alex Balashov
On Mon, 15 Oct 2007, Robert McNaught wrote:

 Does anyone have any advice in how to implement PSTN failover should an
 internet connection for IAX trunking go down? to route outbound to
 analog lines

 Can this be written into the dialplan using a GotoIf statement by
 testing the whether the internet connection is up, or from a IAX/SIP
 response?

   In the dial plan, you can simply have a second instruction with
another Dial() command that will only be hit if the first Dial()
command fails.  This is automatic behaviour.

   Or, if you prefer, you can use ChanAvail() to check if the SIP / IAX
trunk is up and that reachability through it has been verified through
'qualify=' (if you have this turned on), and in the event that it is not,
use GotoIf() to route out to the PSTN via analog lines, like you said.

--
Alex Balashov
Evariste Systems
Web: http://www.evaristesys.com/
Tel: +1-678-954-0670
Direct : +1-678-954-0671

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] PSTN failover

2007-10-15 Thread Dovid B
Chanisavail does not work well for this. I would use priority jumping 
(n+101).

- Original Message - 
From: Alex Balashov [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; Asterisk Users Mailing List - 
Non-Commercial Discussion asterisk-users@lists.digium.com
Sent: Monday, October 15, 2007 6:47 PM
Subject: Re: [asterisk-users] PSTN failover


 On Mon, 15 Oct 2007, Robert McNaught wrote:

 Does anyone have any advice in how to implement PSTN failover should an
 internet connection for IAX trunking go down? to route outbound to
 analog lines

 Can this be written into the dialplan using a GotoIf statement by
 testing the whether the internet connection is up, or from a IAX/SIP
 response?

   In the dial plan, you can simply have a second instruction with
 another Dial() command that will only be hit if the first Dial()
 command fails.  This is automatic behaviour.

   Or, if you prefer, you can use ChanAvail() to check if the SIP / IAX
 trunk is up and that reachability through it has been verified through
 'qualify=' (if you have this turned on), and in the event that it is not,
 use GotoIf() to route out to the PSTN via analog lines, like you said.

 --
 Alex Balashov
 Evariste Systems
 Web: http://www.evaristesys.com/
 Tel: +1-678-954-0670
 Direct : +1-678-954-0671

 ___
 --Bandwidth and Colocation Provided by http://www.api-digital.com--

 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
 



___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] PSTN failover

2007-10-15 Thread Alex Balashov
On Tue, 16 Oct 2007, Dovid B wrote:

 Chanisavail does not work well for this. I would use priority jumping 
 (n+101).

   Why not?

--
Alex Balashov
Evariste Systems
Web: http://www.evaristesys.com/
Tel: +1-678-954-0670
Direct : +1-678-954-0671

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] PSTN failover

2007-10-15 Thread Mojo with Horan Company, LLC
Dovid B wrote:
 Chanisavail does not work well for this. I would use priority jumping 
 (n+101).
   
Using ChanIsAvail with the 's' option is supposed to assume a SIP 
channel is occupied if it's in use ANYWHERE under asterisk's wing.   For 
clarification, Dovid, have your poor experiences occurred with the 's' 
or without?  I tell myself I've been meaning to switch away from 
priority jumping into using chanisavail, but always just assumed that 
the 's' options was all I would need to use when it came time

Thanks!

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] PSTN failover

2007-10-15 Thread Philipp Kempgen
Alex Balashov wrote:

 On Tue, 16 Oct 2007, Dovid B wrote:
 
 Chanisavail does not work well for this. I would use priority jumping 
 (n+101).
 
Why not?

Priority jumping is no solution to failover, it's just an ugly
hack. ;)

I'd basically just Dial() 2 times:

Dial(SIP/...);
Dial(Zap/...);

No need for priority jumping. And not need to check if
the ChanIsAvail(). Just Dial().

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
Let's use IT to solve problems and not to create new ones.
  Asterisk? - http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] PSTN failover

2007-10-15 Thread Philipp Kempgen
I don't really understand how ChanIsAvail() can be of any use.
Even if it tells you that the channel is available there's no
guarantee that the call will go through.
And moreover between the ChanIsAvail() check and the Dial()
command someone else could have taken the channel.

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
Let's use IT to solve problems and not to create new ones.
  Asterisk? - http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] PSTN failover

2007-10-15 Thread Andrew Kohlsmith
On Monday 15 October 2007 19:50:03 Philipp Kempgen wrote:
 I'd basically just Dial() 2 times:
 Dial(SIP/...);
 Dial(Zap/...);

 No need for priority jumping. And not need to check if
 the ChanIsAvail(). Just Dial().

Why not just do it the correct way?

Dial(SIP/,,g)
GotoIf($[${DIALSTATUS} = BUSY]?busy)
GotoIf($[${DIALSTATUS} = NOANSWER]?noanswer)
GotoIf($[${DIALSTATUS} = ANSWERED]?answered)
Dial(Zap/...)

Of course, I do this inside a macro, and I emit correct CDR and correct 
hangupcauses for those who use my system.

Dialing twice like that without checking your return value is an invitation 
for future problems.

-A.

___
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users