Hi everyone!<br><br>In my environment I use FreeSwitch as media server and session border<br>controller. SIP routing is mostly done with my private B2BUA. The problem<br>itself is in my &quot;hold&quot; functionality. In details: A is calling to B:<br>
<br>&lt;!--<br>     if the calling party is the called party, go to their VM <br>     if the calling party is NOT the called party dial the extension<br>     (1000-1019) for 30 seconds and go to voicemail if the<br>     call fails (continue_on_fail=true), otherwise hang up after a<br>
     successful bridge (hangup_after-bridge=true)<br>--&gt;<br>&lt;extension name=&quot;Local_Extension_from_SP&quot;&gt;<br>  &lt;condition field=&quot;${sip_contact_uri}&quot;<br>expression=&quot;^.*StarPound_.*_B2BUA.*$&quot;/&gt;<br>
  &lt;condition field=&quot;destination_number&quot; expression=&quot;^([0-9]{2,9})$&quot;&gt;<br>    &lt;action application=&quot;set&quot; data=&quot;dialed_extension=$1&quot;/&gt;<br>    &lt;action application=&quot;export&quot; data=&quot;dialed_extension=$1&quot;/&gt;<br>
  &lt;/condition&gt;<br>  &lt;condition field=&quot;${sip_to_host}&quot; expression=&quot;^([^.]*)\..*$&quot;&gt;<br>    &lt;action application=&quot;set&quot; data=&quot;orgname=$1&quot;/&gt;<br>  &lt;/condition&gt;<br>  &lt;condition field=&quot;destination_number&quot; expression=&quot;^${caller_id_number}$&quot;&gt;<br>
    &lt;anti-action application=&quot;set&quot; data=&quot;ringback=${us-ring}&quot;/&gt;<br>    &lt;anti-action application=&quot;set&quot; data=&quot;transfer_ringback=${us-ring}&quot;/&gt;<br>    &lt;anti-action application=&quot;set&quot; data=&quot;call_timeout=10&quot;/&gt;<br>
    &lt;anti-action application=&quot;set&quot; data=&quot;hangup_after_bridge=true&quot;/&gt;<br>    &lt;anti-action application=&quot;set&quot; data=&quot;continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION,USER_NOT_REGISTERED&quot;/&gt;<br>
    &lt;anti-action application=&quot;set&quot; data=&quot;continue_on_fail=true&quot;/&gt;<br>    &lt;anti-action application=&quot;db&quot; data=&quot;insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}&quot;/&gt;<br>
    &lt;anti-action application=&quot;db&quot; data=&quot;insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}&quot;/&gt;<br>    &lt;anti-action application=&quot;set&quot; data=&quot;called_party_callgroup=${user_data(${dialed_extension}@${domain_name}var callgroup)}&quot;/&gt;<br>
    &lt;anti-action application=&quot;db&quot; data=&quot;insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}&quot;/&gt;<br>    &lt;anti-action application=&quot;bridge&quot; data=&quot;user/${dialed_extension}@${domain_name}&quot;/&gt;<br>
    &lt;anti-action application=&quot;answer&quot;/&gt;<br>    &lt;anti-action application=&quot;export&quot; data=&quot;sip_h_X-SPFrom=&amp;quote;${sip_from_user}&amp;quote;&amp;lt;${sip_from_uri}&amp;gt;&quot;/&gt;<br>    &lt;anti-action application=&quot;export&quot; data=&quot;sip_h_X-SPTo=&amp;lt;${sip_to_uri}&amp;gt;&quot;/&gt;<br>
    &lt;anti-action application=&quot;export&quot; data=&quot;sip_h_X-SPCallId=${sip_call_id}&quot;/&gt;<br>    &lt;anti-action application=&quot;bridge&quot; data=&quot;sofia/external/${orgname}send2voicemail@$${starpound_sip_app_server}&quot;/&gt;<br>
  &lt;/condition&gt;<br>&lt;/extension&gt;<br><br>Call being answered. Then B wants to hold a call (A should hear music-on-hold, B should hear nothing but still have a call). To accomplish this I:<br>1. on behalf of B2BUA make call to FreeSwitch &quot;hold&quot; extension, get SDP for music-on-hold (moh_sdp)<br>
&lt;extension name=&quot;hold&quot;&gt;<br>    &lt;condition field=&quot;destination_number&quot; expression=&quot;hold&quot;&gt;<br>      &lt;action application=&quot;answer&quot;/&gt;<br>      &lt;action application=&quot;playback&quot; data=&quot;$${hold_music}&quot;/&gt;<br>
    &lt;/condition&gt;<br>&lt;/extension&gt;<br>2. re-invite A with SDP moh_sdp<br>3. re-invite B with it&#39;s own sdp and attribute &#39;inactive&#39; (also tried re-invite with A&#39;s SDP and &#39;inactive&#39; and with 0.0.0.0 IP in SDP and &#39;inactive&#39; - same results)<br>
<br>Result: both A and B hear music-on-hold.<br>I suspect that the reason is in &#39;bridge&#39; function.. it seems, that it still bridges media against the SIP.<br><br>Here is a snippet from FreeSwitch log related to &quot;strange&quot; (from my point of view) behaviour - when FreeSwitch change media for B to the incorrect one.<br>
Here 1004 is B.<br><br>2009-05-26 13:19:14 [DEBUG] sofia_glue.c:2939 sofia_glue_negotiate_sdp()<br>Audio Codec Compare [GSM:3:8000:20]/[GSM:3:8000:20]<br>2009-05-26 13:19:14 [DEBUG] sofia_glue.c:1863 sofia_glue_tech_set_codec()<br>
Already using GSM<br>2009-05-26 13:19:14 [DEBUG] sofia_glue.c:2899 sofia_glue_negotiate_sdp()<br>Set 2833 dtmf payload to 101<br>2009-05-26 13:19:14 [DEBUG] sofia_glue.c:2908 sofia_glue_negotiate_sdp()<br>Set comfort noise payload to 13<br>
2009-05-26 13:19:14 [DEBUG] sofia_glue.c:2139 sofia_glue_activate_rtp()<br>Audio params changed for sofia/external/<a href="http://6782886802@10.249.194.9:5060">6782886802@10.249.194.9:5060</a> from<br><a href="http://75.101.166.29:27426">75.101.166.29:27426</a> to <a href="http://75.101.166.29:22922">75.101.166.29:22922</a><br>
2009-05-26 13:19:14 [DEBUG] sofia_glue.c:2146 sofia_glue_activate_rtp()<br>AUDIO RTP [sofia/external/<a href="http://6782886802@10.249.194.9:5060">6782886802@10.249.194.9:5060</a>] 10.249.194.9 port<br>28594 -&gt; 75.101.166.29 port 22922 codec: 3 ms: 20<br>
2009-05-26 13:19:14 [DEBUG] sofia_glue.c:2165 sofia_glue_activate_rtp()<br>AUDIO RTP CHANGING DEST TO: [<a href="http://75.101.166.29:22922">75.101.166.29:22922</a>]<br>2009-05-26 13:19:14 [DEBUG] sofia.c:2996 sofia_handle_sip_i_state()<br>
Channel sofia/external/<a href="mailto:1005@10.249.194.9">1005@10.249.194.9</a> entering state [ready][200]<br>2009-05-26 13:19:15 [DEBUG] switch_ivr.c:540 switch_ivr_parse_event()<br>sofia/doublenat5090/<a href="mailto:sip%3A1004@172.16.0.6">sip:1004@172.16.0.6</a>;fs_nat=yes;fs_path=sip%3A1004%40193.33.170.63%3A5060<br>
Command Execute playback(local_stream://moh)<br>EXECUTE sofia/doublenat5090/<a href="mailto:sip%3A1004@172.16.0.6">sip:1004@172.16.0.6</a>;fs_nat=yes;fs_path=sip%3A1004%40193.33.170.63%3A5060 playback(local_stream://moh)<br>
2009-05-26 13:19:15 [DEBUG] mod_local_stream.c:346<br>local_stream_file_open() Opening Stream [moh/8000] 8000hz<br>2009-05-26 13:19:15 [DEBUG] switch_ivr_play_say.c:1084<br>switch_ivr_play_file() Codec Activated L16@8000hz 1 channels 20ms<br>
2009-05-26 13:19:15 [DEBUG] switch_core_io.c:649<br>switch_core_session_write_frame()<br>sofia/doublenat5090/<a href="mailto:sip%3A1004@172.16.0.6">sip:1004@172.16.0.6</a>;fs_nat=yes;fs_path=sip%3A1004%40193.33.170.63%3A5060<br>
receive message [TRANSCODING_NECESSARY]<br><br><br>Any thoughts would be really appreciated!<br>Artem<br><br>