<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][15264] </title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=15264">15264</a></dd>
<dt>Author</dt> <dd>bottleman</dd>
<dt>Date</dt> <dd>2009-10-28 21:59:44 -0500 (Wed, 28 Oct 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>remove trys to implement non standard codecs.
fixxxxes.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcmodendpointsmod_h323bugs">freeswitch/trunk/src/mod/endpoints/mod_h323/bugs</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_h323changestxt">freeswitch/trunk/src/mod/endpoints/mod_h323/changes.txt</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_h323mod_h323cpp">freeswitch/trunk/src/mod/endpoints/mod_h323/mod_h323.cpp</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_h323mod_h323h">freeswitch/trunk/src/mod/endpoints/mod_h323/mod_h323.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunksrcmodendpointsmod_h323bugs"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_h323/bugs (15263 => 15264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_h323/bugs        2009-10-28 22:52:44 UTC (rev 15263)
+++ freeswitch/trunk/src/mod/endpoints/mod_h323/bugs        2009-10-29 02:59:44 UTC (rev 15264)
</span><span class="lines">@@ -1,2 +1,13 @@
</span><span class="cx"> faststart and codecs v CallProceeding due to h323plus, grep &quot;Very Frustrating - S.H.&quot; in h323plus 
</span><del>-source and uncomment commented lines.
</del><span class="cx">\ No newline at end of file
</span><ins>+source and uncomment commented lines.
+
+
+exploration form developer of h323plus:
+
+Yes that should be mera.
+
+The problem is that Callproceeding does not always come from the remote it
+may be generated by the gatekeeper. MERA where sending fast start elements
+in the Call proceeding and connect. The call proceeding where not valid and
+causing the media to fail. Normally (although valid) EP's do not set Fast
+Start in Call proceeding so the code was disabled to resolve the MERA issue.
</ins></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_h323changestxt"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_h323/changes.txt (15263 => 15264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_h323/changes.txt        2009-10-28 22:52:44 UTC (rev 15263)
+++ freeswitch/trunk/src/mod/endpoints/mod_h323/changes.txt        2009-10-29 02:59:44 UTC (rev 15264)
</span><span class="lines">@@ -1,4 +1,6 @@
</span><span class="cx"> 
</span><ins>+fixxxxes
+remove trys to implement non standard codecs.
</ins><span class="cx"> implement jitter-size value option.
</span><span class="cx"> implement gk register retry timer.
</span><span class="cx"> implement h245insetup enable/disable option.
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_h323mod_h323cpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_h323/mod_h323.cpp (15263 => 15264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_h323/mod_h323.cpp        2009-10-28 22:52:44 UTC (rev 15263)
+++ freeswitch/trunk/src/mod/endpoints/mod_h323/mod_h323.cpp        2009-10-29 02:59:44 UTC (rev 15264)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>-        Version 0.0.9
</del><ins>+        Version 0.0.11
</ins><span class="cx"> */
</span><span class="cx"> 
</span><span class="cx"> #include &quot;mod_h323.h&quot;
</span><span class="lines">@@ -25,41 +25,21 @@
</span><span class="cx">     &quot;G.711-ALaw-64k&quot;, &quot;PCMA&quot;,
</span><span class="cx">     &quot;G.711-uLaw-64k&quot;, &quot;PCMU&quot;,
</span><span class="cx">     &quot;GSM-06.10&quot;, &quot;GSM&quot;,
</span><del>-    &quot;MS-GSM&quot;, &quot;msgsm&quot;,
-    &quot;SpeexNarrow&quot;, &quot;speex&quot;,
-    &quot;LPC-10&quot;, &quot;lpc10&quot;,
-    &quot;iLBC-15k2&quot;, &quot;ilbc20&quot;,
-    &quot;iLBC-13k3&quot;, &quot;ilbc30&quot;,
</del><span class="cx">     &quot;G.723&quot;, &quot;G723&quot;,
</span><del>-    &quot;G.726&quot;, &quot;G726&quot;,
-    &quot;G.728&quot;, &quot;G728&quot;,
</del><span class="cx">     &quot;G.729B&quot;, &quot;G729b&quot;,
</span><span class="cx">     &quot;G.729&quot;, &quot;G729&quot;,
</span><del>-    &quot;PCM-16&quot;, &quot;slin&quot;,
</del><span class="cx">     &quot;G.729A&quot;, &quot;G729a&quot;,
</span><span class="cx">     &quot;G.729A/B&quot;, &quot;G729ab&quot;,
</span><span class="cx">     &quot;G.723.1&quot;, &quot;G723.1&quot;,
</span><span class="cx">     &quot;G.723.1(5.3k)&quot;, &quot;G723.1-5k3&quot;,
</span><span class="cx">     &quot;G.723.1A(5.3k)&quot;, &quot;G723.1a-5k3&quot;,
</span><span class="cx">     &quot;G.723.1A(6.3k)&quot;, &quot;G723.1a-6k3&quot;,
</span><del>-    &quot;G.723.1A(6.3k)-Cisco&quot;, &quot;g723.1a-6k3-cisco&quot;,
-    &quot;G.726-16k&quot;, &quot;G726-16&quot;,
-    &quot;G.726-24k&quot;, &quot;G726-24&quot;,
-    &quot;G.726-32k&quot;, &quot;G726-32&quot;,
-    &quot;G.726-40k&quot;, &quot;G726-40&quot;,
-    &quot;iLBC&quot;, &quot;ilbc&quot;,
-    &quot;SpeexNarrow-18.2k&quot;, &quot;speex-18k2&quot;,
-    &quot;SpeexNarrow-15k&quot;, &quot;speex-15k&quot;,
-    &quot;SpeexNarrow-11k&quot;, &quot;speex-11k&quot;,
-    &quot;SpeexNarrow-8k&quot;, &quot;speex-8k&quot;,
-    &quot;SpeexNarrow-5.95k&quot;, &quot;speex-5k95&quot;,
</del><span class="cx">     0
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static switch_status_t on_hangup(switch_core_session_t *session);
</span><span class="cx"> static switch_status_t on_destroy(switch_core_session_t *session);
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> static switch_io_routines_t h323fs_io_routines = {
</span><span class="cx">     /*.outgoing_channel */ create_outgoing_channel,
</span><span class="cx">     /*.read_frame */ FSH323Connection::read_audio_frame,
</span><span class="lines">@@ -88,12 +68,9 @@
</span><span class="cx">     /*.on_destroy*/ on_destroy
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> static FSProcess *opal_process = NULL;
</span><span class="cx"> SWITCH_MODULE_LOAD_FUNCTION(mod_h323_load){
</span><span class="cx">     switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, &quot;Starting loading mod_h323\n&quot;);
</span><del>-

</del><span class="cx">     *module_interface = switch_loadable_module_create_module_interface(pool, modname);
</span><span class="cx">                         
</span><span class="cx">     if (!*module_interface) {
</span><span class="lines">@@ -268,25 +245,19 @@
</span><span class="cx">                 case H245_AudioCapability::e_gsmHalfRate:
</span><span class="cx">                 case H245_AudioCapability::e_gsmEnhancedFullRate:
</span><span class="cx">                         return &quot;GSM&quot;;
</span><del>-                case H245_AudioCapability::e_nonStandard:{
-                        if (cap-&gt;GetFormatName().Find(&quot;726-40&quot;)) return &quot;G726-40&quot;;
-                }        
</del><span class="cx">         }
</span><span class="cx">         return &quot;Unknown&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> FSProcess::FSProcess()
</span><span class="cx">   : PLibraryProcess(&quot;Test&quot;, &quot;mod_h323&quot;, 1, 0, AlphaCode, 1)
</span><span class="cx">   , m_h323endpoint(NULL){
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> FSProcess::~FSProcess(){
</span><span class="cx">   delete m_h323endpoint;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> bool FSProcess::Initialise(switch_loadable_module_interface_t *iface){
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t======&gt;FSProcess::Initialise &quot; &lt;&lt; *this);
</span><span class="cx">         
</span><span class="lines">@@ -309,7 +280,6 @@
</span><span class="cx">                         
</span><span class="cx">         PString codec = ((const char *)mod_h323_globals.codec_string);
</span><span class="cx">         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;Config capabilliti %s \n&quot;,(const char *)codec);
</span><del>-        
</del><span class="cx"> 
</span><span class="cx">         if (!codec.IsEmpty()) {                
</span><span class="cx">                 const char** f = h323_formats;
</span><span class="lines">@@ -338,9 +308,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-//        AddAllCapabilities(0, 0, &quot;*&quot;); 
-
-                
</del><ins>+        
</ins><span class="cx">     AddAllUserInputCapabilities(0,1);
</span><span class="cx">         PTRACE(1, &quot;OpenPhone\tCapability Table:\n&quot; &lt;&lt; setprecision(4) &lt;&lt; capabilities);
</span><span class="cx">         
</span><span class="lines">@@ -358,31 +326,10 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-/*
-    OpalMediaFormatList allCodecs = OpalMediaFormat::GetAllRegisteredMediaFormats();
-    for (OpalMediaFormatList::iterator it = allCodecs.begin(); it != allCodecs.end(); ++it) {
-      if (it-&gt;GetMediaType() == OpalMediaType::Audio()) {
-        it-&gt;SetOptionInteger(OpalAudioFormat::RxFramesPerPacketOption(), 1);
-        it-&gt;SetOptionInteger(OpalAudioFormat::TxFramesPerPacketOption(), 1);
-      }
-    }
-*/
-
</del><span class="cx">     if (!m_gkAddress.IsEmpty() &amp;&amp; !m_gkIdentifer.IsEmpty() &amp;&amp; !m_gkInterface.IsEmpty()) {
</span><span class="cx">                 m_thread = new FSGkRegThread(this,&amp;m_gkAddress,&amp;m_gkIdentifer,&amp;m_gkInterface,m_gkretry);
</span><span class="cx">                 m_thread-&gt;SetAutoDelete();
</span><span class="cx">                 m_thread-&gt;Resume();
</span><del>-        /*
-      if (UseGatekeeper(m_gkAddress, m_gkIdentifer, m_gkInterface))
-        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, &quot;Started gatekeeper: %s\n&quot;,
-                          (const char *)GetGatekeeper()-&gt;GetName());
-      else
-        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
-                          &quot;Could not start gatekeeper: addr=\&quot;%s\&quot;, id=\&quot;%s\&quot;, if=\&quot;%s\&quot;\n&quot;,
-                          (const char *)m_gkAddress,
-                          (const char *)m_gkIdentifer,
-                          (const char *)m_gkInterface);
-        */
</del><span class="cx">     }
</span><span class="cx">         
</span><span class="cx">     return TRUE;
</span><span class="lines">@@ -480,7 +427,7 @@
</span><span class="cx">             for (switch_xml_t xmlParam = switch_xml_child(xmlListener, &quot;param&quot;); xmlParam != NULL; xmlParam = xmlParam-&gt;next) {
</span><span class="cx">                 const char *var = switch_xml_attr_soft(xmlParam, &quot;name&quot;);
</span><span class="cx">                 const char *val = switch_xml_attr_soft(xmlParam, &quot;value&quot;);
</span><del>-                //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, &quot;Var - '%s' and Val - '%s' \n&quot;, var, val);
</del><ins>+
</ins><span class="cx">                 if (!strcasecmp(var, &quot;h323-ip&quot;))
</span><span class="cx">                     ip = val;
</span><span class="cx">                 else if (!strcasecmp(var, &quot;h323-port&quot;))
</span><span class="lines">@@ -541,7 +488,6 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">   return new FSH323Connection(*this,transport,callReference,(switch_caller_profile_t *)userData, fsSession, fsChannel);
</span><del>-  
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool FSH323EndPoint::OnSetGatewayPrefixes(PStringList &amp; prefixes) const{
</span><span class="lines">@@ -732,7 +678,6 @@
</span><span class="cx">                 }
</span><span class="cx">     }
</span><span class="cx">        
</span><del>-        
</del><span class="cx">     switch_caller_profile_t *caller_profile = switch_caller_profile_new(switch_core_session_get_pool(m_fsSession),
</span><span class="cx">                                                                         NULL,
</span><span class="cx">                                                                         /** username */
</span><span class="lines">@@ -791,14 +736,13 @@
</span><span class="cx">         
</span><span class="cx">         H323TransportAddress m_h323transportadd = GetSignallingChannel()-&gt;GetLocalAddress();
</span><span class="cx">         m_h323transportadd.GetIpAddress(m_RTPlocalIP);
</span><del>-//        return H323Connection::CreateRealTimeLogicalChannel(capability,dir,sessionID,param);
</del><ins>+
</ins><span class="cx">         return new FSH323_ExternalRTPChannel(*this, capability, dir, sessionID,m_RTPlocalIP,m_RTPlocalPort);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> PBoolean FSH323Connection::OnStartLogicalChannel(H323Channel &amp; channel){
</span><span class="cx">     PTRACE(4, &quot;mod_h323\t======&gt;FSH323Connection::OnStartLogicalChannel chennel = &quot;&lt;&lt;&amp;channel&lt;&lt;&quot; [&quot;&lt;&lt;*this&lt;&lt;&quot;]&quot;);
</span><span class="cx">     
</span><del>-//    return  H323Connection::OnStartLogicalChannel(channel);
</del><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -811,10 +755,8 @@
</span><span class="cx"> void FSH323Connection::OnReceivedReleaseComplete(const H323SignalPDU &amp; pdu){
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t======&gt;FSH323Connection::OnReceivedReleaseComplete cause = &quot;&lt;&lt;pdu.GetQ931().GetCause()&lt;&lt;&quot; value = &quot;&lt;&lt;(switch_call_cause_t)pdu.GetQ931().GetCause());
</span><span class="cx">         h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
</span><del>-//        tech_pvt-&gt;me = NULL;
</del><span class="cx">         
</span><span class="cx">         switch_channel_hangup(switch_core_session_get_channel(m_fsSession),(switch_call_cause_t)pdu.GetQ931().GetCause()); 
</span><del>-//        on_hangup(GetCallReference(), (const char *)GetCallToken(), pdu.GetQ931().GetCause());
</del><span class="cx">         return H323Connection::OnReceivedReleaseComplete(pdu);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -865,6 +807,7 @@
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t----&gt; Capabilities not NULL &quot;);
</span><ins>+        
</ins><span class="cx">         return true;                                                
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -889,6 +832,7 @@
</span><span class="cx"> 
</span><span class="cx"> void FSH323Connection::setRemoteAddress(const char* remoteIP, WORD remotePort){
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t======&gt;PFSH323Connection::setRemoteAddress remoteIP =&quot;&lt;&lt;remoteIP&lt;&lt;&quot;, remotePort = &quot;&lt;&lt;remotePort&lt;&lt;&quot; &quot;&lt;&lt;*this);
</span><ins>+        
</ins><span class="cx">     if (!m_remotePort) {
</span><span class="cx">         PTRACE(4, &quot;mod_h323\tGot remote RTP address &quot;&lt;&lt;remoteIP&lt;&lt;&quot;:&quot;&lt;&lt;remotePort&lt;&lt;&quot; [&quot;&lt;&lt;*this&lt;&lt;&quot;]&quot;);
</span><span class="cx">         m_remotePort = remotePort;
</span><span class="lines">@@ -925,8 +869,6 @@
</span><span class="cx">         break;
</span><span class="cx">     case SWITCH_SIG_KILL:
</span><span class="cx">     default:
</span><del>-                m_rxAudioOpened.Signal();
-        m_txAudioOpened.Signal();
</del><span class="cx">                 if (switch_rtp_ready(tech_pvt-&gt;rtp_session)) {
</span><span class="cx">                         switch_rtp_kill_socket(tech_pvt-&gt;rtp_session);
</span><span class="cx">                 }
</span><span class="lines">@@ -951,6 +893,7 @@
</span><span class="cx"> void FSH323Connection::OnUserInputTone(char tone, unsigned duration, unsigned logicalChannel, unsigned rtpTimestamp)
</span><span class="cx"> {
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t======&gt;FSH323Connection::OnUserInputTone [&quot; &lt;&lt; *this&lt;&lt;&quot;]&quot;);
</span><ins>+        
</ins><span class="cx">         switch_dtmf_t dtmf = { tone, duration };
</span><span class="cx">     switch_channel_queue_dtmf(m_fsChannel, &amp;dtmf);
</span><span class="cx">         H323Connection::OnUserInputTone( tone,  duration, logicalChannel, rtpTimestamp);
</span><span class="lines">@@ -967,12 +910,8 @@
</span><span class="cx"> 
</span><span class="cx"> switch_status_t FSH323Connection::receive_message(switch_core_session_message_t *msg){
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t======&gt;FSH323Connection::receive_message MSG=&quot; &lt;&lt; msg-&gt;message_id);
</span><del>-        
-        
</del><span class="cx">     switch_channel_t *channel = switch_core_session_get_channel(m_fsSession);
</span><span class="cx"> 
</span><del>-
-
</del><span class="cx">     switch (msg-&gt;message_id) {
</span><span class="cx">     case SWITCH_MESSAGE_INDICATE_BRIDGE:
</span><span class="cx">     case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
</span><span class="lines">@@ -985,25 +924,21 @@
</span><span class="cx"> 
</span><span class="cx">     switch (msg-&gt;message_id) {
</span><span class="cx">                 case SWITCH_MESSAGE_INDICATE_RINGING:{
</span><del>-//                         AnsweringCall(AnswerCallAlertWithMedia);
</del><span class="cx">                          AnsweringCall(AnswerCallPending);
</span><span class="cx">                         break;
</span><span class="cx">                 }
</span><span class="cx">                 case SWITCH_MESSAGE_INDICATE_DEFLECT:{
</span><del>-        /*      PSafePtr&lt;OpalConnection&gt; other = GetOtherPartyConnection();
-                        if (other != NULL)
-                          other-&gt;TransferConnection(msg-&gt;string_arg);
</del><span class="cx">                         break;
</span><del>-        */                
</del><span class="cx">                 }
</span><del>-                case SWITCH_MESSAGE_INDICATE_PROGRESS:{
-                        m_callOnPreAnswer = true;                
</del><ins>+                case SWITCH_MESSAGE_INDICATE_PROGRESS:{                
</ins><span class="cx">                         AnsweringCall(AnswerCallPending);
</span><span class="cx">                         AnsweringCall(AnswerCallDeferredWithMedia);
</span><del>-                        m_txAudioOpened.Wait();
-                        if (!switch_channel_test_flag(m_fsChannel, CF_EARLY_MEDIA)) {
-                                switch_channel_mark_pre_answered(m_fsChannel);
-                        }
</del><ins>+                        
+                        if (m_txChennel &amp;&amp; m_rxChennel)
+                                if (!switch_channel_test_flag(m_fsChannel, CF_EARLY_MEDIA)) {
+                                        switch_channel_mark_pre_answered(m_fsChannel);
+                                }
+                        else m_callOnPreAnswer = true;
</ins><span class="cx">                         break;
</span><span class="cx">                 }
</span><span class="cx">                 case SWITCH_MESSAGE_INDICATE_ANSWER:{
</span><span class="lines">@@ -1012,14 +947,13 @@
</span><span class="cx">                         }
</span><span class="cx">                         AnsweringCall(H323Connection::AnswerCallNow);
</span><span class="cx">                         PTRACE(4, &quot;mod_h323\tMedia started on connection &quot; &lt;&lt; *this);
</span><del>-
-                        m_rxAudioOpened.Wait();
-            m_txAudioOpened.Wait();
-
-                        if (!switch_channel_test_flag(m_fsChannel, CF_EARLY_MEDIA)) {
-                                PTRACE(4, &quot;mod_h323\t--------------------&gt;switch_channel_mark_answered(m_fsChannel) &quot; &lt;&lt; *this);
-                                switch_channel_mark_answered(m_fsChannel);
-                        }
</del><ins>+                
+                        if (m_txChennel &amp;&amp; m_rxChennel)
+                                if (!switch_channel_test_flag(m_fsChannel, CF_EARLY_MEDIA)) {
+                                        PTRACE(4, &quot;mod_h323\t--------------------&gt;switch_channel_mark_answered(m_fsChannel) &quot; &lt;&lt; *this);
+                                        switch_channel_mark_answered(m_fsChannel);
+                                }
+                        else m_ChennelAnswer =  true;
</ins><span class="cx">                         break;
</span><span class="cx">                 }
</span><span class="cx">                 default:{
</span><span class="lines">@@ -1069,13 +1003,7 @@
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t======&gt;FSH323Connection::read_audio_frame &quot; &lt;&lt; *this);
</span><span class="cx">         h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
</span><span class="cx">         tech_pvt-&gt;read_frame.flags = 0;
</span><del>-/*        
-        if (switch_channel_test_private_flag(m_fsChannel, CF_NEED_FLUSH)) {
-        switch_channel_clear_private_flag(m_fsChannel, CF_NEED_FLUSH);
-    } else {            
-        switch_core_timer_next(&amp;tech_pvt-&gt;read_timer);
-    }
-*/        
</del><ins>+
</ins><span class="cx">         switch_set_flag_locked(tech_pvt, TFLAG_READING);
</span><span class="cx">     if (!switch_channel_ready(m_fsChannel)) {
</span><span class="cx">                 PTRACE(4, &quot;mod_h323\t---------&gt; RETURN&quot;);
</span><span class="lines">@@ -1089,8 +1017,6 @@
</span><span class="cx">         return SWITCH_STATUS_FALSE;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-
-        
</del><span class="cx">         switch_status_t status = switch_rtp_zerocopy_read_frame(tech_pvt-&gt;rtp_session, &amp;tech_pvt-&gt;read_frame, flags);
</span><span class="cx">         if (status != SWITCH_STATUS_SUCCESS &amp;&amp; status != SWITCH_STATUS_BREAK) {
</span><span class="cx">                         PTRACE(4, &quot;mod_h323\t---------&gt; RETURN&quot;);
</span><span class="lines">@@ -1166,7 +1092,6 @@
</span><span class="cx"> 
</span><span class="cx"> switch_status_t FSH323Connection::write_video_frame(switch_frame_t *frame, switch_io_flag_t flag, int stream_id){
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t======&gt;FSH323Connection::write_video_frame &quot; &lt;&lt; *this);
</span><del>-//    return write_frame(OpalMediaType::Video(), frame, flag);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ///////////////////////////////////////////////////////////////////////
</span><span class="lines">@@ -1183,9 +1108,9 @@
</span><span class="cx">         , m_fsSession(connection.GetSession())
</span><span class="cx">         , m_capability(&amp;capability)
</span><span class="cx">         , m_RTPlocalPort(dataPort){ 
</span><del>-        h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
</del><span class="cx">         
</span><del>-    m_RTPlocalIP = (const char *)ip.AsString();
</del><ins>+        h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
+        m_RTPlocalIP = (const char *)ip.AsString();
</ins><span class="cx">         SetExternalAddress(H323TransportAddress(ip, dataPort), H323TransportAddress(ip, dataPort+1));
</span><span class="cx">     PTRACE(4, &quot;mod_h323\t======&gt;FSH323_ExternalRTPChannel::FSH323_ExternalRTPChannel &quot;&lt;&lt; GetDirection()&lt;&lt; &quot; addr=&quot;&lt;&lt; m_RTPlocalIP &lt;&lt;&quot;:&quot;&lt;&lt; m_RTPlocalPort&lt;&lt;&quot; [&quot;&lt;&lt;*this&lt;&lt;&quot;]&quot;);        
</span><span class="cx">         
</span><span class="lines">@@ -1214,6 +1139,7 @@
</span><span class="cx"> 
</span><span class="cx"> FSH323_ExternalRTPChannel::~FSH323_ExternalRTPChannel(){
</span><span class="cx">     PTRACE(4, &quot;mod_h323\t======&gt;FSH323_ExternalRTPChannel::~FSH323_ExternalRTPChannel  &quot;&lt;&lt; GetDirection()&lt;&lt;&quot; &quot;&lt;&lt;*this);
</span><ins>+        
</ins><span class="cx">         h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(m_fsSession);
</span><span class="cx">         if (IsRunning()){
</span><span class="cx">                 PTRACE(4, &quot;mod_h323\t-------------&gt;Running&quot;);
</span><span class="lines">@@ -1225,6 +1151,7 @@
</span><span class="cx"> 
</span><span class="cx"> PBoolean FSH323_ExternalRTPChannel::Start(){
</span><span class="cx">     PTRACE(4, &quot;mod_h323\t======&gt;FSH323_ExternalRTPChannel::Start() &quot;&lt;&lt;*this);
</span><ins>+        
</ins><span class="cx">         const char *err = NULL;
</span><span class="cx">         switch_rtp_flag_t flags;
</span><span class="cx">         char * timer_name = NULL;
</span><span class="lines">@@ -1233,7 +1160,6 @@
</span><span class="cx">         if (!(m_conn &amp;&amp; H323_ExternalRTPChannel::Start()))
</span><span class="cx">                 return FALSE;
</span><span class="cx">         
</span><del>-        
</del><span class="cx">         bool isAudio;
</span><span class="cx">     if (m_capability-&gt;GetMainType() == H323Capability::e_Audio) {
</span><span class="cx">         isAudio = true;
</span><span class="lines">@@ -1244,20 +1170,14 @@
</span><span class="cx">     }
</span><span class="cx">         
</span><span class="cx">         H323Codec *codec = GetCodec();
</span><del>-        
-        
</del><ins>+                
</ins><span class="cx">         PTRACE(4, &quot;mod_h323\t-------------------&gt;GetFrameSize() return = &quot;&lt;&lt;m_format-&gt;GetFrameSize());
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t-------------------&gt;GetFrameTime() return = &quot;&lt;&lt;m_format-&gt;GetFrameTime());
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t-------------------&gt;payloadCode = &quot;&lt;&lt;(int)payloadCode);
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t-------------------&gt;m_capability-&gt;GetTxFramesInPacket() return =  &quot;&lt;&lt;m_capability-&gt;GetTxFramesInPacket());
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t-------------------&gt;m_capability-&gt;GetFormatName() return =  &quot;&lt;&lt;m_capability-&gt;GetFormatName());
</span><del>-        
</del><span class="cx">         PTRACE(4, &quot;mod_h323\t-------------------&gt;GetH245CodecName() return =  &quot;&lt;&lt;GetH245CodecName(m_capability));
</span><span class="cx">         
</span><del>-        
-        
-        
-        
</del><span class="cx">         if (GetDirection() == IsReceiver){
</span><span class="cx">                 m_switchCodec = isAudio ? &amp;tech_pvt-&gt;read_codec : &amp;tech_pvt-&gt;vid_read_codec;
</span><span class="cx">         m_switchTimer = isAudio ? &amp;tech_pvt-&gt;read_timer : &amp;tech_pvt-&gt;vid_read_timer;
</span><span class="lines">@@ -1384,14 +1304,13 @@
</span><span class="cx">                         return SWITCH_STATUS_FALSE;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        if (GetDirection() == IsReceiver) m_conn-&gt;m_rxAudioOpened.Signal();
-        else m_conn-&gt;m_txAudioOpened.Signal();
</del><ins>+        
</ins><span class="cx">     PTRACE(4, &quot;mod_h323\t-------------&gt;External RTP address &quot;&lt;&lt;m_RTPremoteIP&lt;&lt;&quot;:&quot;&lt;&lt;m_RTPremotePort);
</span><span class="cx">         switch_mutex_unlock(tech_pvt-&gt;h323_mutex);
</span><span class="cx">         if ( m_conn-&gt;m_ChennelAnswer &amp;&amp; m_conn-&gt;m_rxChennel &amp;&amp;  m_conn-&gt;m_txChennel)
</span><span class="cx">                 switch_channel_mark_answered(m_fsChannel);
</span><span class="cx">                 
</span><del>-        if (m_conn-&gt;m_ChennelProgress &amp;&amp; m_conn-&gt;m_rxChennel)
</del><ins>+        if ((m_conn-&gt;m_ChennelProgress &amp;&amp; m_conn-&gt;m_rxChennel)||(m_conn-&gt;m_callOnPreAnswer &amp;&amp; m_conn-&gt;m_txChennel))
</ins><span class="cx">                 switch_channel_mark_pre_answered(m_fsChannel);
</span><span class="cx">                 
</span><span class="cx">         return true;
</span><span class="lines">@@ -1402,10 +1321,9 @@
</span><span class="cx">                                 const H245_H2250LogicalChannelParameters&amp; param,
</span><span class="cx">                                 unsigned&amp; errorCode){
</span><span class="cx">     PTRACE(4, &quot;mod_h323\t======&gt;FSH323_ExternalRTPChannel::OnReceivedPDU [&quot;&lt;&lt;*this&lt;&lt;&quot;]&quot;);
</span><ins>+        
</ins><span class="cx">     if (!H323_ExternalRTPChannel::OnReceivedPDU(param,errorCode))
</span><span class="cx">                 return true;
</span><del>-//    if (!m_conn || m_conn-&gt;hasRemoteAddress())
-//                return true;
</del><span class="cx">     PIPSocket::Address remoteIpAddress;
</span><span class="cx">     WORD remotePort;
</span><span class="cx">     GetRemoteAddress(remoteIpAddress,remotePort);
</span><span class="lines">@@ -1452,22 +1370,9 @@
</span><span class="cx">                                 PTRACE(4, &quot;mod_h323\t----&gt; Unable to get address and port&quot;);
</span><span class="cx">         }
</span><span class="cx">         
</span><del>-/*        
-    if (!(connection = (FSH323Connection *)H323EndPoint::MakeCallLocked(dest, token, userData, transport))) {
-        return NULL;
-    }
-*/        
-
</del><span class="cx">     if (!(connection = (FSH323Connection *)H323EndPoint::MakeCall(dest, token, userData))) {
</span><span class="cx">         return NULL;
</span><span class="cx">     }
</span><del>-
-/*
-        unsigned int *callReference;
-        
-        *callReference = connection-&gt;GetCallReference();
-        PTRACE(2, &quot;mod_h323\t======&gt;\n\tCreate outgoing cennel\n\tCall token = &quot;&lt;&lt;(const char *)token&lt;&lt;&quot;\n\tCall reference = &quot;&lt;&lt;*callReference);
-*/
</del><span class="cx">         return connection;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1486,18 +1391,7 @@
</span><span class="cx">         if (!(connection = ep.FSMakeCall(outbound_profile-&gt;destination_number,outbound_profile))){
</span><span class="cx">                 return SWITCH_CAUSE_PROTOCOL_ERROR;
</span><span class="cx">         }
</span><del>-/*    PSafePtr &lt; OpalCall &gt; call = manager.FindCallWithLock(token);
</del><span class="cx"> 
</span><del>-    if (call == NULL) {
-        return SWITCH_CAUSE_PROTOCOL_ERROR;
-    }
-
-    PSafePtr &lt; FSConnection &gt; connection = call-&gt;GetConnectionAs &lt; FSConnection &gt; (0);
-
-    if (connection == NULL) {
-        return SWITCH_CAUSE_PROTOCOL_ERROR;
-    }
-*/
</del><span class="cx">     *new_session = connection-&gt;GetSession();
</span><span class="cx">         PTRACE(4, &quot;mod_h323\t---------&gt;GetSession() return = &quot;&lt;&lt;connection-&gt;GetSession());
</span><span class="cx">     return SWITCH_CAUSE_SUCCESS;
</span><span class="lines">@@ -1510,31 +1404,26 @@
</span><span class="cx">     h323_private_t *tech_pvt = (h323_private_t *) switch_core_session_get_private(session);
</span><span class="cx">     
</span><span class="cx">     if (tech_pvt) {
</span><del>-    if (tech_pvt-&gt;read_codec.implementation) {
-        switch_core_codec_destroy(&amp;tech_pvt-&gt;read_codec);
</del><ins>+                if (tech_pvt-&gt;read_codec.implementation) {
+                        switch_core_codec_destroy(&amp;tech_pvt-&gt;read_codec);
+                }
+                if (tech_pvt-&gt;write_codec.implementation) {
+                        switch_core_codec_destroy(&amp;tech_pvt-&gt;write_codec);
+                }
+                if (tech_pvt-&gt;vid_read_codec.implementation) {
+                        switch_core_codec_destroy(&amp;tech_pvt-&gt;vid_read_codec);
+                }
+                if (tech_pvt-&gt;vid_write_codec.implementation) {
+                        switch_core_codec_destroy(&amp;tech_pvt-&gt;vid_write_codec);
+                }
+                if (tech_pvt-&gt;read_timer.timer_interface) {
+                        switch_core_timer_destroy(&amp;tech_pvt-&gt;read_timer);
+                }
+                if (tech_pvt-&gt;vid_read_timer.timer_interface) {
+                        switch_core_timer_destroy(&amp;tech_pvt-&gt;vid_read_timer);
+                }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (tech_pvt-&gt;write_codec.implementation) {
-        switch_core_codec_destroy(&amp;tech_pvt-&gt;write_codec);
-    }
-
-    if (tech_pvt-&gt;vid_read_codec.implementation) {
-        switch_core_codec_destroy(&amp;tech_pvt-&gt;vid_read_codec);
-    }
-
-    if (tech_pvt-&gt;vid_write_codec.implementation) {
-        switch_core_codec_destroy(&amp;tech_pvt-&gt;vid_write_codec);
-    }
-
-    if (tech_pvt-&gt;read_timer.timer_interface) {
-        switch_core_timer_destroy(&amp;tech_pvt-&gt;read_timer);
-    }
-
-    if (tech_pvt-&gt;vid_read_timer.timer_interface) {
-        switch_core_timer_destroy(&amp;tech_pvt-&gt;vid_read_timer);
-    }
-    }
-
</del><span class="cx">     return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_h323mod_h323h"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_h323/mod_h323.h (15263 => 15264)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_h323/mod_h323.h        2009-10-28 22:52:44 UTC (rev 15263)
+++ freeswitch/trunk/src/mod/endpoints/mod_h323/mod_h323.h        2009-10-29 02:59:44 UTC (rev 15264)
</span><span class="lines">@@ -257,8 +257,6 @@
</span><span class="cx">         bool m_txChennel;
</span><span class="cx">         bool m_ChennelAnswer;
</span><span class="cx">         bool m_ChennelProgress;
</span><del>-        PSyncPoint m_rxAudioOpened;
-    PSyncPoint m_txAudioOpened;
</del><span class="cx">   protected:
</span><span class="cx">         FSH323EndPoint * m_endpoint;
</span><span class="cx">         PString m_remoteAddr;
</span><span class="lines">@@ -442,71 +440,7 @@
</span><span class="cx">         unsigned m_type;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-class BaseG726Cap : public H323AudioCapability
-{
-        PCLASSINFO(BaseG726Cap, H323AudioCapability);
</del><span class="cx"> 
</span><del>-public:
-        
-        BaseG726Cap(const char* fname, unsigned type = H245_AudioCapability::e_nonStandard)
-        : H323AudioCapability(24,2), m_name(fname), m_type(type),m_comfortNoise(0),m_scrambled(0)
-        { }
-        
-        virtual PObject * Clone() const{
-                return new BaseG726Cap(*this);
-        }
-
-        virtual H323Codec* CreateCodec(H323Codec::Direction direction) const{
-                return 0;
-        }
-
-        virtual unsigned GetSubType() const{
-                PTRACE(2, &quot;mod_h323\t==============&gt;BaseG726Cap::GetSubType&quot;);
-                return H245_AudioCapability::e_nonStandard;
-        }
-
-        virtual PString GetFormatName() const{
-                PTRACE(2, &quot;mod_h323\t==============&gt;BaseG726Cap::GetFormatName&quot;);
-                return m_name;
-        }
-
-        virtual bool OnSendingPDU(H245_AudioCapability &amp; pdu, unsigned packetSize) const{
-                PTRACE(2, &quot;mod_h323\t==============&gt;BaseG726Cap::OnSendingPDU&quot;);
-                pdu.SetTag(H245_AudioCapability::e_nonStandard);
-                return true;
-        }
-        
-        virtual bool OnReceivedPDU(const H245_AudioCapability &amp; pdu, unsigned &amp; packetSize){
-                PTRACE(2, &quot;mod_h323\t==============&gt;BaseG726Cap::OnReceivedPDU&quot;);
-                return true;
-        }
-
-protected:
-        const char* m_name;
-        int m_comfortNoise;
-        int m_scrambled;
-        unsigned m_type;
-};
-
-
-
-
-#define OPAL_G726_40 &quot;G.726-40k&quot;
-
-char OpalG726_40[] = OPAL_G726_40;
-
-OPAL_MEDIA_FORMAT_DECLARE(OpalG726Format,
-          OpalG726_40,
-          OpalMediaFormat::DefaultAudioSessionID,
-          RTP_DataFrame::G726,
-          TRUE, // Needs jitter
-          8000, // bits/sec
-          5,   // bytes
-          80,   // 10 milliseconds
-          OpalMediaFormat::AudioTimeUnits,
-          0)
-
-
</del><span class="cx"> #define DEFINE_H323_CAPAB(cls,base,param,name) \
</span><span class="cx"> class cls : public base { \
</span><span class="cx">   public: \
</span><span class="lines">@@ -515,6 +449,8 @@
</span><span class="cx"> H323_REGISTER_CAPABILITY(cls,name) \
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+
+
</ins><span class="cx"> DEFINE_H323_CAPAB(FS_G7231_5,BaseG7231Capab,false,OPAL_G7231_5k3&quot;{sw}&quot;)
</span><span class="cx"> DEFINE_H323_CAPAB(FS_G7231_6,BaseG7231Capab,false,OPAL_G7231_6k3&quot;{sw}&quot;)
</span><span class="cx"> DEFINE_H323_CAPAB(FS_G7231A_5,BaseG7231Capab,true,OPAL_G7231A_5k3&quot;{sw}&quot;)
</span><span class="lines">@@ -524,6 +460,6 @@
</span><span class="cx"> DEFINE_H323_CAPAB(FS_G729B,BaseG729Capab,H245_AudioCapability::e_g729wAnnexB,OPAL_G729B&quot;{sw}&quot;)
</span><span class="cx"> DEFINE_H323_CAPAB(FS_G729AB,BaseG729Capab,H245_AudioCapability::e_g729AnnexAwAnnexB,OPAL_G729AB&quot;{sw}&quot;)
</span><span class="cx"> DEFINE_H323_CAPAB(FS_GSM,BaseGSM0610Cap,H245_AudioCapability::e_gsmFullRate,OPAL_GSM0610&quot;{sw}&quot;)
</span><del>-DEFINE_H323_CAPAB(FS_G726_40,BaseG726Cap,H245_AudioCapability::e_nonStandard,OPAL_G726_40&quot;{sw}&quot;)
</del><span class="cx"> 
</span><ins>+
</ins><span class="cx"> static FSProcess *h323_process = NULL;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>