[asterisk-dev] How to keep the connectionwith AMIinterfaceactive?

caif~ caif at qq.com
Wed Oct 8 02:50:48 CDT 2008


Thank you Bkruse!
I am doing it as you suggested. It works well till now. I will send the test results to mail list later.
Thank you all!

 
------------------ Original ------------------
From:  "bkruse"<bkruse at digium.com>;
Date:  Wed, Oct 8, 2008 01:28 AM
To:  "Asterisk Developers Mailing List"<asterisk-dev at lists.digium.com>; 

Subject:  Re: [asterisk-dev] How to keep the connectionwith    AMIinterfaceactive?

 
  
I am sorry, I should have been monitoring closer.

All you have to do is keep your session ID that is handed out to you on 
the handshake of logging in, and ping the manager interface.

The session should not expire (I do not think), until Asterisk is 
stopped/started, etc.

You can get a full example of the web related manager abilities in 
config/js/astman.js or pbx.js
(Javascript routines for Accessing manager and manipulating the Data. 
Same can be used in Java)

-bk

caif~ wrote:
> Hi, Alwin
> I am looking into Ping action. Below is what I found from 
> http://www.the-asterisk-book.com/unstable/manager-interface-ajam.html.
>
> "Ping
> When accessing the AJAM with an AJAX application, the ping command is 
> particularly useful for keeping authenticated connections alive."
>
> I don't know is it useful for Java application.
>  
> ------------------ Original ------------------
> *From: * "Alwin Chan"<alwin at qubeconnect.com>;
> *Date: * Tue, Oct 7, 2008 10:29 AM
> *To: * "Asterisk Developers Mailing List"<asterisk-dev at lists.digium.com>;
> *Subject: * Re: [asterisk-dev] How to keep the connection with 
> AMIinterfaceactive?
>  
> Hi caif,
>
> You may want to look into the "Ping" action in AMI, see
> http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+Ping
>
> On Tue, Oct 7, 2008 at 09:29, caif~ <caif at qq.com> wrote:
> > Thank you Kevin!
> > I added a thread to send ping action to Asterisk every 60 seconds, 
> but the
> > problem goes on.
> > Is 60 seconds too long fot keeping active? Or just sending ping is not
> > enough?
> > What could I do to keep a connection active forever except Asterisk 
> stopped?
> > I do think if there is no way to do that, any program for AMI is
> > meaningless. None will put up with a software that need to be 
> restart every
> > few hours.
> >
> > There must be a solution but I don't know, could any one give me 
> some help?
> > Thank you very much!
> >
> > ------------------ Original ------------------
> > From:  "Kevin P. Fleming"<kpfleming at digium.com>;
> > Date:  Mon, Oct 6, 2008 09:12 PM
> > To:  "Asterisk Developers Mailing List"<asterisk-dev at lists.digium.com>;
> > Subject:  Re: [asterisk-dev] How to keep the connection with AMI
> > interfaceactive?
> >
> > caif~ wrote:
> >
> >> Dose Asterisk AMI close the connection with my program after a few 
> hours?
> >> Do I need to keep sending ping to keep the connection active?
> >
> > Yes, and yes.
> >
> > --
> > Kevin P. Fleming
> > Director of Software Technologies
> > Digium, Inc. - "The Genuine Asterisk Experience" (TM)
> >
> > _______________________________________________
> > --Bandwidth and Colocation Provided by http://www.api-digital.com--
> >
> > AstriCon 2008 - September 22 - 25 Phoenix, Arizona
> > Register Now: http://www.astricon.net
> >
> > asterisk-dev mailing list
> > To UNSUBSCRIBE or update options visit:
> >    http://lists.digium.com/mailman/listinfo/asterisk-dev
> > _______________________________________________
> > --Bandwidth and Colocation Provided by http://www.api-digital.com--
> >
> > AstriCon 2008 - September 22 - 25 Phoenix, Arizona
> > Register Now: http://www.astricon.net
> >
> > asterisk-dev mailing list
> > To UNSUBSCRIBE or update options visit:
> >   http://lists.digium.com/mailman/listinfo/asterisk-dev
> >
>
>
>
> -- 
> Regards,
> Alwin Chan
> Technical Lead of Software Development
> QubeConnect - "Communications Begin With Us"
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> AstriCon 2008 - September 22 - 25 Phoenix, Arizona
> Register Now: http://www.astricon.net
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
> ------------------------------------------------------------------------
>
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
>
> AstriCon 2008 - September 22 - 25 Phoenix, Arizona
> Register Now: http://www.astricon.net
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev


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

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20081008/c47f403c/attachment.htm 


More information about the asterisk-dev mailing list