Re: [asterisk-users] realtime queue callers

2008-05-01 Thread Vieri

--- Atis Lezdins <[EMAIL PROTECTED]> wrote:

> So, the issue is
> http://bugs.digium.com/view.php?id=12556, feel free
> to comment about usage.
> 
> I also posted backport to 1.4.19 at
> http://ftp.iq-labs.net/realtime_queue_callers-1.4/
> but for this You
> will need to also apply backport for realtime
> store/destroy - also
> available at
> http://ftp.iq-labs.net/realtime_store_destroy-1.4/

Thank you for your contribution.

I've posted a comment at
http://bugs.digium.com/view.php?id=12556 and I invite
other users with this particular feature request to
post there too.

If you solved the problem with another technique then
please let us know.



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

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

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


Re: [asterisk-users] realtime queue callers

2008-04-30 Thread Atis Lezdins
On Tue, Apr 29, 2008 at 9:47 PM, Vieri <[EMAIL PROTECTED]> wrote:
>  That's what I would like to do: use dynamic queue
>  members but rely on mysql for monitoring active queue
> calls.
>
>  > Btw, I never experienced that MySQL dies, it's more
>  > often that Asterisk dies.
>
>  I agree. But I did have a strange case at one point.
>  Would like to reduce point of failures anyway, as much
>  as possible.

Ok, so in this case failed INSERT or DELETE should affect Asterisk in no way.

>  > So, are You interested in applying this patch
>  > yourself?
>
>  I just wrote a simple AMI script which parses the
>  output of "show queues" and sends relevant data to my
>  custom application via sockets. The only problem is
>  that I need to periodically run the script (cron) so
>  it's rather "inefficient". Maybe I could trigger the
>  script on particular Manager events (such as "run the
>  script which parses 'show queues' only when I receive
>  Agent* events).

Well, the problem with "show queues" is that it sometimes might lock,
and if you have many clients needing the same information,
you have to write some kind of proxy, and cache everything, so that
there's only one request to Asterisk in specific period.
For MySQL you can use all that without worry, plus you get actual data
(that was why I wrote all this realtime status stuff).

