WAV file player EOF callback (python ...again)

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

 



There have been a few of us wanting to do this, myself being one. I've
attached a patch to r2480 that accomplishes the task.

The pjmedia layer has the required hook (pjmedia_wav_player_set_of_cb).
I added a slot into the pjsua player so I had somewhere to stash the
Python callable. Then the _pjsua wrapper exports the ability to set this
and to call it when the eof happens.

On Tuesday 15,June,2010 07:23 PM, Andreas Wehrmann wrote:
> Hello!
>
> I'm currently writing a little script that simply accepts incoming
> calls and plays a WAV file to each of the calls.
> This works fine, but I want to hang up the call when the WAV file has
> finished playing.
> From what I understand one can register a callback with the C API
> that informs the user when playback of the file has finished.
> However I didn't find anything similar in the Python bindings, or did
> I oversee something?
>
> I had the idea of simply finding out how long the WAV file is in
> advance and then arm a timer
> upon an incoming call, so that when I get the timer callback I just
> hang up the call; but this
> would in my eyes be the "dirty" way as there already seems
> to be the facility in the PJ lib for that.
>
> Any hints or help is appreciated, thanks!
>
> Best regards,
> Andreas
>


-- 
Jens B. Jorgensen
jbj1 at ultraemail.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: python_eof_callback_r2480.patch
Type: text/x-diff
Size: 6459 bytes
Desc: not available
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20100616/3a74aabf/attachment.patch>


[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