[OpenSIPS-Users] How to answer a call with a wav file?

Eran Leshem eranl at kayhut.com
Wed May 8 12:07:08 UTC 2024


Hi,

I tried adding the line that you suggested, but I still get an error
message.
The route that I wrote is:

```
route[play_audio] {
  rtpengine_offer("to-tag=$ft from-tag=$ft");
  append_to_reply("Content-Type: application/sdp\r\n");
  $var(body) = $(rb{re.subst,/(IP4.).*/\1$si/g});
  t_reply_with_body(183, "Session Progress", $var(body));
  rtpengine_manage();

  $var(play_duration) = 300;
  rtpengine_play_media("file=/path/to/music.wav to-tag=$ft", $var(
play_duration));
}
```

The error message that I'm getting is:

ERROR:rtpengine:rtpe_function_call: proxy replied with error: No
participant party specified
ERROR:rtpengine:rtpengine:rtpengine_playmedia_f: could not start media!

Any idea on what is wrong?

On Tue, May 7, 2024 at 4:15 AM Jehanzaib Younis <jehanzaib.kiani at gmail.com>
wrote:

> Hi Eran,
>
> Have you tried rtpengine_manage() before playing the media ?
>
>         rtpengine_manage();
>         rtpengine_play_media("file=ringback_tone_file.wav");
>         exit;
>
>
> Regards,
> Jehanzaib
>
>
> On Tue, May 7, 2024 at 2:10 AM Eran Leshem <eranl at kayhut.com> wrote:
>
>> Hi, I would like to create a special extension that will answer by
>> playing a wav file back to the caller.
>>
>> The call will be as such:
>> 1. The caller will call the special extension: "wav-call"
>> 2. Instead of someone answering his call, the calling person will hear
>> a sound (a song, a wav file), being played back to him.
>> 3. After that, the caller will hang-up.
>>
>> I have tried to do it in several ways, but failed.
>> I looked at the documentation and I have tried using:
>>
>> rtpengine_play_media("file=/path/to/ringback_tone_file.wav");
>>
>> but, did not succeed.
>> I keep getting: "Unknown call-ID"
>>
>> My machine:
>> - Linux Mint 21.3 which is based on Ubuntu 22.04 LTS (Jammy Jellyfish),
>> - 16 GB memory,
>> - OpenSIPS version 3.4
>> - RTPEngine is installed.
>>
>> Any ideas?
>> - Thanks, Eran L.
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20240508/30bdaab4/attachment.html>


More information about the Users mailing list