>  I don't want you to make the effort of finding that
>  patch (as it seems you don't have it at hand now) if I
>  may not "need it". However, I think that your patch
>  should hit SVN and I wouldn't mind testing it.

Ok, after a thought, this part is quite simple - just few lines, so
I'll post it right away. I'll leave more complex realtime
agent/channel updates for later.

So, the issue is http://bugs.digium.com/view.php?id=12556, feel free
to comment about usage.

I also posted backport to 1.4.19 at
http://ftp.iq-labs.net/realtime_queue_callers-1.4/ but for this You
will need to also apply backport for realtime store/destroy - also
available at http://ftp.iq-labs.net/realtime_store_destroy-1.4/

Regards,
Atis


-- 
Atis Lezdins,
VoIP Project Manager / Developer,
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835

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

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


Re: [asterisk-users] realtime queue callers

2008-04-29 Thread Vieri

--- Atis Lezdins <[EMAIL PROTECTED]> wrote:

> So, I suppose if
> MySQL dies in
> middle of operation, SELECT should fail and Asterisk
> should just
> continue with what it has in memory. Btw, You should
> be able to also
> use static or dynamic queue members (not realtime)
> in combination with
> realtime queue calls.

That's what I would like to do: use dynamic queue
members but rely on mysql for monitoring active queue
calls.

> Btw, I never experienced that MySQL dies, it's more
> often that Asterisk dies.

I agree. But I did have a strange case at one point.
Would like to reduce point of failures anyway, as much
as possible.

> So, are You interested in applying this patch
> yourself?

I just wrote a simple AMI script which parses the
output of "show queues" and sends relevant data to my
custom application via sockets. The only problem is
that I need to periodically run the script (cron) so
it's rather "inefficient". Maybe I could trigger the
script on particular Manager events (such as "run the
script which parses 'show queues' only when I receive
Agent* events).

I don't want you to make the effort of finding that
patch (as it seems you don't have it at hand now) if I
may not "need it". However, I think that your patch
should hit SVN and I wouldn't mind testing it.

Thanks,

Vieri



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

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

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


Re: [asterisk-users] realtime queue callers

2008-04-29 Thread Atis Lezdins
On Tue, Apr 29, 2008 at 1:22 PM, Vieri <[EMAIL PROTECTED]> wrote:
>
>
>  --- Atis Lezdins <[EMAIL PROTECTED]> wrote:
>
>  > On Mon, Apr 28, 2008 at 8:34 PM, Vieri
>  > <[EMAIL PROTECTED]> wrote:
>  > > How can I get a list of the callers within a
>  > specific
>  > >  queue at any given moment?
>  > >
>  > >  I need to get the caller IDs of all active calls
>  > in a
>  > >  queue then send them out via a udp socket to a
>  > >  listening application on the network (the only
>  > data I
>  > >  need to send are two fields: current timestamp
>  > and
>  > >  caller id of active queue calls).
>  > >
>  > >  I have almost all the elements to do this except
>  > the
>  > >  best method to retrieve "all active caller ids
>  > from a
>  > >  given queue". I was wondering if someone already
>  > did
>  > >  this.
>  > >
>  > >  I tried writing a script on the server which
>  > connects
>  > >  to the Manager API and receives queue events. I'm
>  > >  basically using the AgentCalled event but it
>  > seems
>  > >  clumsy to efficiently detect when the call has
>  > ended
>  > >  (connect or abandon) and thus update the remote
>  > UDP
>  > >  listening app.
>  > >
>  > >  I also tried another way by guessing which calls
>  > are
>  > >  active via tailing and grepping
>  > >  /var/log/asterisk/queue_log.
>  > >
>  > >  Finally, a third script method tried parsing the
>  > >  output of "show queue " right after
>  > "Callers:".
>  > >  Maybe this is all I really need for my purposes
>  > >  (although less efficient and less "real-time"
>  > than the
>  > >  queue events method because I would need to
>  > >  periodically poll the whole queue statistics) but
>  > I
>  > >  only get the originating channel and the wait
>  > time. I
>  > >  would require correlating the data to the
>  > caller's ID.
>  > >
>  > >  Has anyone already done something similar?
>  > >  A simple example/script/suggestion would be
>  > greatly
>  > >  appreciated.
>  >
>  > I'm not sure that this is what exactly You need, but
>  > I have a patch
>  > for app_queue
>  > that will store and update queue callers (as well as
>  > update lots of
>  > fields for queue members) in realtime mysql table.
>  > This allows to do
>  > many requests for current queue state simultenously,
>  > and moves load
>  > from asterisk to mysql (which can be on separate
>  > machine). So,
>  > generally to get active callers with all their
>  > callerid/channel info
>  > You will have to do just "SELECT * FROM
>  > queue_callers".
>  >
>  > It's not very finalized, so I haven't yet posted
>  > that to Digium for
>  > inclusion in next asterisk versions, but I intend to
>  > do that in
>  > future. It's been working stable on our production
>  > for several months.
>  >
>  > If You're interested, please reply, and I'll try to
>  > separate that
>  > patch out from other our patches.
>  > Currently I have it updated for 1.4.19, but also
>  > have some version for 1.4.14
>
>  Thanks Atis.
>  That patch sounds really neat. Hope it gets into *
>  soon.
>  Just a doubt: suppose the mysql daemon dies for some
>  reason. Will the patched app_queue still handle calls
>  and not hang?
>

It should, as asterisk throws INSERTs, UPDATEs and DELETEs for
changing data (queue callers and queue member status), plus it loads
existing queue members trough SELECT (as it's now with realtime queue
members, just some extra fields). So, I suppose if MySQL dies in
middle of operation, SELECT should fail and Asterisk should just
continue with what it has in memory. Btw, You should be able to also
use static or dynamic queue members (not realtime) in combination with
realtime queue calls.

Btw, I never experienced that MySQL dies, it's more often that Asterisk dies.

So, are You interested in applying this patch yourself?

Regards,
Atis


-- 
Atis Lezdins,
VoIP Project Manager / Developer,
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835

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

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


Re: [asterisk-users] realtime queue callers

2008-04-29 Thread Vieri

--- Atis Lezdins <[EMAIL PROTECTED]> wrote:

> On Mon, Apr 28, 2008 at 8:34 PM, Vieri
> <[EMAIL PROTECTED]> wrote:
> > How can I get a list of the callers within a
> specific
> >  queue at any given moment?
> >
> >  I need to get the caller IDs of all active calls
> in a
> >  queue then send them out via a udp socket to a
> >  listening application on the network (the only
> data I
> >  need to send are two fields: current timestamp
> and
> >  caller id of active queue calls).
> >
> >  I have almost all the elements to do this except
> the
> >  best method to retrieve "all active caller ids
> from a
> >  given queue". I was wondering if someone already
> did
> >  this.
> >
> >  I tried writing a script on the server which
> connects
> >  to the Manager API and receives queue events. I'm
> >  basically using the AgentCalled event but it
> seems
> >  clumsy to efficiently detect when the call has
> ended
> >  (connect or abandon) and thus update the remote
> UDP
> >  listening app.
> >
> >  I also tried another way by guessing which calls
> are
> >  active via tailing and grepping
> >  /var/log/asterisk/queue_log.
> >
> >  Finally, a third script method tried parsing the
> >  output of "show queue " right after
> "Callers:".
> >  Maybe this is all I really need for my purposes
> >  (although less efficient and less "real-time"
> than the
> >  queue events method because I would need to
> >  periodically poll the whole queue statistics) but
> I
> >  only get the originating channel and the wait
> time. I
> >  would require correlating the data to the
> caller's ID.
> >
> >  Has anyone already done something similar?
> >  A simple example/script/suggestion would be
> greatly
> >  appreciated.
> 
> I'm not sure that this is what exactly You need, but
> I have a patch
> for app_queue
> that will store and update queue callers (as well as
> update lots of
> fields for queue members) in realtime mysql table.
> This allows to do
> many requests for current queue state simultenously,
> and moves load
> from asterisk to mysql (which can be on separate
> machine). So,
> generally to get active callers with all their
> callerid/channel info
> You will have to do just "SELECT * FROM
> queue_callers".
> 
> It's not very finalized, so I haven't yet posted
> that to Digium for
> inclusion in next asterisk versions, but I intend to
> do that in
> future. It's been working stable on our production
> for several months.
> 
> If You're interested, please reply, and I'll try to
> separate that
> patch out from other our patches.
> Currently I have it updated for 1.4.19, but also
> have some version for 1.4.14

Thanks Atis.
That patch sounds really neat. Hope it gets into *
soon.
Just a doubt: suppose the mysql daemon dies for some
reason. Will the patched app_queue still handle calls
and not hang?



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

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

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


Re: [asterisk-users] realtime queue callers

2008-04-29 Thread Atis Lezdins
On Mon, Apr 28, 2008 at 8:34 PM, Vieri <[EMAIL PROTECTED]> wrote:
> How can I get a list of the callers within a specific
>  queue at any given moment?
>
>  I need to get the caller IDs of all active calls in a
>  queue then send them out via a udp socket to a
>  listening application on the network (the only data I
>  need to send are two fields: current timestamp and
>  caller id of active queue calls).
>
>  I have almost all the elements to do this except the
>  best method to retrieve "all active caller ids from a
>  given queue". I was wondering if someone already did
>  this.
>
>  I tried writing a script on the server which connects
>  to the Manager API and receives queue events. I'm
>  basically using the AgentCalled event but it seems
>  clumsy to efficiently detect when the call has ended
>  (connect or abandon) and thus update the remote UDP
>  listening app.
>
>  I also tried another way by guessing which calls are
>  active via tailing and grepping
>  /var/log/asterisk/queue_log.
>
>  Finally, a third script method tried parsing the
>  output of "show queue " right after "Callers:".
>  Maybe this is all I really need for my purposes
>  (although less efficient and less "real-time" than the
>  queue events method because I would need to
>  periodically poll the whole queue statistics) but I
>  only get the originating channel and the wait time. I
>  would require correlating the data to the caller's ID.
>
>  Has anyone already done something similar?
>  A simple example/script/suggestion would be greatly
>  appreciated.

I'm not sure that this is what exactly You need, but I have a patch
for app_queue
that will store and update queue callers (as well as update lots of
fields for queue members) in realtime mysql table. This allows to do
many requests for current queue state simultenously, and moves load
from asterisk to mysql (which can be on separate machine). So,
generally to get active callers with all their callerid/channel info
You will have to do just "SELECT * FROM queue_callers".

It's not very finalized, so I haven't yet posted that to Digium for
inclusion in next asterisk versions, but I intend to do that in
future. It's been working stable on our production for several months.

If You're interested, please reply, and I'll try to separate that
patch out from other our patches.
Currently I have it updated for 1.4.19, but also have some version for 1.4.14

Regards,
Atis


-- 
Atis Lezdins,
VoIP Project Manager / Developer,
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835

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

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