How to implement asynchronous delay in Python with pjsip 2.1 ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi guys,

I have the following idea - I am trying to ring all the phones in the
office at once for several seconds and then
hang up. So, basicly what I coded is - I am sending several calls at once
to each particular phone.
That is the easy part. The hard part is to attach a "timer" object to each
call object after receiving a PROGRESS message
from the called side and to setup this timer object to trigger a hangup
after X seconds have passed.

The most logical way is to implement a timer via the Threading.timer
function. However that fails, because pjsip
requires external threads to register with its worker thread. In pjsip 1.x
that was possible, however in pjsip 2.1 I
can not find the way to do so.

I tried to implement the above by using the sched module. However it
doesn't work either because in that case
each time I create a scheduler object for each particular call, the delay
is added to the previous configured delay.
so, if I ring 3 phones at the same time and start a scheduler object for
each one with a delay of 3 seconds,
then the first scheduler will run at the 3rd secon, the 2nd scheduler
object will runat the 6th second and so on.
In that way the first call will be dropped 3 seconds after starting to
ring, the 2nd call - 6 seconds and so on.

Any ideas are more than welcome :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20130913/ccb42ecc/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux