[Freeswitch-branches] [commit] r10698 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax

FreeSWITCH SVN gmaruzz at freeswitch.org
Wed Dec 10 08:38:44 PST 2008


Author: gmaruzz
Date: Wed Dec 10 11:38:43 2008
New Revision: 10698

Log:
skypiax: indent -gnu -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo -saf -sai -saw -cs -bbo -nhnl -nut -sob -l90

Modified:
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c
   freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c	Wed Dec 10 11:38:43 2008
@@ -524,8 +524,7 @@
       return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
     }
 
-    skypiax_skype_call(tech_pvt->p, caller_profile->destination_number, 30,
-                       *new_session);
+    skypiax_skype_call(tech_pvt->p, caller_profile->destination_number, 30, *new_session);
 
     switch_channel_set_flag(channel, CF_OUTBOUND);
     switch_set_flag_locked(tech_pvt, TFLAG_OUTBOUND);
@@ -554,33 +553,33 @@
                (void *) p);
 
   while (forever) {
-	  if(!running)
-		  break;
+    if (!running)
+      break;
     switch_sleep(1000);
     res = skypiax_skype_read(p);
     //if (res == CALLFLOW_INCOMING_HANGUP && p->interface_state != SKYPIAX_STATE_DOWN) 
-	if (res == CALLFLOW_INCOMING_HANGUP) {
-		switch_core_session_t *session = NULL;
-		private_t *tech_pvt = NULL;
-		switch_channel_t *channel = NULL;
-
-		DEBUGA_SKYPE("skype call ended\n", SKYPIAX_P_LOG);
-
-		tech_pvt = p->tech_pvt;
-		if(tech_pvt){
-			session = tech_pvt->session;
-
-			if(session){
-				channel = switch_core_session_get_channel(session);
-				DEBUGA_SKYPE("before channel_on_hangup\n", SKYPIAX_P_LOG);
-
-				if(channel) {
-					switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
-					DEBUGA_SKYPE("after channel_on_hangup\n", SKYPIAX_P_LOG);
-				}
-			}
-		}
-	}
+    if (res == CALLFLOW_INCOMING_HANGUP) {
+      switch_core_session_t *session = NULL;
+      private_t *tech_pvt = NULL;
+      switch_channel_t *channel = NULL;
+
+      DEBUGA_SKYPE("skype call ended\n", SKYPIAX_P_LOG);
+
+      tech_pvt = p->tech_pvt;
+      if (tech_pvt) {
+        session = tech_pvt->session;
+
+        if (session) {
+          channel = switch_core_session_get_channel(session);
+          DEBUGA_SKYPE("before channel_on_hangup\n", SKYPIAX_P_LOG);
+
+          if (channel) {
+            switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
+            DEBUGA_SKYPE("after channel_on_hangup\n", SKYPIAX_P_LOG);
+          }
+        }
+      }
+    }
   }
 
   //if (option_debug > 10) {
@@ -847,13 +846,13 @@
   memset(&globals, '\0', sizeof(globals));
   memset(SKYPIAX_INTERFACES, '\0', sizeof(SKYPIAX_INTERFACES));
 
-#ifndef WIN32                   
+#ifndef WIN32
   if (!XInitThreads()) {
     ERRORA("Not initialized XInitThreads!\n", SKYPIAX_P_LOG);
   } else {
     DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPIAX_P_LOG);
   }
-  switch_sleep(100);  
+  switch_sleep(100);
 #endif /* _WINDOWS_ */
 
   load_config();
@@ -882,21 +881,22 @@
   int x = 100;
   struct skypiax_interface *p = NULL;
   switch_status_t status;
-  unsigned int howmany=8;
+  unsigned int howmany = 8;
 
-    p = &SKYPIAX_INTERFACES[2];
+  p = &SKYPIAX_INTERFACES[2];
 
   running = 0;
 
