[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] AMI connection handling
From:       "Dan Jenkins, HolidayExtras.com" <dan.jenkins () holidayextras ! com>
Date:       2013-09-19 8:41:31
Message-ID: CACgt05iuUQW+_kVwbHk0=z4ky62k9JnHkqk5Ziov0UGGB_5wvw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On 19 September 2013 09:10, Olle E. Johansson <oej@edvina.net> wrote:

>
> 19 sep 2013 kl. 10:07 skrev jg <webaccounts@jgoettgens.de>:
>
> > Under which circumstances does this happen, except that it happens
> randomly? Is it related to your commands or with a flood of events? Which
> CSTA library are you using?
> >
> > I am currently writing a TAPI service provider and for test purposes I
> have several connections up all the time. I have never seen that
> connections suddenly die.
>
> If you have a lot of actions you want to open one connection for reading
> events and one or multiple for sending actions as they are mostly
> synchronous. The TCP read queue grows otherwise and at some point you will
> have trouble in your app since you can't send.
>
> I don't know how that affects the TCP connection state, guess that depends
> on the implementation.
>
> /O
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
>



I've had this issue before, where we have a lot of actions being sent and
received - on a busy phone system

I changed over to do exactly what Olle is talking about, one for writing
and I eventually ended up with 3 for reading and each one of those had a
different user which had allowed events set against each one so that I
didn't receive the event 3 times.

This solved any stability/slowness issues I had, the TCP connections just
couldn't deal with sending all of the traffic I was asking of them.
Remember, that if you don't setup allowed events against the AMI user, you
will be receiving all of the events that Asterisk sends on each AMI
connection - so you can use the "eventfilter" parameter against the user in
manager.conf to restrict particular events - to a higher degree than the
read and write parameters.

On a related note, we were having issues a while back in Elastix/Freepbx in
that we were pressing reload and it would never reload, what was happening
was that the TCP connection was being opened and being flooded, and then
the script would timeout before it got a chance to send the reload command.

I've diverged but hopefully this gives you a bit of background and a
possible solution.

Dan

[Attachment #5 (text/html)]

<div dir="ltr">On 19 September 2013 09:10, Olle E. Johansson <span dir="ltr">&lt;<a \
href="mailto:oej@edvina.net" target="_blank">oej@edvina.net</a>&gt;</span> \
wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<br>
19 sep 2013 kl. 10:07 skrev jg &lt;<a \
href="mailto:webaccounts@jgoettgens.de">webaccounts@jgoettgens.de</a>&gt;:<br> <div \
class="im"><br> &gt; Under which circumstances does this happen, except that it \
happens randomly? Is it related to your commands or with a flood of events? Which \
CSTA library are you using?<br> &gt;<br>
&gt; I am currently writing a TAPI service provider and for test purposes I have \
several connections up all the time. I have never seen that connections suddenly \
die.<br> <br>
</div>If you have a lot of actions you want to open one connection for reading events \
and one or multiple for sending actions as they are mostly synchronous. The TCP read \
queue grows otherwise and at some point you will have trouble in your app since you \
can&#39;t send.<br>


<br>
I don&#39;t know how that affects the TCP connection state, guess that depends on the \
implementation.<br> <span class=""><font color="#888888"><br>
/O<br>
</font></span><div class=""><div class="h5">--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" \
target="_blank">http://www.api-digital.com</a> --<br> <br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" \
target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a><br> \
</div></div></blockquote></div><br></div><div class="gmail_extra"><br></div><div \
class="gmail_extra"><br></div><div class="gmail_extra">I&#39;ve had this issue \
before, where we have a lot of actions being sent and received - on a busy phone \
system</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">I changed over to do \
exactly what Olle is talking about, one for writing and I eventually ended up with 3 \
for reading and each one of those had a different user which had allowed events set \
against each one so that I didn&#39;t receive the event 3 times.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">This solved any \
stability/slowness issues I had, the TCP connections just couldn&#39;t deal with \
sending all of the traffic I was asking of them. Remember, that if you don&#39;t \
setup allowed events against the AMI user, you will be receiving all of the events \
that Asterisk sends on each AMI connection - so you can use the \
&quot;eventfilter&quot; parameter against the user in manager.conf to restrict \
particular events - to a higher degree than the read and write parameters.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">On a related note, we \
were having issues a while back in Elastix/Freepbx in that we were pressing reload \
and it would never reload, what was happening was that the TCP connection was being \
opened and being flooded, and then the script would timeout before it got a chance to \
send the reload command.</div>

<div class="gmail_extra"><br></div><div class="gmail_extra">I&#39;ve diverged but \
hopefully this gives you a bit of background and a possible solution.</div><div \
class="gmail_extra"><br></div><div class="gmail_extra">Dan</div>

<div class="gmail_extra"><br></div><div class="gmail_extra"> </div></div>



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

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic