|
List Info
Thread: AGI and DeadAGI
|
|
| AGI and DeadAGI |
  New Zealand |
2007-07-23 22:43:56 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This is just a quick query regarding the latest change to
report an
error if DeadAGI is used on a live channel. (New Revision:
75437)
If you have an AGI that you need to keep running after the
channel has
terminated (I.E. routing and billing), I was under the
assumption that
DeadAGI was the better to use.
- From VoIP-Info:
============================================================
==========
The main difference is that the AGI application *may
terminate* if the
line is hung up during execution and DeadAGI will not
terminate even if
the call is hung up during execution, however, the call leg
will not
automatically enter a "down" state until execution
is completed if
executed on a live line. As such, commands and applications
designed to
return the call state will inaccurately return an
"up" status.
============================================================
==========
The latest version states:
Running DeadAGI on a live channel will cause problems,
please use AGI
So, what are we supposed to use if we want to run an AGI on
a live
channel and continue processing after hangup?
I know this is "-user"ish but I was hoping juggie
might be able to
respond as he wrote the patch.
Are we fine using AGI in this situation? If so, I'll update
the wiki to
be a bit more verbose.
- --
Cheers,
Matt Riddell
Director
_______________________________________________
http://www.venturevoip.com
(Great new VoIP end to end solution)
http://feeds
.feedburner.com/AsteriskNews (Daily Asterisk News -
rss)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGpXV8DQNt8rg0Kp4RAlYhAJwMfUBwtDpra7mcsTo/E/vcPKAv1ACf
ZNGt
WBvlqVsgV5ArvC04I8dSqfU=
=y8oZ
-----END PGP SIGNATURE-----
_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
|
|
| Re: AGI and DeadAGI |
  United States |
2007-07-24 11:58:47 |
Matt Riddell wrote:
>
> Are we fine using AGI in this situation? If so, I'll
update the wiki to
> be a bit more verbose.
>
A running AGI script should not be terminated when the line
is hung up.
Asterisk should send the script SIGHUP when it closes the
pipe to the
script. After the SIGHUP is sent, attempts to communicate
with asterisk
will result in SIGPIPE.
Properly handling SIGHUP and SIGPIPE should prevent your
scripts from
automatically getting terminated.
--
Matthew Nicholson
Digium
_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
|
|
| Re: AGI and DeadAGI |
  United States |
2007-07-24 12:17:35 |
On Tue, 24 Jul 2007, Matthew Nicholson wrote:
> Matt Riddell wrote:
>>
>> Are we fine using AGI in this situation? If so,
I'll update the wiki to
>> be a bit more verbose.
>>
>
> A running AGI script should not be terminated when the
line is hung up.
> Asterisk should send the script SIGHUP when it closes
the pipe to the
> script. After the SIGHUP is sent, attempts to
communicate with asterisk
> will result in SIGPIPE.
>
> Properly handling SIGHUP and SIGPIPE should prevent
your scripts from
> automatically getting terminated.
If I'm using AGI() and there is a hangup or a disconnect
or congestion, do
I get a final status of the call? Or must I then use a
dialplan that
executes deadAGI() in order to get the channel variables
such as
DIALSTATUS in order to do custom CDRs and such?
Beckman
------------------------------------------------------------
---------------
Peter Beckman
Internet Guy
beckman angryox.com http://www.angryox.com/
------------------------------------------------------------
---------------
** PLEASE NOTE PurpleCow.com IS NOW AngryOx.com DO NOT USE
PurpleCow.com **
** PurpleCow.com is now owned by City Auto Credit LLC as of
May 23, 2007 **
------------------------------------------------------------
---------------
_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
|
|
| Re: AGI and DeadAGI |
  United States |
2007-07-24 12:44:54 |
On Tuesday 24 July 2007 11:58, Matthew Nicholson wrote:
> Matt Riddell wrote:
> > Are we fine using AGI in this situation? If so,
I'll update the
> > wiki to be a bit more verbose.
>
> A running AGI script should not be terminated when the
line is hung
> up. Asterisk should send the script SIGHUP when it
closes the pipe to
> the script. After the SIGHUP is sent, attempts to
communicate with
> asterisk will result in SIGPIPE.
>
> Properly handling SIGHUP and SIGPIPE should prevent
your scripts from
> automatically getting terminated.
Starting in the next release, Asterisk will automatically
transition
between live and dead mode for AGI scripts. You'll still
get the SIGHUP
on hangup to signal the transition, but Asterisk won't close
the control
pipe until the AGI process closes it (or dies). This also
means that
DeadAGI will be obsolete, as we will determine the correct
mode of
AGI operation from channel state, rather than how it's
invoked.
--
Tilghman
_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
|
|
| Re: AGI and DeadAGI |
  United States |
2007-07-24 13:31:08 |
Tilghman Lesher wrote:
> Starting in the next release, Asterisk will
automatically transition
> between live and dead mode for AGI scripts. You'll
still get the SIGHUP
> on hangup to signal the transition, but Asterisk won't
close the control
> pipe until the AGI process closes it (or dies). This
also means that
> DeadAGI will be obsolete, as we will determine the
correct mode of
> AGI operation from channel state, rather than how it's
invoked.
Very cool.
--
Matthew Nicholson
Digium
_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
|
|
| Re: AGI and DeadAGI |
  United States |
