Re: [Asterisk-Users] How to detect AGI script failure?

2005-11-08 Thread Alex Hutton
Thanks for the replies.  I have realised that I can catch the execution 
after the agi statement (if it fails) in the h priority, which I then 
use to play an error message to the caller.


As you suggested, I am setting a variable in the agi script so that the 
h priority knows whether the agi script succeeded or not.


Alex



Matt Riddell wrote:

Alex Hutton wrote:


Hello,

I'm new to the list so I hope I'm asking the question in the right
place.  In our extensions.conf, we call an AGI script using the AGI
command.

e.g.

exten = 11,1,Answer
exten = 11,2,Wait(0.5)
exten = 11,3,Playback(welcome1)
exten = 11,4,agi(agi://192.168.1.88/hello.agi?src=test|${CALLERID})



If for some reason, the AGI script fails to run (e.g. our AGI prog isn't
running), can we detect it and direct the call to a pre-recorded message?



What I personally would do is first set a variable before you run the agi
(i.e. completionstatus to beforerun) then run the AGI.  Once inside the AGI,
set the variable for completion status.  I.E. you could have ran well, failed
with x etc etc.  Then on the next priority, you can check this variable and
via gotoif for the various statuses (including beforerun which would mean
that the AGI didn't run at all).

While this doesn't exactly answer your question, it is the best way to use
multiple statuses.

Make sense?



___
--Bandwidth and Colocation sponsored by Easynews.com --

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


Re: [Asterisk-Users] How to detect AGI script failure?

2005-11-04 Thread Matt Riddell
Alex Hutton wrote:
 Hello,
 
 I'm new to the list so I hope I'm asking the question in the right
 place.  In our extensions.conf, we call an AGI script using the AGI
 command.
 
 e.g.
 
 exten = 11,1,Answer
 exten = 11,2,Wait(0.5)
 exten = 11,3,Playback(welcome1)
 exten = 11,4,agi(agi://192.168.1.88/hello.agi?src=test|${CALLERID})
 
 
 
 If for some reason, the AGI script fails to run (e.g. our AGI prog isn't
 running), can we detect it and direct the call to a pre-recorded message?

What I personally would do is first set a variable before you run the agi
(i.e. completionstatus to beforerun) then run the AGI.  Once inside the AGI,
set the variable for completion status.  I.E. you could have ran well, failed
with x etc etc.  Then on the next priority, you can check this variable and
via gotoif for the various statuses (including beforerun which would mean
that the AGI didn't run at all).

While this doesn't exactly answer your question, it is the best way to use
multiple statuses.

Make sense?

-- 
Cheers,

Matt Riddell
___

http://www.sineapps.com/news.php (Daily Asterisk News - html)
http://freevoip.gedameurope.com (Free Asterisk Voip Community)
http://www.sineapps.com/rssfeed.php (Daily Asterisk News - rss)

___
--Bandwidth and Colocation sponsored by Easynews.com --

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


Re: [Asterisk-Users] How to detect AGI script failure?

2005-11-04 Thread asterisk
How about agi debug on the CLI?


 Alex Hutton wrote:
  Hello,
 
  I'm new to the list so I hope I'm asking the question in the right
  place.  In our extensions.conf, we call an AGI script using the AGI
  command.
 
  e.g.
 
  exten = 11,1,Answer
  exten = 11,2,Wait(0.5)
  exten = 11,3,Playback(welcome1)
  exten = 11,4,agi(agi://192.168.1.88/hello.agi?src=test|${CALLERID})
 
 
 
  If for some reason, the AGI script fails to run (e.g. our AGI prog isn't
  running), can we detect it and direct the call to a pre-recorded
message?

 What I personally would do is first set a variable before you run the agi
 (i.e. completionstatus to beforerun) then run the AGI.  Once inside the
AGI,
 set the variable for completion status.  I.E. you could have ran well,
failed
 with x etc etc.  Then on the next priority, you can check this variable
and
 via gotoif for the various statuses (including beforerun which would
mean
 that the AGI didn't run at all).

 While this doesn't exactly answer your question, it is the best way to use
 multiple statuses.

 Make sense?

 -- 
 Cheers,

 Matt Riddell
 ___

 http://www.sineapps.com/news.php (Daily Asterisk News - html)
 http://freevoip.gedameurope.com (Free Asterisk Voip Community)
 http://www.sineapps.com/rssfeed.php (Daily Asterisk News - rss)

 ___
 --Bandwidth and Colocation sponsored by Easynews.com --

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



 -- 
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.1.362 / Virus Database: 267.12.7/160 - Release Date: 11/3/2005



___
--Bandwidth and Colocation sponsored by Easynews.com --

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


[Asterisk-Users] How to detect AGI script failure?

2005-11-03 Thread Alex Hutton

Hello,

I'm new to the list so I hope I'm asking the question in the right 
place.  In our extensions.conf, we call an AGI script using the AGI command.


e.g.

exten = 11,1,Answer
exten = 11,2,Wait(0.5)
exten = 11,3,Playback(welcome1)
exten = 11,4,agi(agi://192.168.1.88/hello.agi?src=test|${CALLERID})



If for some reason, the AGI script fails to run (e.g. our AGI prog isn't 
running), can we detect it and direct the call to a pre-recorded message?


When I look at the documentation, it says agi returns -1 if there is a 
problem, which (as far as I understand) means the call is hung up. I 
don't know how to detect this condition and handle the call appropriately.


Thanks for any help,

Alex
___
--Bandwidth and Colocation sponsored by Easynews.com --

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