[OpenSIPS-Users] Call forward at opensips with rtpegine in use - fail to connect media
Simon Gajski
simon at softnet.si
Mon Jun 3 10:48:49 UTC 2024
Hi
I am running one opensips with rtpengine
opensips -V
version: opensips 3.2.9 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC,
Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16,
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
main.c compiled on with gcc 8
And have issue with attendend transfer:
Here is the basic scenario:
A calls B
B puts A on hold (A listens to MOH)
B makes second call C and C answers
So far all good, B and C can talk, but now when I want to transfer A to C,
opensips receives REFER and replies with "202 Accepted"
However now I dont know how to connect media with A and C
A is still listening to MOH and C has silence.
Here is the part that handles REFER and MOH
route[handle_sequential]
{
if(has_totag() &&is_method("REFER") &&loose_route()) {
xlog("Route: handle_sequential | method: $rm | call_transfer | rt $rt");
append_to_reply("Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE,
INFO, UPDATE, REGISTER, REFER, NOTIFY\r\n");
append_to_reply("Supported: timer, path, replaces\r\n");
append_to_reply("Allow-Events: talk, hold, conference, refer\r\n");
append_to_reply("Contact: <sip:rtpengine at 192.168.10.10:5060>\r\n");
append_to_reply("Expires: 60\r\n");
append_to_reply("User-Agent: rtpengine\r\n");
send_reply(202, "Accepted");
exit;
}
if(is_method("INVITE") &&has_totag()) {
if(is_audio_on_hold()) {
xlog("Start playing MusicOnHold");
xlog("request code: $rc");
$var(on_hold) ="1";
append_hf("SDP-Rewritten: MOH\r\n");
rtpengine_play_media("from-tag=$tt file=/etc/opensips/music/moh1.wav");
rtpengine_manage("RTP/AVP replace-session-connection replace-origin
trust-address ICE=remove");
}
else{
$var(on_hold) ="0";
xlog("Stop playing MusicOnHold: var(on_hold): $var(on_hold)");
rtpengine_stop_media("from-tag=$tt");
append_hf("SDP-Rewritten: Return from MOH\r\n");
rtpengine_manage("RTP/AVP replace-session-connection replace-origin
trust-address ICE=remove");
}
} else{}...
}
I tried also with b2b_logic but I obviusly dont have enough knowledge to
make it work by myself
Can you please give me a hint how to proceed?
Or if anyone has a working example, what part of code is missing here?
Thank you
BR
Simon
--
This email has been checked for viruses by Avast antivirus software.
www.avast.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20240603/596b9fe9/attachment.html>
More information about the Users
mailing list