Need little help here --- Ringtone with APS

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

 



On Sun, Feb 15, 2009 at 8:18 PM, <iajdani at provati.com> wrote:

> I am trying to play ringtone to the caller at 180 response. What I wrote in
> on_call_state callback is given below. The code just execute fine but no
> ringtone in my earpiece. I am now using APS-DIRECT.
>

First of all, the aps-direct branch is supposed to be an internal branch and
we're not quite finished with it so expect few rough edges here and there.
Even the API is not quite finalized yet, so it's really not ready to be used
for anything. But I do appreciate, and surprised at the same time, with the
level of interests that this has generated.

Answering your question. When using APS-Direct, you always need to remember
that the whole point of having APS-Direct is to enable codec compression in
sound device (APS/VAS), hence to let encoded frames flowing end-to-end from
the microphone down to the socket and vice versa.

The sample on_stream_created() snippet shows how to open the sound device in
codec format according to the codec being used by the call. So since the
sound device is opened in codec mode, you can't no longer feed it with PCM
frames (e.g. the tone generator).

To use the tone generator (or any other pjmedia features that works on PCM
frames such as WAV files), you will need to open the sound device in PCM
mode to play the ring tones, then when you want to communicate with the
call/stream, you will need to close the sound device, and re-open it using
the codec that is used by the call.

The on_stream_created() snippet currently doesn't show how to do this, so
you need to do it yourself.

cheers
 Benny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090216/ba24ff28/attachment.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