Re: [asterisk-users] AsyncAGI - How to jump in dial plan when no action initiated on channel or AMI user is disconnected

2016-09-25 Thread Ludovic Gasc
Hi Amit,

I'd some daemons that use AsyncAGI, but now, I use FastAGI again because:

1. Asterisk must call the daemon via socket: the realibility of this socket
indicates implicitly that the daemon is alive and answer.

2. With FastAGI, it's really easy to implement the multi-worker pattern
with pre-fork socket like with a http server to distribute the load.
With AsyncAGI, it needs more work and you have a spof with the dispatcher.
In fact, with FastAGI, the dispatcher is the Linux kernel itself, less
risks of bugs.

My personal conclusion is: even if AsyncAGI is younger than FastAGI, it
doesn't seem that it's always better in all situations ;-)

Have a nice week at Astricon.
--
Ludovic Gasc (GMLudo)
http://www.gmludo.eu/

2016-09-21 5:49 GMT+02:00 Amit Patkar :

>

> It means, AMI application is no more running or crashed or lost network
connection with asterisk server.
> In such cases call is neither answered nor disconnected by Asterisk. I
want to detect such state and jump to next dial plan to answer or reject
the calls
>
> Regards
> Amit Patkar
>
> On September 20, 2016 8:07:23 PM GMT+05:30, Matthew Jordan <
mjor...@digium.com> wrote:


>>
>> On Sat, Sep 17, 2016 at 6:26 AM, Amit Patkar  wrote:

>>>

>>>  Hi
>>>
>>>  Is there any way to detect inactivity on channel when AsyncAGI is used?
>>>  I want to detect whether application handling calls using AMI & AGI has
>>>  stopped responding.
>>
>>
>> What do you mean by "stopped responding"?
>>

>>>  Alternatively, how can dialplan check if there is any AMI user
connected and

>>>  decide dial plan execution?
>>>
>>>  Thanks & Regards,
>>>  Amit Patkar
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
>   http://www.asterisk.org/community/astricon-user-conference
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> 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 --

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
  http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AsyncAGI - How to jump in dial plan when no action initiated on channel or AMI user is disconnected

2016-09-23 Thread Matthew Jordan
On Wed, Sep 21, 2016 at 9:27 AM, Amit Patkar  wrote:
> Thanks Mathew. I understand that there is no coordination between AsyncAGI &
> AMI.
> Is there any dial plan function which can tell us if there is active AMI
> session?
>

Assuming you know the client name (login name), you can use the
AMI_CLIENT [1] dialplan function to retrieve the number of sessions
they have currently established.

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Function_AMI_CLIENT

-- 
Matthew Jordan
Digium, Inc. | CTO
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

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

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
  http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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


Re: [asterisk-users] AsyncAGI - How to jump in dial plan when no action initiated on channel or AMI user is disconnected

2016-09-21 Thread Amit Patkar
Thanks Mathew. I understand that there is no coordination between 
AsyncAGI & AMI.
Is there any dial plan function which can tell us if there is active AMI 
session?


Thanks & Regards,
Amit Patkar

On 9/21/2016 6:27 PM, Matthew Jordan wrote:

On Tue, Sep 20, 2016 at 10:49 PM, Amit Patkar  wrote:

>It means, AMI application is no more running or crashed or lost network
>connection with asterisk server.
>In such cases call is neither answered nor disconnected by Asterisk. I want
>to detect such state and jump to next dial plan to answer or reject the
>calls
>

No, there is no automatic coordination mechanism between AsyncAGI and
AMI. In fact, AsyncAGI doesn't know*which*  AMI session is even
managing the channels - it just waits for the appropriate AMI action
to come across and signal something to the channels.

Your external application would have to manage this process. A simple
solution would be to use an AMI library that supports automatic
reconnects. On a reconnect, ask Asterisk for the current channels; if
any exist, handle their recovery either by determining their
application state or by releasing them back to the dialplan.

-- Matthew Jordan Digium, Inc. | CTO 445 Jan Davis Drive NW - 
Huntsville, AL 35806 - USA Check us out at: http://digium.com & 
http://asterisk.org

--
_ 
-- Bandwidth and Colocation Provided by http://www.api-digital.com -- 
Join the Asterisk Community at the 13th AstriCon, September 27-29, 
2016 http://www.asterisk.org/community/astricon-user-conference New to 
Asterisk? Start here: 
https://wiki.asterisk.org/wiki/display/AST/Getting+Started 
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 --

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
  http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AsyncAGI - How to jump in dial plan when no action initiated on channel or AMI user is disconnected

2016-09-21 Thread Matthew Jordan
On Tue, Sep 20, 2016 at 10:49 PM, Amit Patkar  wrote:
> It means, AMI application is no more running or crashed or lost network
> connection with asterisk server.
> In such cases call is neither answered nor disconnected by Asterisk. I want
> to detect such state and jump to next dial plan to answer or reject the
> calls
>

No, there is no automatic coordination mechanism between AsyncAGI and
AMI. In fact, AsyncAGI doesn't know *which* AMI session is even
managing the channels - it just waits for the appropriate AMI action
to come across and signal something to the channels.

Your external application would have to manage this process. A simple
solution would be to use an AMI library that supports automatic
reconnects. On a reconnect, ask Asterisk for the current channels; if
any exist, handle their recovery either by determining their
application state or by releasing them back to the dialplan.

-- 
Matthew Jordan
Digium, Inc. | CTO
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

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

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
  http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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


Re: [asterisk-users] AsyncAGI - How to jump in dial plan when no action initiated on channel or AMI user is disconnected

2016-09-20 Thread Amit Patkar
It means, AMI application is no more running or crashed or lost network 
connection with asterisk server.
In such cases call is neither answered nor disconnected by Asterisk. I want to 
detect such state and jump to next dial plan to answer or reject the calls

Regards
Amit Patkar

On September 20, 2016 8:07:23 PM GMT+05:30, Matthew Jordan  
wrote:
>On Sat, Sep 17, 2016 at 6:26 AM, Amit Patkar  wrote:
>> Hi
>>
>> Is there any way to detect inactivity on channel when AsyncAGI is
>used?
>> I want to detect whether application handling calls using AMI & AGI
>has
>> stopped responding.
>
>What do you mean by "stopped responding"?
>
>> Alternatively, how can dialplan check if there is any AMI user
>connected and
>> decide dial plan execution?
>>
>> Thanks & Regards,
>> Amit Patkar
>
>-- 
>Matthew Jordan
>Digium, Inc. | CTO
>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
>Check us out at: http://digium.com & http://asterisk.org
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
  http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] AsyncAGI - How to jump in dial plan when no action initiated on channel or AMI user is disconnected

2016-09-20 Thread Matthew Jordan
On Sat, Sep 17, 2016 at 6:26 AM, Amit Patkar  wrote:
> Hi
>
> Is there any way to detect inactivity on channel when AsyncAGI is used?
> I want to detect whether application handling calls using AMI & AGI has
> stopped responding.

What do you mean by "stopped responding"?

> Alternatively, how can dialplan check if there is any AMI user connected and
> decide dial plan execution?
>
> Thanks & Regards,
> Amit Patkar

-- 
Matthew Jordan
Digium, Inc. | CTO
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org

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

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
  http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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