<br><br><div class="gmail_quote">On Wed, Oct 7, 2009 at 2:40 PM, Claudiu Filip <span dir="ltr">&lt;<a href="mailto:claudiu@globtel.ro">claudiu@globtel.ro</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
<br>
Hi Tihomir,<br>
<br>
<br>
   I&#39;ve  done  some  tests  to  see  how  suitable  is freeswitch as a<br>
   SIP/H323  translator  and  you  are  right about the fact that H323<br>
   &#39;alert+open  logical  channel&#39;  will generate a SIP &#39;200 OK&#39;. I was<br>
   able  to fix that with a couple of changes in mod_opal.cpp, however<br>
   some  things  were changed on mod_sofia in the latest svn. (on this<br>
   particular  issue,  open_logical_channel  is  processed  BEFORE the<br>
   alerting,   so   the   call   is   in   SetupPhase  when  the  proc<br>
   OnOpenMediaStream is triggered)<br>
<br>
<br></blockquote><div><br><br><br>yep, thats correct ... i was just wondering why it hangs in SetUpPhase<br><br><br>2009-10-07 16:50:11.690451 [DEBUG] manager.cxx:718 OnOpenMediaStream Call[n03f409711]-EP&lt;h323&gt;[localhost/3263],OpalRTPMediaStream-Source-G.711-ALaw-64k<br>
2009-10-07 16:50:11.690451 [INFO] mod_opal.cpp:1283 opal/<a href="mailto:h323%3A05492122@10.4.4.254">h323:05492122@10.4.4.254</a> initialise opal/h323:05492122@10.4.4.254read audio codec G.711-ALaw-64k for connection FSMediaStream-Sink-G.711-ALaw-64k<br>
2009-10-07 16:50:11.690451 [DEBUG] mod_opal.cpp:1313 Set read audio codec to &lt;&lt; G.711-ALaw-64k for connection FSMediaStream-Sink-G.711-ALaw-64k<br>2009-10-07 16:50:11.691525 [DEBUG] manager.cxx:718 OnOpenMediaStream Call[n03f409711]-EP&lt;local&gt;[1],FSMediaStream-Sink-G.711-ALaw-64k<br>
<b>2009-10-07 16:50:11.691525 [CONSOLE] mod_opal.cpp:852 SetUpPhase =&gt; GetPhase() = &#39;1&#39;</b><br>2009-10-07 16:50:11.691525 [DEBUG] connection.cxx:561 Opened sink stream n03f409711_1 with format G.711-ALaw-64k<br>
2009-10-07 16:50:11.691525 [DEBUG] patch.cxx:341 Created Sink: format=G.711-ALaw-64k<br>2009-10-07 16:50:11.691525 [DEBUG] mediastrm.cxx:666 RTP data size cannot be changed to 160, fixed at 2048<br>2009-10-07 16:50:11.691525 [DEBUG] patch.cxx:179 Added direct media stream sink FSMediaStream-Sink-G.711-ALaw-64k<br>
<br><br><br>this is the original code, and it never triggers eraly_media as never reaches AlertingPhase.<br><br>if (GetMediaStream(stream.GetSessionID(), stream.IsSink()) != NULL) {<br>        // Have open media in both directions.<br>
        if (GetPhase() == AlertingPhase) {<br>            switch_channel_mark_pre_answered(m_fsChannel);<br>            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;LOG ==&gt;\t Alerting =&gt; GetPhase() = &#39;%d&#39;\n&quot;,GetPhase());<br>
<br>        <br>        } else if (GetPhase() &lt; ReleasingPhase) {<br>            switch_channel_mark_answered(m_fsChannel);<br>            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;LOG ==&gt;\t GetPhase() = &#39;%d&#39;\n&quot;,GetPhase());<br>
        }<br>    }<br><br><br><br><br>I tried this, it works for early media but i still need to open a full media path and say the call actually connected ....<br><br><br>   if (GetMediaStream(stream.GetSessionID(), stream.IsSink()) != NULL) {<br>
<br>        // Have open media in both directions.<br>        if (GetPhase() &lt; ConnectedPhase) {<br>            switch_channel_mark_pre_answered(m_fsChannel);<br>            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;EARLY MEDIA =&gt; GetPhase() = &#39;%d&#39;\n&quot;,GetPhase());<br>
<br>        } else if (GetPhase() &lt; ReleasingPhase) {<br>            switch_channel_mark_answered(m_fsChannel);<br>            switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;FULL MEDIA =&gt; GetPhase() = &#39;%d&#39;\n&quot;,GetPhase());<br>
<br>        }<br>    }<br><br><br><br><br><br><br>this is when i&#39;m dong early_media:<br><br><br>2009-10-07 17:45:26.788082 [DEBUG] manager.cxx:718 OnOpenMediaStream Call[c8dce50981]-EP&lt;h323&gt;[localhost/26906],OpalRTPMediaStream-Source-G.711-ALaw-64k<br>
2009-10-07 17:45:26.789158 [INFO] mod_opal.cpp:1279 opal/<a href="mailto:h323%3A05492122@10.4.4.254">h323:05492122@10.4.4.254</a> initialise opal/h323:05492122@10.4.4.254read audio codec G.711-ALaw-64k for connection FSMediaStream-Sink-G.711-ALaw-64k<br>
2009-10-07 17:45:26.789158 [DEBUG] mod_opal.cpp:1309 Set read audio codec to &lt;&lt; G.711-ALaw-64k for connection FSMediaStream-Sink-G.711-ALaw-64k<br>2009-10-07 17:45:26.789158 [DEBUG] manager.cxx:718 OnOpenMediaStream Call[c8dce50981]-EP&lt;local&gt;[1],FSMediaStream-Sink-G.711-ALaw-64k<br>
2009-10-07 17:45:26.789158 [NOTICE] mod_opal.cpp:887 Pre-Answer opal/<a href="mailto:h323%3A05492122@10.4.4.254">h323:05492122@10.4.4.254</a>!<br>2009-10-07 17:45:26.789158 [DEBUG] switch_channel.c:1822 Send signal sofia/internal/<a href="mailto:1001@10.4.62.7">1001@10.4.62.7</a> [BREAK]<br>
<b>2009-10-07 17:45:26.789158 [CONSOLE] mod_opal.cpp:888 EARLY MEDIA =&gt; GetPhase() = &#39;1&#39;</b><br>2009-10-07 17:45:26.789158 [DEBUG] connection.cxx:561 Opened sink stream c8dce50981_1 with format G.711-ALaw-64k<br>
2009-10-07 17:45:26.789158 [DEBUG] patch.cxx:341 Created Sink: format=G.711-ALaw-64k<br>2009-10-07 17:45:26.790236 [DEBUG] switch_ivr_originate.c:2154 sofia/internal/<a href="mailto:1001@10.4.62.7">1001@10.4.62.7</a> receive message [PROGRESS]<br>
2009-10-07 17:45:26.790236 [INFO] switch_ivr_originate.c:2154 Sending early media<br>2009-10-07 17:45:26.790236 [DEBUG] sofia_glue.c:2329 AUDIO RTP [sofia/internal/<a href="mailto:1001@10.4.62.7">1001@10.4.62.7</a>] 10.4.62.7 port 19594 -&gt; 10.4.62.89 port 5004 codec: 8 ms: 20<br>
2009-10-07 17:45:26.790236 [DEBUG] switch_rtp.c:1155 Starting timer [soft] 160 bytes per 20ms<br>2009-10-07 17:45:26.790236 [DEBUG] mediastrm.cxx:666 RTP data size cannot be changed to 160, fixed at 2048<br>2009-10-07 17:45:26.790236 [DEBUG] patch.cxx:179 Added direct media stream sink FSMediaStream-Sink-G.711-ALaw-64k<br>
2009-10-07 17:45:26.790236 [DEBUG] connection.cxx:728 Sink stream of connection Call[c8dce50981]-EP&lt;local&gt;[1] uses patch Patch OpalRTPMediaStream-Source-G.711-ALaw-64k -&gt; FSMediaStream-Sink-G.711-ALaw-64k<br>2009-10-07 17:45:26.791311 [DEBUG] connection.cxx:728 Source stream of connection Call[c8dce50981]-EP&lt;h323&gt;[localhost/26906] uses patch Patch OpalRTPMediaStream-Source-G.711-ALaw-64k -&gt; FSMediaStream-Sink-G.711-ALaw-64k<br>
2009-10-07 17:45:26.791311 [DEBUG] rtpconn.cxx:249 Adding RFC2833 receive handler<br>2009-10-07 17:45:26.791311 [DEBUG] rtpconn.cxx:254 Adding Cisco NSE receive handler<br>2009-10-07 17:45:26.791311 [DEBUG] h323ep.cxx:1118 Started receiving logical channel: G.711-ALaw-64k &lt;2&gt;<br>
2009-10-07 17:45:26.791311 [DEBUG] rtpconn.cxx:496 Releasing session 1<br>2009-10-07 17:45:26.792387 [DEBUG] rtpconn.cxx:496 Releasing session 1<br>2009-10-07 17:45:26.792387 [DEBUG] h323.cxx:2450 Fast starting 2 channels<br>
2009-10-07 17:45:26.792387 [DEBUG] h323ep.cxx:1024 Received alerting PDU.<br>2009-10-07 17:45:26.792387 [DEBUG] manager.cxx:636 OnAlerting Call[c8dce50981]-EP&lt;h323&gt;[localhost/26906]<br>2009-10-07 17:45:26.792387 [DEBUG] call.cxx:184 OnAlerting Call[c8dce50981]-EP&lt;h323&gt;[localhost/26906]<br>
2009-10-07 17:45:26.792387 [DEBUG] localep.cxx:214 SetAlerting(10.4.4.254)<br>2009-10-07 17:45:26.792387 [INFO] mod_sofia.c:1518 Ring SDP:<br>v=0<br>o=FreeSWITCH 1254910732 1254910733 IN IP4 10.4.62.7<br>s=FreeSWITCH<br>c=IN IP4 10.4.62.7<br>
t=0 0<br>m=audio 19594 RTP/AVP 8 101<br>a=rtpmap:8 PCMA/8000<br>a=rtpmap:101 telephone-event/8000<br>a=fmtp:101 0-16<br>a=silenceSupp:off - - - -<br>a=ptime:20<br>a=sendrecv<br><br>2009-10-07 17:45:26.792387 [DEBUG] connection.cxx:1115 SetPhase from SetUpPhase to AlertingPhase for Call[c8dce50981]-EP&lt;local&gt;[1]<br>
2009-10-07 17:45:26.792387 [NOTICE] mod_sofia.c:1521 Pre-Answer sofia/internal/<a href="mailto:1001@10.4.62.7">1001@10.4.62.7</a>!<br>2009-10-07 17:45:26.793458 [DEBUG] switch_core_session.c:630 Send signal sofia/internal/<a href="mailto:1001@10.4.62.7">1001@10.4.62.7</a> [BREAK]<br>
2009-10-07 17:45:26.793458 [DEBUG] switch_ivr_originate.c:2196 Originate Resulted in Success: [opal/<a href="mailto:h323%3A05492122@10.4.4.254">h323:05492122@10.4.4.254</a>]<br>2009-10-07 17:45:26.793458 [DEBUG] switch_channel.c:182 opal/<a href="mailto:h323%3A05492122@10.4.4.254">h323:05492122@10.4.4.254</a> receive message [AUDIO_SYNC]<br>
2009-10-07 17:45:26.793458 [DEBUG] mod_opal.cpp:1156 Received message 20 on connection Call[c8dce50981]-EP&lt;local&gt;[1]<br>2009-10-07 17:45:26.793458 [DEBUG] switch_channel.c:182 sofia/internal/<a href="mailto:1001@10.4.62.7">1001@10.4.62.7</a> receive message [AUDIO_SYNC]<br>
2009-10-07 17:45:26.793458 [DEBUG] switch_ivr_bridge.c:911 opal/<a href="mailto:h323%3A05492122@10.4.4.254">h323:05492122@10.4.4.254</a> receive message [BRIDGE]<br>2009-10-07 17:45:26.793458 [DEBUG] sofia.c:3359 Channel sofia/internal/<a href="mailto:1001@10.4.62.7">1001@10.4.62.7</a> entering state [early][183]<br>
2009-10-07 17:45:26.793458 [DEBUG] mod_opal.cpp:1156 Received message 4 on connection Call[c8dce50981]-EP&lt;local&gt;[1]<br>2009-10-07 17:45:26.793458 [DEBUG] switch_core_session.c:630 Send signal opal/<a href="mailto:h323%3A05492122@10.4.4.254">h323:05492122@10.4.4.254</a> [BREAK]<br>
2009-10-07 17:45:26.794816 [DEBUG] mod_opal.cpp:999 Kill 3 on connection Call[c8dce50981]-EP&lt;local&gt;[1]<br>2009-10-07 17:45:26.794816 [DEBUG] switch_ivr_bridge.c:918 sofia/internal/<a href="mailto:1001@10.4.62.7">1001@10.4.62.7</a> receive message [BRIDGE]<br>
2009-10-07 17:45:26.794816 [DEBUG] switch_core_session.c:630 Send signal sofia/internal/<a href="mailto:1001@10.4.62.7">1001@10.4.62.7</a> [BREAK]<br>2009-10-07 17:45:26.794816 [DEBUG] switch_ivr_bridge.c:962 (opal/<a href="mailto:h323%3A05492122@10.4.4.254">h323:05492122@10.4.4.254</a>) State Change CS_CONSUME_MEDIA -&gt; CS_EXCHANGE_MEDIA<br>
<br>&lt; ----------------- snip ------------------&gt;<br><br><br> 1 entries {<br>            [0]=dialedDigits &quot;1001282122&quot;<br>          }<br>        }<br>        h245Tunneling = true<br>      }<br>    }<br>  }<br>
2009-10-07 17:45:31.892521 [DEBUG] h323.cxx:582 Handling PDU: Connect callRef=26906<br>2009-10-07 17:45:31.892521 [DEBUG] connection.cxx:1115 SetPhase from AlertingPhase to ConnectedPhase for Call[c8dce50981]-EP&lt;h323&gt;[localhost/26906]<br>
2009-10-07 17:45:31.892521 [DEBUG] connection.cxx:513 OnConnected for Call[c8dce50981]-EP&lt;h323&gt;[localhost/26906]<br>2009-10-07 17:45:31.892521 [DEBUG] manager.cxx:652 OnConnected Call[c8dce50981]-EP&lt;h323&gt;[localhost/26906]<br>
2009-10-07 17:45:31.892521 [DEBUG] call.cxx:214 OnConnected Call[c8dce50981]-EP&lt;h323&gt;[localhost/26906]<br>2009-10-07 17:45:31.892521 [DEBUG] connection.cxx:480 SetConnected for Call[c8dce50981]-EP&lt;local&gt;[1]<br>
2009-10-07 17:45:31.892521 [DEBUG] connection.cxx:1115 SetPhase from AlertingPhase to ConnectedPhase for Call[c8dce50981]-EP&lt;local&gt;[1]<br>2009-10-07 17:45:31.892521 [DEBUG] connection.cxx:1115 SetPhase from ConnectedPhase to EstablishedPhase for Call[c8dce50981]-EP&lt;local&gt;[1]<br>
2009-10-07 17:45:31.892521 [DEBUG] connection.cxx:520 OnEstablished Call[c8dce50981]-EP&lt;local&gt;[1]<br>2009-10-07 17:45:31.892521 [DEBUG] connection.cxx:617 Media stream threads started.<br>2009-10-07 17:45:31.892521 [DEBUG] manager.cxx:660 OnEstablished Call[c8dce50981]-EP&lt;local&gt;[1]<br>
2009-10-07 17:45:31.892521 [DEBUG] call.cxx:245 OnEstablished Call[c8dce50981]-EP&lt;local&gt;[1]<br>2009-10-07 17:45:31.892521 [DEBUG] connection.cxx:617 Media stream threads started.<br>2009-10-07 17:45:31.892521 [DEBUG] connection.cxx:1115 SetPhase from ConnectedPhase to EstablishedPhase for Call[c8dce50981]-EP&lt;h323&gt;[localhost/26906]<br>
2009-10-07 17:45:31.892521 [DEBUG] connection.cxx:520 OnEstablished Call[c8dce50981]-EP&lt;h323&gt;[localhost/26906]<br>2009-10-07 17:45:31.892521 [DEBUG] connection.cxx:617 Media stream threads started.<br>2009-10-07 17:45:31.893601 [DEBUG] manager.cxx:660 OnEstablished Call[c8dce50981]-EP&lt;h323&gt;[localhost/26906]<br>
2009-10-07 17:45:31.893601 [DEBUG] call.cxx:245 OnEstablished Call[c8dce50981]-EP&lt;h323&gt;[localhost/26906]<br>2009-10-07 17:45:31.893601 [DEBUG] connection.cxx:617 Media stream threads started.<br>2009-10-07 17:45:31.893601 [DEBUG] h323.cxx:945 Set protocol version to 5<br>
2009-10-07 17:45:31.893601 [DEBUG] h323.cxx:1261 Set remote party name: &quot;10.4.4.254&quot;<br>2009-10-07 17:45:31.893601 [DEBUG] h323.cxx:1269 Set remote application name: &quot;Avaya Multivantage R014x.00.1.731.2 181/19540 Vox Lucida Pty. Ltd.&quot;<br>
2009-10-07 17:45:31.893601 [DEBUG] h323ep.cxx:1087 Received connect PDU.<br>2009-10-07 17:45:31.893601 [DEBUG] h323.cxx:2367 Fast start response with no channels to open<br>2009-10-07 17:45:31.893601 [DEBUG] h323.cxx:3543 InternalEstablishedConnectionCheck: connectionState=HasExecutedSignalConnect fastStartState=FastStartAcknowledged H.245 is ready<br>
<br><br><br>as ConnectMessage was never sent from opal to FS :P<br><br><br><br><br>what was your workaround?<br><br><br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

   The  most  important  problem  I&#39;m having right now is that G729 is<br>
   still  not  working (poor quality due to high buffering). Even with<br>
   the  latest  Opal,  which  includes  the last week patch for jitter<br>
   buffer.  If  you  dont  need G729, I could send you a patch for the<br>
   latest svns (freeswitch, opal, ptlib), ofc no founding needed.<br>
<br>
   There are a couple of bugs in opal itself and h323ing freeswitch<br>
   with opal will bring them in. On the other hand, mod_opal is<br>
   already there, it just needs a few adjustments.<br>
<br>
<br>
Best wishes,<br>
<br>
Claudiu Filip<br>
<br>
<br>
<br>
</blockquote></div><br>