2007-07-24 13:34:23 |
Peter Beckman wrote:
> On Tue, 24 Jul 2007, Matthew Nicholson wrote:
>
>> Matt Riddell wrote:
>>>
>>> Are we fine using AGI in this situation? If
so, I'll update the wiki to
>>> be a bit more verbose.
>>>
>>
>> A running AGI script should not be terminated when
the line is hung up.
>> Asterisk should send the script SIGHUP when it
closes the pipe to the
>> script. After the SIGHUP is sent, attempts to
communicate with asterisk
>> will result in SIGPIPE.
>>
>> Properly handling SIGHUP and SIGPIPE should prevent
your scripts from
>> automatically getting terminated.
>
> If I'm using AGI() and there is a hangup or a
disconnect or congestion, do
> I get a final status of the call? Or must I then use
a dialplan that
> executes deadAGI() in order to get the channel
variables such as
> DIALSTATUS in order to do custom CDRs and such?
Well, once the SIGHUP is sent, you no longer will be able to
get channel
variables from asterisk. If you did something like 'EXEC
Dial Zap/1'
you may be able to get the DIALSTATUS from asterisk before
the SIGHUP if
the originating channel is still up.
The most straight forward way to do that is just to execute
a DeadAGI
from the 'h' exten.
--
Matthew Nicholson
Digium
_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
|
|
| Re: AGI and DeadAGI |
  New Zealand |
2007-07-24 14:10:06 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Matthew Nicholson wrote:
> Well, once the SIGHUP is sent, you no longer will be
able to get channel
> variables from asterisk. If you did something like
'EXEC Dial Zap/1'
> you may be able to get the DIALSTATUS from asterisk
before the SIGHUP if
> the originating channel is still up.
>
> The most straight forward way to do that is just to
execute a DeadAGI
> from the 'h' exten.
So to sum up (for 1.4 at least - does this apply to 1.2
also?):
1. Run your AGI which looks up routing details and gets
credit level
2. Exec Dial of technology
3. Finish processing of AGI and hand back to Asterisk
(setting variables
such as the 'provider you used to make the call with' as
channel
variables - will this work - i.e. will you still be able to
access
channel variables in the h extension?)
4. In the 'h' extension run a DeadAGI which reads in the
variables
created in (3), checks dialstatus and deducts credit/creates
custom CDR.
The change that went into SVN just seemed to document a
possible failure
instead of actually preventing anything happening. I'm
guessing this
means it has worked as above for some time and that the
process I was
(am) using to lookup credit, dial, update credit etc is only
working
because my DeadAGI script is lucky with regards to getting
the DialStatus?
- --
Cheers,
Matt Riddell
Director
_______________________________________________
http://www.venturevoip.com
(Great new VoIP end to end solution)
http://feeds
.feedburner.com/AsteriskNews (Daily Asterisk News -
rss)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGpk6ODQNt8rg0Kp4RAt3GAJ9hN9FTR+UziE+NQRAgw03sDLerOQCg
kvwz
N0BSMokIQNeUxCLnFqSWcQE=
=GwAo
-----END PGP SIGNATURE-----
_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
|
|
| Re: AGI and DeadAGI |
  United States |
2007-07-24 14:16:44 |
Matt Riddell wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Matthew Nicholson wrote:
>> Well, once the SIGHUP is sent, you no longer will
be able to get channel
>> variables from asterisk. If you did something like
'EXEC Dial Zap/1'
>> you may be able to get the DIALSTATUS from asterisk
before the SIGHUP if
>> the originating channel is still up.
>>
>> The most straight forward way to do that is just to
execute a DeadAGI
>> from the 'h' exten.
>
> So to sum up (for 1.4 at least - does this apply to 1.2
also?):
>
> 1. Run your AGI which looks up routing details and gets
credit level
> 2. Exec Dial of technology
> 3. Finish processing of AGI and hand back to Asterisk
(setting variables
> such as the 'provider you used to make the call with'
as channel
> variables - will this work - i.e. will you still be
able to access
> channel variables in the h extension?)
> 4. In the 'h' extension run a DeadAGI which reads in
the variables
> created in (3), checks dialstatus and deducts
credit/creates custom CDR.
>
> The change that went into SVN just seemed to document a
possible failure
> instead of actually preventing anything happening. I'm
guessing this
> means it has worked as above for some time and that the
process I was
> (am) using to lookup credit, dial, update credit etc is
only working
> because my DeadAGI script is lucky with regards to
getting the DialStatus?
That sounds like it should work. I am not sure if it is the
same in
1.2, I know the SIGHUP sending was broken (and I think the
fix may have
been reverted).
--
Matthew Nicholson
Digium
_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--
asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-dev
|
|
| Fwd: AGI and DeadAGI |

|
2007-07-24 18:29:42 |
|
I realize that my e-mails on this thread are being dropped because my From address is different from what I registered with. My two cents on this topic is that the Asterisk Manager provides a great interface for keeping track of many lines. I've got code in PHP using phpagi-manager that shows how to detect an anaswered line and a hungup line as the event happens. I think AGI would be a much better method to use, but if it doesn't meet your needs (or, like me, you can't figure out how to do what you want), then try the Manager interface.
---------- Forwarded message ---------- From: Nicholas Blasgen < squidy gmail.com">squidy gmail.com> Date: Jul 23, 2007 9:27 PM
Subject: Re: [asterisk-dev] AGI and DeadAGI To: Asterisk Developers Mailing List < asterisk-dev lists.digium.com">asterisk-dev lists.digium.com>
I'll be interested in the reply you get. Personally I've been using
the manager to detect hangups and then execute whatever code I need. I set the callerid in the agi to provide the manager any state information I need. Not great but it works.
/Nick Sent from my iPhone
|
[1-9]
|
|