<!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][16824] </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=16824">16824</a></dd>
<dt>Author</dt> <dd>gmaruzz</dd>
<dt>Date</dt> <dd>2010-02-25 12:17:38 -0600 (Thu, 25 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>skypiax: indenting</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunksrcmodendpointsmod_skypiaxmod_skypiaxc">freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_skypiaxskypiaxh">freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h</a></li>
<li><a href="#freeswitchtrunksrcmodendpointsmod_skypiaxskypiax_protocolc">freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunksrcmodendpointsmod_skypiaxmod_skypiaxc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c (16823 => 16824)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c        2010-02-25 17:36:45 UTC (rev 16823)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c        2010-02-25 18:17:38 UTC (rev 16824)
</span><span class="lines">@@ -258,7 +258,6 @@
</span><span class="cx">                 ERRORA(&quot;skypiax_codec FAILED\n&quot;, SKYPIAX_P_LOG);
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><del>-
</del><span class="cx"> #if 0
</span><span class="cx">         if (switch_core_timer_init(&amp;tech_pvt-&gt;timer_read, &quot;soft&quot;, 20, tech_pvt-&gt;read_codec.implementation-&gt;samples_per_packet, skypiax_module_pool) !=
</span><span class="cx">                 SWITCH_STATUS_SUCCESS) {
</span><span class="lines">@@ -279,8 +278,8 @@
</span><span class="cx"> #endif // TIMER_WRITE
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    dtmf_rx_init(&amp;tech_pvt-&gt;dtmf_state, NULL, NULL);
-    dtmf_rx_parms(&amp;tech_pvt-&gt;dtmf_state, 0, 10, 10, -99);
</del><ins>+        dtmf_rx_init(&amp;tech_pvt-&gt;dtmf_state, NULL, NULL);
+        dtmf_rx_parms(&amp;tech_pvt-&gt;dtmf_state, 0, 10, 10, -99);
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">         DEBUGA_SKYPE(&quot;skypiax_tech_init SUCCESS\n&quot;, SKYPIAX_P_LOG);
</span><span class="lines">@@ -548,15 +547,15 @@
</span><span class="cx">         //memset(tech_pvt-&gt;session_uuid_str, '\0', sizeof(tech_pvt-&gt;session_uuid_str));
</span><span class="cx">         //*tech_pvt-&gt;session_uuid_str = '\0';
</span><span class="cx"> 
</span><del>-                        if (tech_pvt-&gt;tcp_cli_thread) {
-                                switch_thread_join(&amp;status, tech_pvt-&gt;tcp_cli_thread);
-                        }
-                        //if(status!=SWITCH_STATUS_SUCCESS)
</del><ins>+        if (tech_pvt-&gt;tcp_cli_thread) {
+                switch_thread_join(&amp;status, tech_pvt-&gt;tcp_cli_thread);
+        }
+        //if(status!=SWITCH_STATUS_SUCCESS)
</ins><span class="cx">         //ERRORA(&quot;%s cli_join HANGUP\n&quot;, SKYPIAX_P_LOG, tech_pvt-&gt;name);
</span><del>-                        if (tech_pvt-&gt;tcp_srv_thread) {
-                                switch_thread_join(&amp;status, tech_pvt-&gt;tcp_srv_thread);
-                        }
-                        //if(status!=SWITCH_STATUS_SUCCESS)
</del><ins>+        if (tech_pvt-&gt;tcp_srv_thread) {
+                switch_thread_join(&amp;status, tech_pvt-&gt;tcp_srv_thread);
+        }
+        //if(status!=SWITCH_STATUS_SUCCESS)
</ins><span class="cx">         //ERRORA(&quot;%s srv_join HANGUP\n&quot;, SKYPIAX_P_LOG, tech_pvt-&gt;name);
</span><span class="cx">         DEBUGA_SKYPE(&quot;%s CHANNEL HANGUP\n&quot;, SKYPIAX_P_LOG, tech_pvt-&gt;name);
</span><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="lines">@@ -700,10 +699,10 @@
</span><span class="cx">         switch_byte_t *data;
</span><span class="cx">         char digit_str[256];
</span><span class="cx">         short *frame_16_khz;
</span><del>-        short frame_8_khz[160];        
</del><ins>+        short frame_8_khz[160];
</ins><span class="cx">         unsigned int i;
</span><span class="cx">         unsigned int a;
</span><del>-size_t bytes_read=0;
</del><ins>+        size_t bytes_read = 0;
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">         channel = switch_core_session_get_channel(session);
</span><span class="lines">@@ -726,7 +725,7 @@
</span><span class="cx">                 switch_buffer_create(skypiax_module_pool, &amp;tech_pvt-&gt;read_buffer, max_len);
</span><span class="cx">                 switch_assert(tech_pvt-&gt;read_buffer);
</span><span class="cx">                 switch_buffer_zero(tech_pvt-&gt;read_buffer);
</span><del>-                tech_pvt-&gt;begin_to_read=1;
</del><ins>+                tech_pvt-&gt;begin_to_read = 1;
</ins><span class="cx">                 //switch_sleep(40000);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -741,7 +740,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">         switch_mutex_lock(tech_pvt-&gt;mutex_audio_srv);
</span><del>-        if(switch_buffer_inuse(tech_pvt-&gt;read_buffer)){
</del><ins>+        if (switch_buffer_inuse(tech_pvt-&gt;read_buffer)) {
</ins><span class="cx">                 bytes_read = switch_buffer_read(tech_pvt-&gt;read_buffer, tech_pvt-&gt;read_frame.data, 640);
</span><span class="cx">                 tech_pvt-&gt;read_frame.datalen = bytes_read;
</span><span class="cx">         }
</span><span class="lines">@@ -797,7 +796,7 @@
</span><span class="cx"> 
</span><span class="cx">                                 if (digit_str[0]) {
</span><span class="cx">                                         switch_time_t new_dtmf_timestamp = switch_time_now();
</span><del>-                                        if ((new_dtmf_timestamp - tech_pvt-&gt;old_dtmf_timestamp) &gt; 350000) {     //FIXME: make it configurable
</del><ins>+                                        if ((new_dtmf_timestamp - tech_pvt-&gt;old_dtmf_timestamp) &gt; 350000) {        //FIXME: make it configurable
</ins><span class="cx">                                                 char *p = digit_str;
</span><span class="cx">                                                 switch_channel_t *channel = switch_core_session_get_channel(session);
</span><span class="cx"> 
</span><span class="lines">@@ -809,16 +808,11 @@
</span><span class="cx">                                                         p++;
</span><span class="cx">                                                 }
</span><span class="cx">                                                 NOTICA(&quot;DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n&quot;, SKYPIAX_P_LOG, digit_str, (unsigned int) new_dtmf_timestamp,
</span><del>-                                                                (unsigned int) (new_dtmf_timestamp - tech_pvt-&gt;old_dtmf_timestamp));
</del><ins>+                                                           (unsigned int) (new_dtmf_timestamp - tech_pvt-&gt;old_dtmf_timestamp));
</ins><span class="cx">                                                 tech_pvt-&gt;old_dtmf_timestamp = new_dtmf_timestamp;
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><del>-
-
-
-
-
</del><span class="cx"> #if SWITCH_BYTE_ORDER == __BIG_ENDIAN
</span><span class="cx">                         if (switch_test_flag(tech_pvt, TFLAG_LINEAR)) {
</span><span class="cx">                                 switch_swap_linear((*frame)-&gt;data, (int) (*frame)-&gt;datalen / 2);
</span><span class="lines">@@ -835,7 +829,7 @@
</span><span class="cx">         DEBUGA_SKYPE(&quot;CHANNEL READ FALSE\n&quot;, SKYPIAX_P_LOG);
</span><span class="cx">         return SWITCH_STATUS_FALSE;
</span><span class="cx"> 
</span><del>-cng:
</del><ins>+  cng:
</ins><span class="cx">         data = (switch_byte_t *) tech_pvt-&gt;read_frame.data;
</span><span class="cx">         data[0] = 65;
</span><span class="cx">         data[1] = 0;
</span><span class="lines">@@ -876,14 +870,14 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         switch_mutex_lock(tech_pvt-&gt;mutex_audio_cli);
</span><del>-        if(switch_buffer_freespace(tech_pvt-&gt;write_buffer) &lt; frame-&gt;datalen){
</del><ins>+        if (switch_buffer_freespace(tech_pvt-&gt;write_buffer) &lt; frame-&gt;datalen) {
</ins><span class="cx">                 //WARNINGA(&quot;NO SPACE WRITE: %d\n&quot;, SKYPIAX_P_LOG, frame-&gt;datalen);
</span><span class="cx">                 switch_buffer_toss(tech_pvt-&gt;write_buffer, frame-&gt;datalen);
</span><span class="cx">         }
</span><span class="cx">         switch_buffer_write(tech_pvt-&gt;write_buffer, frame-&gt;data, frame-&gt;datalen);
</span><span class="cx">         switch_mutex_unlock(tech_pvt-&gt;mutex_audio_cli);
</span><span class="cx"> 
</span><del>-        tech_pvt-&gt;begin_to_write=1;
</del><ins>+        tech_pvt-&gt;begin_to_write = 1;
</ins><span class="cx"> 
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="lines">@@ -1270,7 +1264,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        globals.start_port=32769;
</del><ins>+        globals.start_port = 32769;
</ins><span class="cx">         if ((interfaces = switch_xml_child(cfg, &quot;per_interface_settings&quot;))) {
</span><span class="cx">                 int i = 0;
</span><span class="cx"> 
</span><span class="lines">@@ -1332,7 +1326,7 @@
</span><span class="cx">                                         tcp_cli_port = val;
</span><span class="cx">                                 } else if (!strcasecmp(var, &quot;tcp_srv_port&quot;)) {
</span><span class="cx">                                         tcp_srv_port = val;
</span><del>-#endif//0
</del><ins>+#endif //0
</ins><span class="cx">                                 } else if (!strcasecmp(var, &quot;X11-display&quot;) || !strcasecmp(var, &quot;X11_display&quot;)) {
</span><span class="cx">                                         X11_display = val;
</span><span class="cx">                                 } else if (!strcasecmp(var, &quot;max_digits&quot;) || !strcasecmp(var, &quot;max-digits&quot;)) {
</span><span class="lines">@@ -1374,7 +1368,7 @@
</span><span class="cx">                                 ERRORA(&quot;interface missing REQUIRED param 'tcp_srv_port'\n&quot;, SKYPIAX_P_LOG);
</span><span class="cx">                                 continue;
</span><span class="cx">                         }
</span><del>-#endif//0
</del><ins>+#endif //0
</ins><span class="cx">                         if (!id) {
</span><span class="cx">                                 ERRORA(&quot;interface missing REQUIRED param 'id'\n&quot;, SKYPIAX_P_LOG);
</span><span class="cx">                                 continue;
</span><span class="lines">@@ -1442,7 +1436,7 @@
</span><span class="cx">                                 globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port = atoi(tcp_cli_port);
</span><span class="cx">                                 globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port = atoi(tcp_srv_port);
</span><span class="cx"> #endif /* WIN32 */
</span><del>-#endif//0
</del><ins>+#endif //0
</ins><span class="cx">                                 switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].X11_display, X11_display);
</span><span class="cx">                                 switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].skype_user, skype_user);
</span><span class="cx">                                 switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].context, context);
</span><span class="lines">@@ -1477,7 +1471,7 @@
</span><span class="cx">                                 DEBUGA_SKYPE
</span><span class="cx">                                         (&quot;interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port=%d\n&quot;,
</span><span class="cx">                                          SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port);
</span><del>-#endif//0
</del><ins>+#endif //0
</ins><span class="cx">                                 DEBUGA_SKYPE(&quot;interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].name=%s\n&quot;,
</span><span class="cx">                                                          SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].name);
</span><span class="cx">                                 DEBUGA_SKYPE
</span><span class="lines">@@ -1565,14 +1559,14 @@
</span><span class="cx">                                         switch_sleep(10000);
</span><span class="cx">                                         skypiax_signaling_write(&amp;globals.SKYPIAX_INTERFACES[interface_id], &quot;SET USERSTATUS ONLINE&quot;);
</span><span class="cx">                                         switch_sleep(10000);
</span><del>-                                        if(globals.SKYPIAX_INTERFACES[interface_id].silent_mode){
</del><ins>+                                        if (globals.SKYPIAX_INTERFACES[interface_id].silent_mode) {
</ins><span class="cx">                                                 skypiax_signaling_write(&amp;globals.SKYPIAX_INTERFACES[interface_id], &quot;SET SILENT_MODE ON&quot;);
</span><span class="cx">                                                 switch_sleep(10000);
</span><span class="cx">                                                 skypiax_signaling_write(&amp;globals.SKYPIAX_INTERFACES[interface_id], &quot;SET SILENT_MODE OFF&quot;);
</span><span class="cx">                                                 switch_sleep(10000);
</span><span class="cx">                                                 skypiax_signaling_write(&amp;globals.SKYPIAX_INTERFACES[interface_id], &quot;SET SILENT_MODE ON&quot;);
</span><span class="cx">                                                 switch_sleep(10000);
</span><del>-                                                }
</del><ins>+                                        }
</ins><span class="cx">                                 } else {
</span><span class="cx">                                         ERRORA
</span><span class="cx">                                                 (&quot;The Skype client to which we are connected FAILED to gave us CURRENTUSERHANDLE=%s, interface_id=%d FAILED to start. No Skype client logged in as '%s' has been found. Please (re)launch a Skype client logged in as '%s'. Skypiax exiting now\n&quot;,
</span><span class="lines">@@ -1606,8 +1600,7 @@
</span><span class="cx">                                 DEBUGA_SKYPE(&quot;i=%d globals.SKYPIAX_INTERFACES[%d].destination=%s\n&quot;, SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].destination);
</span><span class="cx">                                 DEBUGA_SKYPE(&quot;i=%d globals.SKYPIAX_INTERFACES[%d].report_incoming_chatmessages=%d\n&quot;, SKYPIAX_P_LOG, i, i,
</span><span class="cx">                                                          globals.SKYPIAX_INTERFACES[i].report_incoming_chatmessages);
</span><del>-                                DEBUGA_SKYPE(&quot;i=%d globals.SKYPIAX_INTERFACES[%d].silent_mode=%d\n&quot;, SKYPIAX_P_LOG, i, i,
-                                                         globals.SKYPIAX_INTERFACES[i].silent_mode);
</del><ins>+                                DEBUGA_SKYPE(&quot;i=%d globals.SKYPIAX_INTERFACES[%d].silent_mode=%d\n&quot;, SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].silent_mode);
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -1793,7 +1786,7 @@
</span><span class="cx">                                 skypiax_signaling_write(tech_pvt, &quot;DIE&quot;);
</span><span class="cx">                                 switch_sleep(10000);
</span><span class="cx">                                 switch_file_write(tech_pvt-&gt;SkypiaxHandles.fdesc[1], &quot;sciutati&quot;, &amp;howmany);        // let's the controldev_thread die
</span><del>-                                
</del><ins>+
</ins><span class="cx"> #else /* WIN32 */
</span><span class="cx">                                 howmany = write(tech_pvt-&gt;SkypiaxHandles.fdesc[1], &quot;sciutati&quot;, howmany);
</span><span class="cx"> #endif /* WIN32 */
</span><span class="lines">@@ -1805,7 +1798,6 @@
</span><span class="cx">                                         DEBUGA_SKYPE(&quot;got FALSE here, thread probably was already dead. GetLastError returned: %d\n&quot;, SKYPIAX_P_LOG, GetLastError());
</span><span class="cx">                                         //globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread = NULL;
</span><span class="cx">                                 }
</span><del>-                                
</del><span class="cx"> //cicopet
</span><span class="cx"> #else
</span><span class="cx">                                 if (tech_pvt-&gt;SkypiaxHandles.disp) {
</span><span class="lines">@@ -1832,12 +1824,12 @@
</span><span class="cx">                         if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) {
</span><span class="cx">                                 switch_thread_join(&amp;status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread);
</span><span class="cx">                         }
</span><del>-                        if(status != SWITCH_STATUS_SUCCESS)
</del><ins>+                        if (status != SWITCH_STATUS_SUCCESS)
</ins><span class="cx">                                 DEBUGA_SKYPE(&quot;got FALSE here, thread was not joined\n&quot;, SKYPIAX_P_LOG);
</span><span class="cx">                         if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) {
</span><span class="cx">                                 switch_thread_join(&amp;status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread);
</span><span class="cx">                         }
</span><del>-                        if(status != SWITCH_STATUS_SUCCESS)
</del><ins>+                        if (status != SWITCH_STATUS_SUCCESS)
</ins><span class="cx">                                 DEBUGA_SKYPE(&quot;got FALSE here, thread was not joined\n&quot;, SKYPIAX_P_LOG);
</span><span class="cx"> #ifndef WIN32
</span><span class="cx">                         WARNINGA(&quot;SHUTDOWN interface_id=%d\n&quot;, SKYPIAX_P_LOG, interface_id);
</span><span class="lines">@@ -1893,11 +1885,13 @@
</span><span class="cx"> 
</span><span class="cx">         if (channel) {
</span><span class="cx"> 
</span><del>-                if (switch_channel_test_flag(channel, CF_BRIDGED) &amp;&amp; !switch_true(switch_channel_get_variable(channel, &quot;skype_add_outband_dtmf_also_when_bridged&quot;))) {
</del><ins>+                if (switch_channel_test_flag(channel, CF_BRIDGED)
+                        &amp;&amp; !switch_true(switch_channel_get_variable(channel, &quot;skype_add_outband_dtmf_also_when_bridged&quot;))) {
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">                         NOTICA
</span><del>-                                (&quot;received DTMF '%c' on channel %s, but we're BRIDGED, so we DO NOT relay it out of band. If you DO want to relay it out of band when bridged too, on top of audio DTMF, set the channel variable 'skype_add_outband_dtmf_also_when_bridged=true' \n&quot;, SKYPIAX_P_LOG, value[0], switch_channel_get_name(channel));
</del><ins>+                                (&quot;received DTMF '%c' on channel %s, but we're BRIDGED, so we DO NOT relay it out of band. If you DO want to relay it out of band when bridged too, on top of audio DTMF, set the channel variable 'skype_add_outband_dtmf_also_when_bridged=true' \n&quot;,
+                                 SKYPIAX_P_LOG, value[0], switch_channel_get_name(channel));
</ins><span class="cx"> 
</span><span class="cx">                 } else {
</span><span class="cx"> 
</span><span class="lines">@@ -1923,11 +1917,10 @@
</span><span class="cx"> {
</span><span class="cx">         switch_threadattr_t *thd_attr = NULL;
</span><span class="cx"> 
</span><del>-tech_pvt-&gt;begin_to_write=0;
-tech_pvt-&gt;begin_to_read=0;
</del><ins>+        tech_pvt-&gt;begin_to_write = 0;
+        tech_pvt-&gt;begin_to_read = 0;
</ins><span class="cx"> #if 1
</span><del>-        if (switch_core_timer_init(&amp;tech_pvt-&gt;timer_read, &quot;soft&quot;, 20, 320, skypiax_module_pool) !=
-                SWITCH_STATUS_SUCCESS) {
</del><ins>+        if (switch_core_timer_init(&amp;tech_pvt-&gt;timer_read, &quot;soft&quot;, 20, 320, skypiax_module_pool) != SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                 ERRORA(&quot;setup timer failed\n&quot;, SKYPIAX_P_LOG);
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="lines">@@ -1936,8 +1929,7 @@
</span><span class="cx"> 
</span><span class="cx"> #ifdef TIMER_WRITE
</span><span class="cx">         //if (switch_core_timer_init(&amp;tech_pvt-&gt;timer_write, &quot;soft&quot;, 10, 320, skypiax_module_pool) !=
</span><del>-        if (switch_core_timer_init(&amp;tech_pvt-&gt;timer_write, &quot;soft&quot;, 20, 320, skypiax_module_pool) !=
-                SWITCH_STATUS_SUCCESS) {
</del><ins>+        if (switch_core_timer_init(&amp;tech_pvt-&gt;timer_write, &quot;soft&quot;, 20, 320, skypiax_module_pool) != SWITCH_STATUS_SUCCESS) {
</ins><span class="cx">                 ERRORA(&quot;setup timer failed\n&quot;, SKYPIAX_P_LOG);
</span><span class="cx">                 return SWITCH_STATUS_FALSE;
</span><span class="cx">         }
</span><span class="lines">@@ -2699,11 +2691,12 @@
</span><span class="cx">         return SWITCH_STATUS_SUCCESS;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-int next_port(void){
</del><ins>+int next_port(void)
+{
</ins><span class="cx">         switch_mutex_lock(globals.mutex);
</span><span class="cx">         globals.start_port++;
</span><del>-        if(globals.start_port == 65000)
-                globals.start_port=32769;
</del><ins>+        if (globals.start_port == 65000)
+                globals.start_port = 32769;
</ins><span class="cx">         switch_mutex_unlock(globals.mutex);
</span><span class="cx">         return (globals.start_port - 1);
</span><span class="cx"> }
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skypiaxskypiaxh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h (16823 => 16824)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h        2010-02-25 17:36:45 UTC (rev 16823)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h        2010-02-25 18:17:38 UTC (rev 16824)
</span><span class="lines">@@ -284,13 +284,13 @@
</span><span class="cx">         uint32_t report_incoming_chatmessages;
</span><span class="cx">         switch_timer_t timer_read;
</span><span class="cx">         switch_timer_t timer_write;
</span><del>-int begin_to_write;
-int begin_to_read;
-                 dtmf_rx_state_t dtmf_state;
-        switch_time_t old_dtmf_timestamp;
-                switch_buffer_t *write_buffer;
-                switch_buffer_t *read_buffer;
-int silent_mode;
</del><ins>+        int begin_to_write;
+        int begin_to_read;
+        dtmf_rx_state_t dtmf_state;
+        switch_time_t old_dtmf_timestamp;
+        switch_buffer_t *write_buffer;
+        switch_buffer_t *read_buffer;
+        int silent_mode;
</ins><span class="cx"> 
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skypiaxskypiax_protocolc"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (16823 => 16824)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c        2010-02-25 17:36:45 UTC (rev 16823)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c        2010-02-25 18:17:38 UTC (rev 16824)
</span><span class="lines">@@ -55,9 +55,9 @@
</span><span class="cx">         if (*which_port != 0)
</span><span class="cx">                 start_port = *which_port;
</span><span class="cx"> #ifdef WIN32
</span><del>-        start_port=(unsigned short)next_port();
</del><ins>+        start_port = (unsigned short) next_port();
</ins><span class="cx"> #else
</span><del>-        start_port=(unsigned short)next_port();
</del><ins>+        start_port = (unsigned short) next_port();
</ins><span class="cx"> #endif
</span><span class="cx">         my_addr.sin_port = htons(start_port);
</span><span class="cx">         //fcntl(s, F_SETFL, O_NONBLOCK);
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">                         DEBUGA_SKYPE(&quot;READING: |||%s||| \n&quot;, SKYPIAX_P_LOG, message);
</span><span class="cx">                         //}
</span><span class="cx">                         if (!strcasecmp(message, &quot;SILENT_MODE OFF&quot;)) {
</span><del>-                                if(tech_pvt-&gt;silent_mode){
</del><ins>+                                if (tech_pvt-&gt;silent_mode) {
</ins><span class="cx">                                         DEBUGA_SKYPE(&quot;Resetting SILENT_MODE on skype_call: %s.\n&quot;, SKYPIAX_P_LOG, id);
</span><span class="cx">                                         skypiax_signaling_write(tech_pvt, &quot;SET SILENT_MODE ON&quot;);
</span><span class="cx">                                         switch_sleep(1000);
</span><span class="lines">@@ -201,9 +201,9 @@
</span><span class="cx">                                 } else if (!strncasecmp(message, &quot;ERROR 592 ALTER CALL&quot;, 19)) {
</span><span class="cx">                                         ERRORA(&quot;Skype got ERROR about TRANSFERRING, no problem: |||%s|||\n&quot;, SKYPIAX_P_LOG, message);
</span><span class="cx">                                 } else if (!strncasecmp(message, &quot;ERROR 559 CALL&quot;, 13)) {
</span><del>-                                        if(tech_pvt-&gt;interface_state == SKYPIAX_STATE_PREANSWER){
</del><ins>+                                        if (tech_pvt-&gt;interface_state == SKYPIAX_STATE_PREANSWER) {
</ins><span class="cx">                                                 DEBUGA_SKYPE(&quot;Skype got ERROR about a failed action (probably TRYING to ANSWER A CALL), let's go down: |||%s|||\n&quot;, SKYPIAX_P_LOG,
</span><del>-                                                                message);
</del><ins>+                                                                         message);
</ins><span class="cx">                                                 tech_pvt-&gt;skype_callflow = CALLFLOW_STATUS_FINISHED;
</span><span class="cx">                                                 ERRORA(&quot;skype_call now is DOWN\n&quot;, SKYPIAX_P_LOG);
</span><span class="cx">                                                 tech_pvt-&gt;skype_call_id[0] = '\0';
</span><span class="lines">@@ -212,7 +212,7 @@
</span><span class="cx"> 
</span><span class="cx">                                         } else {
</span><span class="cx">                                                 DEBUGA_SKYPE(&quot;Skype got ERROR about a failed action (probably TRYING to HANGUP A CALL), no problem: |||%s|||\n&quot;, SKYPIAX_P_LOG,
</span><del>-                                                                message);
</del><ins>+                                                                         message);
</ins><span class="cx">                                         }
</span><span class="cx">                                 } else {
</span><span class="cx">                                         ERRORA(&quot;Skype got ERROR: |||%s|||\n&quot;, SKYPIAX_P_LOG, message);
</span><span class="lines">@@ -510,11 +510,11 @@
</span><span class="cx">                                 if (!strcasecmp(prop, &quot;FAILUREREASON&quot;)) {
</span><span class="cx">                                         DEBUGA_SKYPE(&quot;Skype FAILED on skype_call %s. Let's wait for the FAILED message.\n&quot;, SKYPIAX_P_LOG, id);
</span><span class="cx">                                 }
</span><del>-                                if (!strcasecmp(prop, &quot;DURATION&quot;)) { /* each 20 seconds, we sync ithe timers */
-                                        if(!((atoi(value) % 20))){
-                                        switch_core_timer_sync(&amp;tech_pvt-&gt;timer_read);
-                                        switch_core_timer_sync(&amp;tech_pvt-&gt;timer_write);
-                                        DEBUGA_SKYPE(&quot;Synching on skype_call: %s.\n&quot;, SKYPIAX_P_LOG, id);
</del><ins>+                                if (!strcasecmp(prop, &quot;DURATION&quot;)) {        /* each 20 seconds, we sync ithe timers */
+                                        if (!((atoi(value) % 20))) {
+                                                switch_core_timer_sync(&amp;tech_pvt-&gt;timer_read);
+                                                switch_core_timer_sync(&amp;tech_pvt-&gt;timer_write);
+                                                DEBUGA_SKYPE(&quot;Synching on skype_call: %s.\n&quot;, SKYPIAX_P_LOG, id);
</ins><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="cx">                                 if (!strcasecmp(prop, &quot;DURATION&quot;) &amp;&amp; (!strcasecmp(value, &quot;1&quot;))) {
</span><span class="lines">@@ -761,7 +761,7 @@
</span><span class="cx">         unsigned int size = sizeof(int);
</span><span class="cx"> #endif /* WIN32 */
</span><span class="cx">         unsigned int fd;
</span><del>-        short srv_in[SAMPLES_PER_FRAME*10];
</del><ins>+        short srv_in[SAMPLES_PER_FRAME * 10];
</ins><span class="cx">         //short srv_out[SAMPLES_PER_FRAME / 2];
</span><span class="cx">         //struct sockaddr_in my_addr;
</span><span class="cx">         struct sockaddr_in remote_addr;
</span><span class="lines">@@ -784,9 +784,9 @@
</span><span class="cx"> 
</span><span class="cx">         /****************************/
</span><span class="cx">         while (tech_pvt &amp;&amp; tech_pvt-&gt;interface_state != SKYPIAX_STATE_DOWN
</span><del>-                        &amp;&amp; (tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_INPROGRESS
-                                || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
-                                || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt-&gt;skype_callflow == SKYPIAX_STATE_UP)) {
</del><ins>+                   &amp;&amp; (tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_INPROGRESS
+                           || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
+                           || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt-&gt;skype_callflow == SKYPIAX_STATE_UP)) {
</ins><span class="cx"> 
</span><span class="cx">                 unsigned int fdselectgio;
</span><span class="cx">                 int rtgio;
</span><span class="lines">@@ -823,9 +823,9 @@
</span><span class="cx">                                 if (!(running &amp;&amp; tech_pvt-&gt;running))
</span><span class="cx">                                         break;
</span><span class="cx">                                 while (tech_pvt &amp;&amp; tech_pvt-&gt;interface_state != SKYPIAX_STATE_DOWN
</span><del>-                                                &amp;&amp; (tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_INPROGRESS
-                                                        || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
-                                                        || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt-&gt;skype_callflow == SKYPIAX_STATE_UP)) {
</del><ins>+                                           &amp;&amp; (tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_INPROGRESS
+                                                   || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
+                                                   || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt-&gt;skype_callflow == SKYPIAX_STATE_UP)) {
</ins><span class="cx"> 
</span><span class="cx">                                         unsigned int fdselect;
</span><span class="cx">                                         int rt;
</span><span class="lines">@@ -849,26 +849,26 @@
</span><span class="cx">                                                 } else {
</span><span class="cx">                                                         continue;
</span><span class="cx">                                                 }
</span><del>-                                                if(tech_pvt-&gt;begin_to_read==0){
</del><ins>+                                                if (tech_pvt-&gt;begin_to_read == 0) {
</ins><span class="cx">                                                         DEBUGA_SKYPE(&quot;len=%d\n&quot;, SKYPIAX_P_LOG, len);
</span><span class="cx">                                                         continue;
</span><span class="cx">                                                 }
</span><span class="cx"> 
</span><span class="cx">                                                 if (len == -1) {
</span><del>-                                                        DEBUGA_SKYPE(&quot;len=%d, error: %s\n&quot;, SKYPIAX_P_LOG, len,  strerror(errno));
</del><ins>+                                                        DEBUGA_SKYPE(&quot;len=%d, error: %s\n&quot;, SKYPIAX_P_LOG, len, strerror(errno));
</ins><span class="cx">                                                         break;
</span><span class="cx">                                                 }
</span><del>-                                                nospace=0;
</del><ins>+                                                nospace = 0;
</ins><span class="cx">                                                 if (len &gt; 0) {
</span><span class="cx">                                                         switch_mutex_lock(tech_pvt-&gt;mutex_audio_srv);
</span><del>-                                                        if(switch_buffer_freespace(tech_pvt-&gt;read_buffer) &lt; len){
</del><ins>+                                                        if (switch_buffer_freespace(tech_pvt-&gt;read_buffer) &lt; len) {
</ins><span class="cx">                                                                 //switch_buffer_zero(tech_pvt-&gt;read_buffer);
</span><del>-                                                                nospace=1;
</del><ins>+                                                                nospace = 1;
</ins><span class="cx">                                                                 switch_buffer_toss(tech_pvt-&gt;read_buffer, len);
</span><span class="cx">                                                         }
</span><span class="cx">                                                         switch_buffer_write(tech_pvt-&gt;read_buffer, srv_in, len);
</span><span class="cx">                                                         switch_mutex_unlock(tech_pvt-&gt;mutex_audio_srv);
</span><del>-                                                        if(nospace){
</del><ins>+                                                        if (nospace) {
</ins><span class="cx">                                                                 //WARNINGA(&quot;NO SPACE READ: there was no space for: %d\n&quot;, SKYPIAX_P_LOG, len);
</span><span class="cx">                                                         }
</span><span class="cx">                                                 } else if (len == 0) {
</span><span class="lines">@@ -878,7 +878,7 @@
</span><span class="cx">                                                         DEBUGA_SKYPE(&quot;len=%d\n&quot;, SKYPIAX_P_LOG, len);
</span><span class="cx">                                                 }
</span><span class="cx"> 
</span><del>-                                        } else if(rt==0){
</del><ins>+                                        } else if (rt == 0) {
</ins><span class="cx">                                                 continue;
</span><span class="cx">                                         } else {
</span><span class="cx">                                                 DEBUGA_SKYPE(&quot;SRV rt=%d\n&quot;, SKYPIAX_P_LOG, rt);
</span><span class="lines">@@ -941,9 +941,9 @@
</span><span class="cx"> 
</span><span class="cx">         /****************************/
</span><span class="cx">         while (tech_pvt &amp;&amp; tech_pvt-&gt;interface_state != SKYPIAX_STATE_DOWN
</span><del>-                        &amp;&amp; (tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_INPROGRESS
-                                || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
-                                || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt-&gt;skype_callflow == SKYPIAX_STATE_UP)) {
</del><ins>+                   &amp;&amp; (tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_INPROGRESS
+                           || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
+                           || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt-&gt;skype_callflow == SKYPIAX_STATE_UP)) {
</ins><span class="cx"> 
</span><span class="cx">                 unsigned int fdselectgio;
</span><span class="cx">                 int rtgio;
</span><span class="lines">@@ -981,9 +981,9 @@
</span><span class="cx">                                 if (!(running &amp;&amp; tech_pvt-&gt;running))
</span><span class="cx">                                         break;
</span><span class="cx">                                 while (tech_pvt &amp;&amp; tech_pvt-&gt;interface_state != SKYPIAX_STATE_DOWN
</span><del>-                                                &amp;&amp; (tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_INPROGRESS
-                                                        || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
-                                                        || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt-&gt;skype_callflow == SKYPIAX_STATE_UP)) {
</del><ins>+                                           &amp;&amp; (tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_INPROGRESS
+                                                   || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
+                                                   || tech_pvt-&gt;skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt-&gt;skype_callflow == SKYPIAX_STATE_UP)) {
</ins><span class="cx">                                         unsigned int fdselect;
</span><span class="cx">                                         int rt;
</span><span class="cx">                                         fd_set fs;
</span><span class="lines">@@ -999,34 +999,35 @@
</span><span class="cx">                                         fdselect = fd;
</span><span class="cx">                                         FD_SET(fdselect, &amp;fs);
</span><span class="cx"> 
</span><del>-                                                if (tech_pvt-&gt;timer_write.timer_interface &amp;&amp; tech_pvt-&gt;timer_write.timer_interface-&gt;timer_next &amp;&amp; tech_pvt-&gt;interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) {
-                                                        switch_core_timer_next(&amp;tech_pvt-&gt;timer_write);
-                                                }
</del><ins>+                                        if (tech_pvt-&gt;timer_write.timer_interface &amp;&amp; tech_pvt-&gt;timer_write.timer_interface-&gt;timer_next
+                                                &amp;&amp; tech_pvt-&gt;interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) {
+                                                switch_core_timer_next(&amp;tech_pvt-&gt;timer_write);
+                                        }
</ins><span class="cx"> #if 1
</span><span class="cx"> 
</span><del>-                                        if(tech_pvt-&gt;begin_to_write==0){
-                                                        memset(cli_out, 255, sizeof(cli_out));
-                                                        bytes_to_write = 640;
-                                                        len = send(fd, (char *)cli_out, bytes_to_write, 0);
-                                                        if (len == -1) {
-                                                                DEBUGA_SKYPE(&quot;len=%d, error: %s\n&quot;, SKYPIAX_P_LOG, len,  strerror(errno));
-                                                                break;
-                                                        }
-                                                        continue;
</del><ins>+                                        if (tech_pvt-&gt;begin_to_write == 0) {
+                                                memset(cli_out, 255, sizeof(cli_out));
+                                                bytes_to_write = 640;
+                                                len = send(fd, (char *) cli_out, bytes_to_write, 0);
+                                                if (len == -1) {
+                                                        DEBUGA_SKYPE(&quot;len=%d, error: %s\n&quot;, SKYPIAX_P_LOG, len, strerror(errno));
+                                                        break;
+                                                }
+                                                continue;
</ins><span class="cx">                                         }
</span><del>-#endif//0
</del><ins>+#endif //0
</ins><span class="cx"> 
</span><del>-                                        rt=1;
</del><ins>+                                        rt = 1;
</ins><span class="cx"> 
</span><span class="cx">                                         if (rt &gt; 0) {
</span><span class="cx"> 
</span><del>-                                                bytes_to_write=0;
</del><ins>+                                                bytes_to_write = 0;
</ins><span class="cx"> 
</span><del>-                                                if(tech_pvt-&gt;skype_callflow == CALLFLOW_INCOMING_HANGUP){
</del><ins>+                                                if (tech_pvt-&gt;skype_callflow == CALLFLOW_INCOMING_HANGUP) {
</ins><span class="cx">                                                         break;
</span><span class="cx">                                                 }
</span><span class="cx">                                                 switch_mutex_lock(tech_pvt-&gt;mutex_audio_cli);
</span><del>-                                                if(switch_buffer_inuse(tech_pvt-&gt;write_buffer)){
</del><ins>+                                                if (switch_buffer_inuse(tech_pvt-&gt;write_buffer)) {
</ins><span class="cx">                                                         bytes_to_write = switch_buffer_read(tech_pvt-&gt;write_buffer, cli_out, 640);
</span><span class="cx">                                                 }
</span><span class="cx">                                                 switch_mutex_unlock(tech_pvt-&gt;mutex_audio_cli);
</span><span class="lines">@@ -1039,16 +1040,16 @@
</span><span class="cx">                                                 }
</span><span class="cx">                                                 /* send the 16khz frame to the Skype client waiting for incoming audio to be sent to the remote party */
</span><span class="cx">                                                 if (tech_pvt-&gt;skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
</span><del>-                                                        len = send(fd, (char *)cli_out, bytes_to_write, 0);
</del><ins>+                                                        len = send(fd, (char *) cli_out, bytes_to_write, 0);
</ins><span class="cx">                                                         if (len == -1) {
</span><del>-                                                                DEBUGA_SKYPE(&quot;len=%d, error: %s\n&quot;, SKYPIAX_P_LOG, len,  strerror(errno));
</del><ins>+                                                                DEBUGA_SKYPE(&quot;len=%d, error: %s\n&quot;, SKYPIAX_P_LOG, len, strerror(errno));
</ins><span class="cx">                                                                 break;
</span><span class="cx">                                                         }
</span><span class="cx">                                                         if (len != bytes_to_write) {
</span><span class="cx">                                                                 DEBUGA_SKYPE(&quot;len=%d\n&quot;, SKYPIAX_P_LOG, len);
</span><span class="cx">                                                         }
</span><span class="cx">                                                 }
</span><del>-                                        } else if(rt==0){
</del><ins>+                                        } else if (rt == 0) {
</ins><span class="cx">                                                 DEBUGA_SKYPE(&quot;CLI rt=%d\n&quot;, SKYPIAX_P_LOG, rt);
</span><span class="cx">                                                 continue;
</span><span class="cx">                                         } else {
</span><span class="lines">@@ -1077,31 +1078,31 @@
</span><span class="cx"> {
</span><span class="cx">         unsigned int samples;
</span><span class="cx">         int waitin;
</span><del>-        int max_waitin=30;
</del><ins>+        int max_waitin = 30;
</ins><span class="cx"> 
</span><del>-        waitin=0;
</del><ins>+        waitin = 0;
</ins><span class="cx">         while (tech_pvt-&gt;flag_audio_srv == 0) {
</span><span class="cx"> #ifdef WIN32
</span><del>-                skypiax_sleep(1000);                //0.1 millisec
</del><ins>+                skypiax_sleep(1000);        //0.1 millisec
</ins><span class="cx"> #else
</span><span class="cx">                 skypiax_sleep(1000);        //1 millisec
</span><span class="cx"> #endif //WIN32
</span><span class="cx">                 waitin++;
</span><span class="cx"> 
</span><del>-                if(waitin == max_waitin){
</del><ins>+                if (waitin == max_waitin) {
</ins><span class="cx">                         DEBUGA_SKYPE(&quot;read is now at max_waitin: %d\n&quot;, SKYPIAX_P_LOG, waitin);
</span><span class="cx">                         break;
</span><span class="cx">                 }
</span><span class="cx">                 //WARNINGA(&quot;read now is 0\n&quot;, SKYPIAX_P_LOG);
</span><span class="cx">         }
</span><del>-        if(waitin &gt; 22){
</del><ins>+        if (waitin &gt; 22) {
</ins><span class="cx">                 DEBUGA_SKYPE(&quot;read is now %d\n&quot;, SKYPIAX_P_LOG, waitin);
</span><span class="cx">         }
</span><span class="cx">         //samples = skypiax_pipe_read(tech_pvt-&gt;audiopipe_srv[0], tech_pvt-&gt;read_frame.data, SAMPLES_PER_FRAME * sizeof(short));
</span><del>-                        switch_mutex_lock(tech_pvt-&gt;mutex_audio_srv);
</del><ins>+        switch_mutex_lock(tech_pvt-&gt;mutex_audio_srv);
</ins><span class="cx">         memcpy(tech_pvt-&gt;read_frame.data, tech_pvt-&gt;audiobuf_srv, SAMPLES_PER_FRAME * sizeof(short));
</span><span class="cx">         tech_pvt-&gt;flag_audio_srv = 0;
</span><del>-                        switch_mutex_unlock(tech_pvt-&gt;mutex_audio_srv);
</del><ins>+        switch_mutex_unlock(tech_pvt-&gt;mutex_audio_srv);
</ins><span class="cx"> 
</span><span class="cx">         samples = SAMPLES_PER_FRAME * sizeof(short);
</span><span class="cx">         if (samples != SAMPLES_PER_FRAME * sizeof(short)) {
</span><span class="lines">@@ -1316,14 +1317,14 @@
</span><span class="cx">         fIssueDefProc = 0;
</span><span class="cx">         tech_pvt = (private_t *) GetWindowLong(hWindow, GWL_USERDATA);
</span><span class="cx">         //if (!running)
</span><del>-        //        return lReturnCode;
</del><ins>+        //  return lReturnCode;
</ins><span class="cx"> 
</span><del>-        if(!running){
</del><ins>+        if (!running) {
</ins><span class="cx">                 DEBUGA_SKYPE(&quot;let's DIE!\n&quot;, SKYPIAX_P_LOG);
</span><span class="cx">                 tech_pvt-&gt;SkypiaxHandles.win32_hInit_MainWindowHandle = NULL;
</span><span class="cx">                 PostQuitMessage(0);
</span><span class="cx">                 return lReturnCode;
</span><del>-                                }
</del><ins>+        }
</ins><span class="cx">         switch (uiMessage) {
</span><span class="cx">         case WM_CREATE:
</span><span class="cx">                 tech_pvt = (private_t *) ((LPCREATESTRUCT) ulParam)-&gt;lpCreateParams;
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>