[OpenSIPS-Users] play media file.

Răzvan Crainea razvan at opensips.org
Tue Mar 23 09:21:31 EST 2021


Hi, Johan!

UI think the only correct way of delaying a final response, as a proxy, 
is to simply drop it, as if you have never received it. The sleep() you 
are calling will basically block the whole transaction until it ends, 
and will probably block OpenSIPS as well due to transaction locks.

So I think the correct way of doing this is in failure route to "catch" 
the reply and when it first comes, compute the timestamp when it may 
end, then drop all final responses until that timestamp passes.

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 3/19/21 5:49 PM, johan wrote:
>      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,
> 
> 
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 



More information about the Users mailing list