Hi,
I'm using latest kamailio 5.6.2 and rtpengine.
I need to play announcement to both parties when call is answered by callee. Now I run play_media in event route but when audio start announcement sounds like we have a 50% packet loss. After it is completed there is no problem with audio both sides. I figured out that if i do block_media() my announcement play perfectly but i dont understand how to do unblock_audio() after announcement ends.
Appriciate any help!
here is my code:
event_route[dialog:start]{
xlog("L_INFO", "dialog started, received 200OK");
block_media();
play_media("all file=/usr/local/src/myfile.mp3");
#unblock_media();
}
On 09/10/2022 10.52, [EXT] Stepan Kislyakov wrote:
Hi,
I'm using latest kamailio 5.6.2 and rtpengine.
I need to play announcement to both parties when call is answered by callee. Now I run play_media in event route but when audio start announcement sounds like we have a 50% packet loss. After it is completed there is no problem with audio both sides. I figured out that if i do block_media() my announcement play perfectly but i dont understand how to do unblock_audio() after announcement ends.
The duration of the media playback is returned from the play_media() command (see `media_duration` modparam). You could use some sort of timer to invoke media unblocking after media playback ends. Sadly my Kamailio-Fu isn't strong enough to be able to tell you how to run this sort of timer. :)
Cheers