-    switch_file_write(p->AsteriskHandlesAst.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
+  switch_file_write(p->AsteriskHandlesAst.fdesc[1], "sciutati", &howmany);  // let's the controldev_thread die
 
 #ifdef WIN32
-  if (SendMessage (win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the do_skype_thread die
-      ERRORA("WHY FALSE HERE? %d\n", SKYPIAX_P_LOG, GetLastError());
+  if (SendMessage(win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) {   // let's the do_skype_thread die
+    ERRORA("WHY FALSE HERE? %d\n", SKYPIAX_P_LOG, GetLastError());
   }
 #else
   XEvent e;
-  Atom atom1 = XInternAtom(p->AsteriskHandlesAst.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False);
+  Atom atom1 =
+    XInternAtom(p->AsteriskHandlesAst.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False);
   memset(&e, 0, sizeof(e));
   e.xclient.type = ClientMessage;
   e.xclient.message_type = atom1;   /*  leading message */
@@ -904,12 +904,11 @@
   e.xclient.window = p->AsteriskHandlesAst.skype_win;
   e.xclient.format = 8;
 
-
-    XSendEvent(p->AsteriskHandlesAst.disp, p->AsteriskHandlesAst.win, False, 0, &e);
+  XSendEvent(p->AsteriskHandlesAst.disp, p->AsteriskHandlesAst.win, False, 0, &e);
   XSync(p->AsteriskHandlesAst.disp, False);
 #endif
   while (x) {
-	x--;
+    x--;
     switch_yield(20000);
   }
   switch_thread_join(&status, skypiax_do_controldev_thread_thread);

Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	(original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	Wed Dec 10 11:38:43 2008
@@ -73,8 +73,8 @@
   sin_size = sizeof(remote_addr);
   while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) {
     DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG);
-	  if(!running)
-		  break;
+    if (!running)
+      break;
     while (p->interface_state != SKYPIAX_STATE_DOWN
            && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS
                || p->skype_callflow == SKYPIAX_STATE_UP)) {
@@ -88,8 +88,8 @@
       fd_set fs;
       struct timeval to;
 
-	  if(!running)
-		  break;
+      if (!running)
+        break;
       exit = 1;
 
       fdselect = fd;
@@ -241,8 +241,8 @@
   sin_size = sizeof(remote_addr);
   while ((fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) {
     DEBUGA_SKYPE("ACCEPTED\n", SKYPIAX_P_LOG);
-	  if(!running)
-		  break;
+    if (!running)
+      break;
     while (p->interface_state != SKYPIAX_STATE_DOWN
            && (p->skype_callflow == CALLFLOW_STATUS_INPROGRESS
                || p->skype_callflow == SKYPIAX_STATE_UP)) {
@@ -255,8 +255,8 @@
       fd_set fs;
       struct timeval to;
 
-	  if(!running)
-		  break;
+      if (!running)
+        break;
       fdselect = 1;
       FD_ZERO(&fs);
       FD_SET(fdselect, &fs);
@@ -440,7 +440,7 @@
   fIssueDefProc = 0;
   switch (uiMessage) {
   case WM_DESTROY:
-      NOTICA("got DESTROY\n", SKYPIAX_P_LOG);
+    NOTICA("got DESTROY\n", SKYPIAX_P_LOG);
     win32_hInit_MainWindowHandle = NULL;
     PostQuitMessage(0);
     break;
@@ -593,29 +593,28 @@
       && win32_uiGlobal_MsgID_SkypeControlAPIDiscover != 0) {
     if (win32_Initialize_CreateWindowClass()) {
       if (win32_Initialize_CreateMainWindow()) {
-          if (SendMessage
-              (HWND_BROADCAST, win32_uiGlobal_MsgID_SkypeControlAPIDiscover,
-               (WPARAM) win32_hInit_MainWindowHandle, 0) != 0) {
-            win32_AsteriskHandlesSkype->win32_hInit_MainWindowHandle =
-              win32_hInit_MainWindowHandle;
-	    while (1) {
-		    MSG oMessage;
-		    if(!running)
-			    break;
-			while( GetMessage(&oMessage, 0, 0, 0) ){
-				    break;
-			    TranslateMessage(&oMessage);
-			    DispatchMessage(&oMessage);
-		    }
-	    }
+        if (SendMessage
+            (HWND_BROADCAST, win32_uiGlobal_MsgID_SkypeControlAPIDiscover,
+             (WPARAM) win32_hInit_MainWindowHandle, 0) != 0) {
+          win32_AsteriskHandlesSkype->win32_hInit_MainWindowHandle =
+            win32_hInit_MainWindowHandle;
+          while (1) {
+            MSG oMessage;
+            if (!running)
+              break;
+            while (GetMessage(&oMessage, 0, 0, 0)) {
+              break;
+              TranslateMessage(&oMessage);
+              DispatchMessage(&oMessage);
+            }
           }
+        }
         win32_DeInitialize_DestroyMainWindow();
       }
       win32_DeInitialize_DestroyWindowClass();
     }
   }
 
-
   switch_thread_exit(thread, SWITCH_STATUS_SUCCESS);
 
   return NULL;
@@ -836,8 +835,8 @@
 
     while (1) {
       XNextEvent(disp, &an_event);
-	  if(!running)
-		  break;
+      if (!running)
+        break;
       switch (an_event.type) {
       case ClientMessage:
 



More information about the Freeswitch-branches mailing list