<!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][14375] </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=14375">14375</a></dd>
<dt>Author</dt> <dd>gmaruzz</dd>
<dt>Date</dt> <dd>2009-07-27 10:56:07 -0500 (Mon, 27 Jul 2009)</dd>
</dl>
<h3>Log Message</h3>
<pre>skypiax: indent -gnu -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo -saf -sai -saw -cs -bbo -nhnl -nut -sob -l90</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 (14374 => 14375)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c        2009-07-27 15:51:03 UTC (rev 14374)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c        2009-07-27 15:56:07 UTC (rev 14375)
</span><span class="lines">@@ -40,57 +40,47 @@
</span><span class="cx"> /***************/
</span><span class="cx"> // from http://www.openasthra.com/c-tidbits/gettimeofday-function-for-windows/
</span><span class="cx">
</span><del>-#include <time.h>
-
-#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
-#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
-#else
-#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
-#endif
-
- struct timezone
- {
- int tz_minuteswest; /* minutes W of Greenwich */
- int tz_dsttime; /* type of dst correction */
- };
-
- int gettimeofday(struct timeval *tv, struct timezone *tz)
- {
- FILETIME ft;
- unsigned __int64 tmpres = 0;
- static int tzflag;
-
- if (NULL != tv)
- {
- GetSystemTimeAsFileTime(&ft);
-
- tmpres |= ft.dwHighDateTime;
- tmpres <<= 32;
- tmpres |= ft.dwLowDateTime;
-
- /*converting file time to unix epoch*/
- tmpres /= 10; /*convert into microseconds*/
- tmpres -= DELTA_EPOCH_IN_MICROSECS;
- tv->tv_sec = (long)(tmpres / 1000000UL);
- tv->tv_usec = (long)(tmpres % 1000000UL);
- }
-
- if (NULL != tz)
- {
- if (!tzflag)
- {
- _tzset();
- tzflag++;
- }
- tz->tz_minuteswest = _timezone / 60;
- tz->tz_dsttime = _daylight;
- }
-
- return 0;
- }
</del><ins>+#include <time.h>
+
+#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
+#define DELTA_EPOCH_IN_MICROSECS 11644473600000000Ui64
+#else /* */
+#define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
+#endif /* */
+struct timezone {
+ int tz_minuteswest; /* minutes W of Greenwich */
+ int tz_dsttime; /* type of dst correction */
+};
+int gettimeofday(struct timeval *tv, struct timezone *tz)
+{
+ FILETIME ft;
+ unsigned __int64 tmpres = 0;
+ static int tzflag;
+ if (NULL != tv) {
+ GetSystemTimeAsFileTime(&ft);
+ tmpres |= ft.dwHighDateTime;
+ tmpres <<= 32;
+ tmpres |= ft.dwLowDateTime;
+
+ /*converting file time to unix epoch */
+ tmpres /= 10; /*convert into microseconds */
+ tmpres -= DELTA_EPOCH_IN_MICROSECS;
+ tv->tv_sec = (long) (tmpres / 1000000UL);
+ tv->tv_usec = (long) (tmpres % 1000000UL);
+ }
+ if (NULL != tz) {
+ if (!tzflag) {
+ _tzset();
+ tzflag++;
+ }
+ tz->tz_minuteswest = _timezone / 60;
+ tz->tz_dsttime = _daylight;
+ }
+ return 0;
+}
+
</ins><span class="cx"> /***************/
</span><span class="cx"> #endif /* WIN32 */
</span><del>-
</del><span class="cx"> SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load);
</span><span class="cx"> SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown);
</span><span class="cx"> SWITCH_MODULE_DEFINITION(mod_skypiax, mod_skypiax_load, mod_skypiax_shutdown, NULL);
</span><span class="lines">@@ -140,8 +130,8 @@
</span><span class="cx"> globals.codec_rates_string);
</span><span class="cx">
</span><span class="cx"> /* BEGIN: Changes here */
</span><del>-static switch_status_t interface_exists(char* skype_user);
-static switch_status_t remove_interface(char* skype_user);
</del><ins>+static switch_status_t interface_exists(char *skype_user);
+static switch_status_t remove_interface(char *skype_user);
</ins><span class="cx"> /* END: Changes here */
</span><span class="cx">
</span><span class="cx"> static switch_status_t channel_on_init(switch_core_session_t * session);
</span><span class="lines">@@ -221,93 +211,102 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* BEGIN: Changes here */
</span><del>-static switch_status_t interface_exists(char* skype_user) {
-        int i;
-        for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) {
-                if (strlen(globals.SKYPIAX_INTERFACES[i].name)) {
-                        if(strcmp(globals.SKYPIAX_INTERFACES[i].skype_user, skype_user) == 0) {
-                                return SWITCH_STATUS_SUCCESS;
-                        }
-                }
-        }
-        return SWITCH_STATUS_FALSE;
</del><ins>+static switch_status_t interface_exists(char *skype_user)
+{
+ int i;
+ for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) {
+ if (strlen(globals.SKYPIAX_INTERFACES[i].name)) {
+ if (strcmp(globals.SKYPIAX_INTERFACES[i].skype_user, skype_user) == 0) {
+ return SWITCH_STATUS_SUCCESS;
+ }
+ }
+ }
+ return SWITCH_STATUS_FALSE;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-static switch_status_t remove_interface(char* skype_user) {
-        int x = 100;
-        unsigned int howmany = 8;
-        int interface_id = -1;
-        private_t *tech_pvt = NULL;
-        switch_status_t status;
</del><ins>+static switch_status_t remove_interface(char *skype_user)
+{
+ int x = 100;
+ unsigned int howmany = 8;
+ int interface_id = -1;
+ private_t *tech_pvt = NULL;
+ switch_status_t status;
</ins><span class="cx">
</span><del>-        running = 0;
</del><ins>+ running = 0;
</ins><span class="cx">
</span><del>-        for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
-                if(strcmp(globals.SKYPIAX_INTERFACES[interface_id].skype_user, skype_user) == 0) {
-                        tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
-                        break;
-                }
-        }
</del><ins>+ for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
+ if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].skype_user, skype_user) == 0) {
+ tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
+ break;
+ }
+ }
</ins><span class="cx">
</span><del>-        if(!tech_pvt) {
-                DEBUGA_SKYPE("interface for skype user '%s' does not exist\n", SKYPIAX_P_LOG, skype_user);
-                goto end;
-        }
</del><ins>+ if (!tech_pvt) {
+ DEBUGA_SKYPE("interface for skype user '%s' does not exist\n", SKYPIAX_P_LOG,
+ skype_user);
+ goto end;
+ }
</ins><span class="cx">
</span><del>-        if (strlen(globals.SKYPIAX_INTERFACES[interface_id].session_uuid_str)) {
-                DEBUGA_SKYPE("interface for skype user '%s' is busy\n", SKYPIAX_P_LOG, skype_user);
-                goto end;
-        }
</del><ins>+ if (strlen(globals.SKYPIAX_INTERFACES[interface_id].session_uuid_str)) {
+ DEBUGA_SKYPE("interface for skype user '%s' is busy\n", SKYPIAX_P_LOG, skype_user);
+ goto end;
+ }
</ins><span class="cx">
</span><del>-        if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) {
</del><ins>+ if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) {
</ins><span class="cx"> #ifdef WIN32
</span><del>-                switch_file_write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
</del><ins>+ switch_file_write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
</ins><span class="cx"> #else /* WIN32 */
</span><del>-                howmany = write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", howmany);
</del><ins>+ howmany = write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", howmany);
</ins><span class="cx"> #endif /* WIN32 */
</span><del>-        }
</del><ins>+ }
</ins><span class="cx">
</span><del>-        if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) {
</del><ins>+ if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) {
</ins><span class="cx"> #ifdef WIN32
</span><del>-                if (SendMessage(tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the skypiax_api_thread_func die
-                        DEBUGA_SKYPE("got FALSE here, thread probably was already dead. GetLastError returned: %d\n",
-                                        SKYPIAX_P_LOG, GetLastError());
-                        globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread = NULL;
-                }
</del><ins>+ if (SendMessage(tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the skypiax_api_thread_func die
+ DEBUGA_SKYPE
+ ("got FALSE here, thread probably was already dead. GetLastError returned: %d\n",
+ SKYPIAX_P_LOG, GetLastError());
+ globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread = NULL;
+ }
</ins><span class="cx"> #else
</span><del>-                XEvent e;
-                Atom atom1 = XInternAtom(tech_pvt->SkypiaxHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False);
-                memset(&e, 0, sizeof(e));
-                e.xclient.type = ClientMessage;
-                e.xclient.message_type = atom1; /* leading message */
-                e.xclient.display = tech_pvt->SkypiaxHandles.disp;
-                e.xclient.window = tech_pvt->SkypiaxHandles.skype_win;
-                e.xclient.format = 8;
</del><ins>+ XEvent e;
+ Atom atom1 =
+ XInternAtom(tech_pvt->SkypiaxHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False);
+ memset(&e, 0, sizeof(e));
+ e.xclient.type = ClientMessage;
+ e.xclient.message_type = atom1; /* leading message */
+ e.xclient.display = tech_pvt->SkypiaxHandles.disp;
+ e.xclient.window = tech_pvt->SkypiaxHandles.skype_win;
+ e.xclient.format = 8;
</ins><span class="cx">
</span><del>-                XSendEvent(tech_pvt->SkypiaxHandles.disp, tech_pvt->SkypiaxHandles.win, False, 0, &e);
-                XSync(tech_pvt->SkypiaxHandles.disp, False);
</del><ins>+ XSendEvent(tech_pvt->SkypiaxHandles.disp, tech_pvt->SkypiaxHandles.win, False, 0, &e);
+ XSync(tech_pvt->SkypiaxHandles.disp, False);
</ins><span class="cx"> #endif
</span><del>-        }
</del><ins>+ }
</ins><span class="cx">
</span><del>-        while (x) { //FIXME 2 seconds?
-                x--;
-                switch_yield(20000);
-        }
</del><ins>+ while (x) { //FIXME 2 seconds?
+ x--;
+ switch_yield(20000);
+ }
</ins><span class="cx">
</span><del>-        if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) {
-                switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread);
-        }
</del><ins>+ if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) {
+ switch_thread_join(&status,
+ globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread);
+ }
</ins><span class="cx">
</span><del>-        if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) {
-                switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread);
-        }
</del><ins>+ if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) {
+ switch_thread_join(&status,
+ globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread);
+ }
</ins><span class="cx">
</span><del>-        memset(&globals.SKYPIAX_INTERFACES[interface_id], '\0',sizeof(private_t));
-        DEBUGA_SKYPE("interface for skype user '%s' deleted successfully\n", SKYPIAX_P_LOG, skype_user);
</del><ins>+ memset(&globals.SKYPIAX_INTERFACES[interface_id], '\0', sizeof(private_t));
+ DEBUGA_SKYPE("interface for skype user '%s' deleted successfully\n", SKYPIAX_P_LOG,
+ skype_user);
</ins><span class="cx"> end:
</span><del>-        running = 1;
-        return SWITCH_STATUS_SUCCESS;
</del><ins>+ running = 1;
+ return SWITCH_STATUS_SUCCESS;
</ins><span class="cx"> }
</span><ins>+
</ins><span class="cx"> /* END: Changes here */
</span><span class="cx">
</span><span class="cx"> /*
</span><span class="lines">@@ -983,10 +982,10 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /* BEGIN: Changes here */
</span><del>- if(reload_type == SOFT_RELOAD) {
- if(interface_exists(skype_user) == SWITCH_STATUS_SUCCESS) {
-         continue;
-        }
</del><ins>+ if (reload_type == SOFT_RELOAD) {
+ if (interface_exists(skype_user) == SWITCH_STATUS_SUCCESS) {
+ continue;
+ }
</ins><span class="cx"> }
</span><span class="cx"> /* END: Changes here */
</span><span class="cx">
</span><span class="lines">@@ -1622,19 +1621,19 @@
</span><span class="cx">
</span><span class="cx"> /* BEGIN: Changes heres */
</span><span class="cx"> } else if (!strcasecmp(argv[0], "reload")) {
</span><del>- if(load_config(SOFT_RELOAD) != SWITCH_STATUS_SUCCESS) {
</del><ins>+ if (load_config(SOFT_RELOAD) != SWITCH_STATUS_SUCCESS) {
</ins><span class="cx"> stream->write_function(stream, "sk reload failed\n");
</span><span class="cx"> } else {
</span><span class="cx"> stream->write_function(stream, "sk reload success\n");
</span><span class="cx"> }
</span><span class="cx"> } else if (!strcasecmp(argv[0], "remove")) {
</span><del>- if(argc == 2) {
- if(remove_interface(argv[1]) == SWITCH_STATUS_SUCCESS) {
-        if(interface_exists(argv[1]) == SWITCH_STATUS_SUCCESS) {
</del><ins>+ if (argc == 2) {
+ if (remove_interface(argv[1]) == SWITCH_STATUS_SUCCESS) {
+ if (interface_exists(argv[1]) == SWITCH_STATUS_SUCCESS) {
</ins><span class="cx"> stream->write_function(stream, "sk remove '%s' failed\n", argv[1]);
</span><del>-        } else {
- stream->write_function(stream, "sk remove '%s' success\n",argv[1]);
-        }
</del><ins>+ } else {
+ stream->write_function(stream, "sk remove '%s' success\n", argv[1]);
+ }
</ins><span class="cx"> }
</span><span class="cx"> } else {
</span><span class="cx"> stream->write_function(stream, "-ERR Usage: sk remove interface_name\n");
</span></span></pre></div>
<a id="freeswitchtrunksrcmodendpointsmod_skypiaxskypiaxh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h (14374 => 14375)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h        2009-07-27 15:51:03 UTC (rev 14374)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h        2009-07-27 15:56:07 UTC (rev 14375)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx"> #include <switch.h>
</span><span class="cx"> #include <switch_version.h>
</span><span class="cx">
</span><del>-
</del><span class="cx"> #ifndef WIN32
</span><span class="cx"> #include <sys/time.h>
</span><span class="cx"> #include <X11/Xlib.h>
</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 (14374 => 14375)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c        2009-07-27 15:51:03 UTC (rev 14374)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c        2009-07-27 15:56:07 UTC (rev 14375)
</span><span class="lines">@@ -181,7 +181,7 @@
</span><span class="cx"> /* this is the call in which we are calling out */
</span><span class="cx"> DEBUGA_SKYPE("Call %s NOTHING\n", SKYPIAX_P_LOG, id);
</span><span class="cx"> } else {
</span><del>- skypiax_sleep(400000); //0.4 seconds
</del><ins>+ skypiax_sleep(400000); //0.4 seconds
</ins><span class="cx"> DEBUGA_SKYPE("Call %s TRY TRANSFER\n", SKYPIAX_P_LOG, id);
</span><span class="cx"> skypiax_transfer(tech_pvt, id, value);
</span><span class="cx"> }
</span><span class="lines">@@ -252,8 +252,8 @@
</span><span class="cx"> char msg_to_skype[1024];
</span><span class="cx"> tech_pvt->skype_callflow = CALLFLOW_STATUS_EARLYMEDIA;
</span><span class="cx"> tech_pvt->interface_state = SKYPIAX_STATE_DIALING;
</span><del>- DEBUGA_SKYPE("Our remote party in skype_call %s is EARLYMEDIA\n", SKYPIAX_P_LOG,
- id);
</del><ins>+ DEBUGA_SKYPE("Our remote party in skype_call %s is EARLYMEDIA\n",
+ SKYPIAX_P_LOG, id);
</ins><span class="cx"> start_audio_threads(tech_pvt);
</span><span class="cx"> skypiax_sleep(1000);
</span><span class="cx"> sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id,
</span><span class="lines">@@ -391,7 +391,7 @@
</span><span class="cx"> sizeof(tech_pvt->skype_call_id) - 1);
</span><span class="cx"> tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
</span><span class="cx"> tech_pvt->skype_call_id[0] = '\0';
</span><del>-                        skypiax_sleep(1000);
</del><ins>+ skypiax_sleep(1000);
</ins><span class="cx"> return CALLFLOW_INCOMING_HANGUP;
</span><span class="cx"> } else if (!strcasecmp(value, "WAITING_REDIAL_COMMAND")) {
</span><span class="cx"> tech_pvt->skype_callflow = CALLFLOW_STATUS_FAILED;
</span><span class="lines">@@ -402,7 +402,7 @@
</span><span class="cx"> sizeof(tech_pvt->skype_call_id) - 1);
</span><span class="cx"> tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
</span><span class="cx"> tech_pvt->skype_call_id[0] = '\0';
</span><del>-                        skypiax_sleep(1000);
</del><ins>+ skypiax_sleep(1000);
</ins><span class="cx"> return CALLFLOW_INCOMING_HANGUP;
</span><span class="cx"> } else {
</span><span class="cx"> WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPIAX_P_LOG, id,
</span><span class="lines">@@ -695,7 +695,7 @@
</span><span class="cx"> DEBUGA_SKYPE("ACCEPTED here you send me %d\n", SKYPIAX_P_LOG,
</span><span class="cx"> tech_pvt->tcp_cli_port);
</span><span class="cx"> #ifndef WIN32
</span><del>-                fcntl(tech_pvt->audioskypepipe[0], F_SETFL, O_NONBLOCK);
</del><ins>+ fcntl(tech_pvt->audioskypepipe[0], F_SETFL, O_NONBLOCK);
</ins><span class="cx"> #endif //WIN32
</span><span class="cx">
</span><span class="cx"> if (!running)
</span><span class="lines">@@ -713,7 +713,7 @@
</span><span class="cx"> if (!running)
</span><span class="cx"> break;
</span><span class="cx"> FD_ZERO(&fs);
</span><del>- to.tv_usec = 120000; //120msec
</del><ins>+ to.tv_usec = 120000; //120msec
</ins><span class="cx"> to.tv_sec = 0;
</span><span class="cx"> #if defined(WIN32) && !defined(__CYGWIN__)
</span><span class="cx"> /* on win32 we cannot select from the apr "pipe", so we select on socket writability */
</span><span class="lines">@@ -730,63 +730,63 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> if (rt > 0) {
</span><del>-                         int counter;
</del><ins>+ int counter;
</ins><span class="cx">
</span><del>-                         /* until we drained the pipe to empty */
-                        for(counter = 0; counter < 10; counter++){
- /* read from the pipe the audio frame we are supposed to send out */
- got =
- skypiax_pipe_read(tech_pvt->audioskypepipe[0], cli_in,
- SAMPLES_PER_FRAME * sizeof(short));
-                        if(got == -1)
-                                break;
</del><ins>+ /* until we drained the pipe to empty */
+ for (counter = 0; counter < 10; counter++) {
+ /* read from the pipe the audio frame we are supposed to send out */
+ got =
+ skypiax_pipe_read(tech_pvt->audioskypepipe[0], cli_in,
+ SAMPLES_PER_FRAME * sizeof(short));
+ if (got == -1)
+ break;
</ins><span class="cx">
</span><del>- if (got != SAMPLES_PER_FRAME * sizeof(short)) {
- WARNINGA("got is %d, but was expected to be %d\n", SKYPIAX_P_LOG, got,
- (int) (SAMPLES_PER_FRAME * sizeof(short)));
- }
</del><ins>+ if (got != SAMPLES_PER_FRAME * sizeof(short)) {
+ WARNINGA("got is %d, but was expected to be %d\n", SKYPIAX_P_LOG, got,
+ (int) (SAMPLES_PER_FRAME * sizeof(short)));
+ }
</ins><span class="cx">
</span><del>- if (got == SAMPLES_PER_FRAME * sizeof(short)) {
- if (samplerate_skypiax == 8000) {
</del><ins>+ if (got == SAMPLES_PER_FRAME * sizeof(short)) {
+ if (samplerate_skypiax == 8000) {
</ins><span class="cx">
</span><del>- /* we're upsampling from 8khz to 16khz, cli_out will contain two times each sample from cli_in */
- a = 0;
- for (i = 0; i < got / sizeof(short); i++) {
- cli_out[a] = cli_in[i];
- a++;
- cli_out[a] = cli_in[i];
- a++;
</del><ins>+ /* we're upsampling from 8khz to 16khz, cli_out will contain two times each sample from cli_in */
+ a = 0;
+ for (i = 0; i < got / sizeof(short); i++) {
+ cli_out[a] = cli_in[i];
+ a++;
+ cli_out[a] = cli_in[i];
+ a++;
+ }
+ got = got * 2;
+ } else if (samplerate_skypiax == 16000) {
+ /* we're NOT upsampling, cli_out will contain just ALL samples from cli_in */
+ for (i = 0; i < got / sizeof(short); i++) {
+ cli_out[i] = cli_in[i];
+ }
+ } else {
+ ERRORA("SAMPLERATE_SKYPIAX can only be 8000 or 16000\n", SKYPIAX_P_LOG);
</ins><span class="cx"> }
</span><del>- got = got * 2;
- } else if (samplerate_skypiax == 16000) {
- /* we're NOT upsampling, cli_out will contain just ALL samples from cli_in */
- for (i = 0; i < got / sizeof(short); i++) {
- cli_out[i] = cli_in[i];
- }
- } else {
- ERRORA("SAMPLERATE_SKYPIAX can only be 8000 or 16000\n", SKYPIAX_P_LOG);
- }
</del><span class="cx">
</span><del>- /* send the 16khz frame to the Skype client waiting for incoming audio to be sent to the remote party */
- if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
- len = send(fd, (char *) cli_out, got, 0);
- skypiax_sleep(5000); //5 msec
</del><ins>+ /* send the 16khz frame to the Skype client waiting for incoming audio to be sent to the remote party */
+ if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
+ len = send(fd, (char *) cli_out, got, 0);
+ skypiax_sleep(5000); //5 msec
</ins><span class="cx">
</span><del>- if (len == -1) {
- break;
- } else if (len != got) {
- ERRORA("len=%d\n", SKYPIAX_P_LOG, len);
- skypiax_sleep(1000);
- break;
</del><ins>+ if (len == -1) {
+ break;
+ } else if (len != got) {
+ ERRORA("len=%d\n", SKYPIAX_P_LOG, len);
+ skypiax_sleep(1000);
+ break;
+ }
</ins><span class="cx"> }
</span><del>- }
</del><span class="cx">
</span><del>- } else {
</del><ins>+ } else {
</ins><span class="cx">
</span><del>- WARNINGA("got is %d, but was expected to be %d\n", SKYPIAX_P_LOG, got,
- (int) (SAMPLES_PER_FRAME * sizeof(short)));
</del><ins>+ WARNINGA("got is %d, but was expected to be %d\n", SKYPIAX_P_LOG, got,
+ (int) (SAMPLES_PER_FRAME * sizeof(short)));
+ }
</ins><span class="cx"> }
</span><del>-                        }
</del><span class="cx"> } else {
</span><span class="cx"> if (rt)
</span><span class="cx"> ERRORA("CLI rt=%d\n", SKYPIAX_P_LOG, rt);
</span></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>
</body>
</html>