<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi<br>
<br>
I am running one opensips with rtpengine<br>
<br>
opensips -V<br>
version: opensips 3.2.9 (x86_64/linux)<br>
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC,
Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT<br>
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN
16, MAX_URI_SIZE 1024, BUF_SIZE 65535<br>
poll method support: poll, epoll, sigio_rt, select.<br>
main.c compiled on with gcc 8<br>
</p>
<p>And have issue with attendend transfer:<br>
Here is the basic scenario:<br>
A calls B<br>
B puts A on hold (A listens to MOH)<br>
B makes second call C and C answers<br>
</p>
<p>So far all good, B and C can talk, but now when I want to
transfer A to C,<br>
opensips receives REFER and replies with "202 Accepted"</p>
<p>However now I dont know how to connect media with A and C<br>
A is still listening to MOH and C has silence.<br>
<br>
<br>
Here is the part that handles REFER and MOH<br>
</p>
<div
style="color: #cccccc;background-color: #1f1f1f;font-family: Consolas, 'Courier New', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span
style="color: #9cdcfe;">route</span><span style="color: #cccccc;">[</span><span
style="color: #9cdcfe;">handle_sequential</span><span
style="color: #cccccc;">]</span></div><div><span
style="color: #cccccc;">{</span></div><div><span
style="color: #cccccc;"> </span><span style="color: #c586c0;">if</span><span
style="color: #cccccc;"> (</span><span style="color: #dcdcaa;">has_totag</span><span
style="color: #cccccc;">() </span><span style="color: #d4d4d4;">&&</span><span
style="color: #cccccc;"> </span><span style="color: #dcdcaa;">is_method</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"REFER"</span><span
style="color: #cccccc;">) </span><span style="color: #d4d4d4;">&&</span><span
style="color: #cccccc;"> </span><span style="color: #dcdcaa;">loose_route</span><span
style="color: #cccccc;">()) {</span></div><div><span
style="color: #cccccc;"> </span><span style="color: #dcdcaa;">xlog</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"Route: handle_sequential | method: $rm | call_transfer | rt $rt"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span></div><div><span
style="color: #cccccc;"> </span><span style="color: #dcdcaa;"> append_to_reply</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY</span><span
style="color: #d7ba7d;">\r\n</span><span style="color: #ce9178;">"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span style="color: #dcdcaa;">append_to_reply</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"Supported: timer, path, replaces</span><span
style="color: #d7ba7d;">\r\n</span><span style="color: #ce9178;">"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span style="color: #dcdcaa;">append_to_reply</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"Allow-Events: talk, hold, conference, refer</span><span
style="color: #d7ba7d;">\r\n</span><span style="color: #ce9178;">"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span style="color: #dcdcaa;">append_to_reply</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"Contact: <a class="moz-txt-link-rfc2396E" href="sip:rtpengine@192.168.10.10:5060"><sip:rtpengine@192.168.10.10:5060></a></span><span
style="color: #d7ba7d;">\r\n</span><span style="color: #ce9178;">"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span style="color: #dcdcaa;">append_to_reply</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"Expires: 60</span><span
style="color: #d7ba7d;">\r\n</span><span style="color: #ce9178;">"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span style="color: #dcdcaa;">append_to_reply</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"User-Agent: rtpengine</span><span
style="color: #d7ba7d;">\r\n</span><span style="color: #ce9178;">"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span style="color: #dcdcaa;">send_reply</span><span
style="color: #cccccc;">(</span><span style="color: #b5cea8;">202</span><span
style="color: #cccccc;">, </span><span style="color: #ce9178;">"Accepted"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span></div><div><span
style="color: #cccccc;"> </span><span style="color: #9cdcfe;">exit</span><span
style="color: #cccccc;">;</span></div><div><span
style="color: #cccccc;"> }</span></div>
<div><span style="color: #cccccc;"> </span><span
style="color: #c586c0;">if</span><span style="color: #cccccc;"> (</span><span
style="color: #dcdcaa;">is_method</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"INVITE"</span><span
style="color: #cccccc;">) </span><span style="color: #d4d4d4;">&&</span><span
style="color: #cccccc;"> </span><span style="color: #dcdcaa;">has_totag</span><span
style="color: #cccccc;">()) {</span></div><div><span
style="color: #cccccc;"> </span><span style="color: #c586c0;">if</span><span
style="color: #cccccc;"> (</span><span style="color: #dcdcaa;">is_audio_on_hold</span><span
style="color: #cccccc;">()) {</span></div><div><span
style="color: #cccccc;"> </span><span
style="color: #dcdcaa;">xlog</span><span style="color: #cccccc;">(</span><span
style="color: #ce9178;">"Start playing MusicOnHold"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span
style="color: #dcdcaa;">xlog</span><span style="color: #cccccc;">(</span><span
style="color: #ce9178;">"request code: $rc"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span
style="color: #dcdcaa;">$var</span><span style="color: #cccccc;">(</span><span
style="color: #9cdcfe;">on_hold</span><span style="color: #cccccc;">) </span><span
style="color: #d4d4d4;">=</span><span style="color: #cccccc;"> </span><span
style="color: #ce9178;">"1"</span><span style="color: #cccccc;">;</span></div><div><span
style="color: #cccccc;"> </span><span
style="color: #dcdcaa;">append_hf</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"SDP-Rewritten: MOH</span><span
style="color: #d7ba7d;">\r\n</span><span style="color: #ce9178;">"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span
style="color: #dcdcaa;">rtpengine_play_media</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"from-tag=$tt file=/etc/opensips/music/moh1.wav"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span
style="color: #dcdcaa;">rtpengine_manage</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"RTP/AVP replace-session-connection replace-origin trust-address ICE=remove"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> }</span></div><div><span
style="color: #cccccc;"> </span><span style="color: #c586c0;">else</span><span
style="color: #cccccc;">{</span></div><div><span
style="color: #cccccc;"> </span><span
style="color: #dcdcaa;">$var</span><span style="color: #cccccc;">(</span><span
style="color: #9cdcfe;">on_hold</span><span style="color: #cccccc;">) </span><span
style="color: #d4d4d4;">=</span><span style="color: #cccccc;"> </span><span
style="color: #ce9178;">"0"</span><span style="color: #cccccc;">;</span></div><div><span
style="color: #cccccc;"> </span><span
style="color: #dcdcaa;">xlog</span><span style="color: #cccccc;">(</span><span
style="color: #ce9178;">"Stop playing MusicOnHold: var(on_hold): $var(on_hold)"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span
style="color: #dcdcaa;">rtpengine_stop_media</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"from-tag=$tt"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span
style="color: #dcdcaa;">append_hf</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"SDP-Rewritten: Return from MOH</span><span
style="color: #d7ba7d;">\r\n</span><span style="color: #ce9178;">"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> </span><span
style="color: #dcdcaa;">rtpengine_manage</span><span
style="color: #cccccc;">(</span><span style="color: #ce9178;">"RTP/AVP replace-session-connection replace-origin trust-address ICE=remove"</span><span
style="color: #cccccc;">);</span></div><div><span
style="color: #cccccc;"> }</span></div><div><span
style="color: #cccccc;"> } </span><span style="color: #c586c0;">else</span><span
style="color: #cccccc;">{}</span><span style="color: #d4d4d4;">...</span></div><div><span
style="color: #cccccc;">}</span></div></div>
<p><br>
I tried also with b2b_logic but I obviusly dont have enough
knowledge to make it work by myself<br>
Can you please give me a hint how to proceed?<br>
Or if anyone has a working example, what part of code is missing
here?<br>
<br>
Thank you<br>
BR<br>
Simon<br>
<br>
</p>
<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br /><table style="border-top: 1px solid #D3D4DE;"><tr><td style="width: 55px; padding-top: 13px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://s-install.avcdn.net/ipm/preview/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"/></a></td><td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free.<a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a></td></tr></table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>