[OpenSIPS-Users] play media file.

johan johan at democon.be
Fri Mar 19 15:49:35 EST 2021


    Hi,


I want to play a wav file to caller when receiving 486 from callee.


What is the best way to do it ?

This is what  I do in the script:


failure_route[missed_call]
{
    xlog("failure route ft [$ft] tt [$tt]");
    if (t_check_status("4[0-9][0-9]")) {
       
route(playwavfile,"/home/johan/Downloads/discon-or-out-of-service.wav",$ft);
    }


where as route[playwavfile]

route[playwavfile]
{
    xlog("playwavfile string [file=$param(1) from-tag=$param(2)]");
    rtpengine_play_media("file=$param(1) from-tag=$param(2)");
    sleep(7);
}


what I am worried about is the sleep() if I remove this, you hear nada
as 486 is immediately send to the caller and the call ends.


What is the best way to "hold back" a final reply for a few seconds ?


wkr,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0xD7D896F7DDA70EC3.asc
Type: application/pgp-keys
Size: 2456 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/users/attachments/20210319/0f0693fd/attachment.key>


More information about the Users mailing list