[Freeswitch-svn] [commit] r11927 - in freeswitch/branches/gmaruzz/mod_skypiax: . asterisk configs
FreeSWITCH SVN
gmaruzz at freeswitch.org
Thu Feb 12 07:17:24 PST 2009
Author: gmaruzz
Date: Thu Feb 12 09:17:24 2009
New Revision: 11927
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/mod_skypiax/asterisk/chan_skypiax.c
freeswitch/branches/gmaruzz/mod_skypiax/asterisk/cyg_no_pthread_kill.c
freeswitch/branches/gmaruzz/mod_skypiax/asterisk/skypiax.h
freeswitch/branches/gmaruzz/mod_skypiax/configs/skypiax_auth.c
freeswitch/branches/gmaruzz/mod_skypiax/mod_skypiax.c
freeswitch/branches/gmaruzz/mod_skypiax/skypiax.h
freeswitch/branches/gmaruzz/mod_skypiax/skypiax_protocol.c
Modified: freeswitch/branches/gmaruzz/mod_skypiax/asterisk/chan_skypiax.c
==============================================================================
--- freeswitch/branches/gmaruzz/mod_skypiax/asterisk/chan_skypiax.c (original)
+++ freeswitch/branches/gmaruzz/mod_skypiax/asterisk/chan_skypiax.c Thu Feb 12 09:17:24 2009
@@ -300,22 +300,21 @@
/* make a pointer to the first interface in the interfaces list */
p = skypiax_iflist;
-
if (strncmp("ANY", name, 3) == 0) {
- /* we've been asked for the "ANY" interface, let's find the first idle interface */
- DEBUGA_SKYPE("Finding one available skype interface\n", SKYPIAX_P_LOG);
- p = find_available_skypiax_interface();
- if (p){
- found = 1;
-
- /* create a new channel owning this interface */
- tmp = skypiax_new(p, SKYPIAX_STATE_DOWN, p->context);
- if (!tmp) {
- /* the channel was not created, probable memory allocation error */
- *cause = AST_CAUSE_SWITCH_CONGESTION;
- }
+ /* we've been asked for the "ANY" interface, let's find the first idle interface */
+ DEBUGA_SKYPE("Finding one available skype interface\n", SKYPIAX_P_LOG);
+ p = find_available_skypiax_interface();
+ if (p) {
+ found = 1;
+
+ /* create a new channel owning this interface */
+ tmp = skypiax_new(p, SKYPIAX_STATE_DOWN, p->context);
+ if (!tmp) {
+ /* the channel was not created, probable memory allocation error */
+ *cause = AST_CAUSE_SWITCH_CONGESTION;
+ }
- }
+ }
}
@@ -586,13 +585,13 @@
if ((c->_state != SKYPIAX_STATE_DOWN)
&& (c->_state != SKYPIAX_STATE_RESERVED)) {
- ERRORA("skypiax_originate_call called on %s, neither down nor reserved\n", SKYPIAX_P_LOG,
- c->name);
+ ERRORA("skypiax_originate_call called on %s, neither down nor reserved\n",
+ SKYPIAX_P_LOG, c->name);
return -1;
}
- DEBUGA_PBX("skypiax_originate_call to call idest: %s, timeout: %d!\n", SKYPIAX_P_LOG, idest,
- timeout);
+ DEBUGA_PBX("skypiax_originate_call to call idest: %s, timeout: %d!\n", SKYPIAX_P_LOG,
+ idest, timeout);
strncpy(rdest, idest, sizeof(rdest) - 1);
stringp = rdest;
@@ -605,8 +604,8 @@
}
strncpy(dstr, where + p->stripmsd, sizeof(dstr) - 1);
- DEBUGA_PBX("skypiax_originate_call dialing idest: %s, timeout: %d, dstr: %s!\n", SKYPIAX_P_LOG,
- idest, timeout, dstr);
+ DEBUGA_PBX("skypiax_originate_call dialing idest: %s, timeout: %d, dstr: %s!\n",
+ SKYPIAX_P_LOG, idest, timeout, dstr);
strcpy(p->session_uuid_str, "dialing");
status = skypiax_call(p, dstr, timeout);
@@ -615,8 +614,8 @@
return -1;
}
- DEBUGA_PBX("skypiax_originate_call dialed idest: %s, timeout: %d, dstr: %s!\n", SKYPIAX_P_LOG,
- idest, timeout, dstr);
+ DEBUGA_PBX("skypiax_originate_call dialed idest: %s, timeout: %d, dstr: %s!\n",
+ SKYPIAX_P_LOG, idest, timeout, dstr);
ast_setstate(p->owner, SKYPIAX_STATE_DIALING);
return 0;
@@ -1926,8 +1925,7 @@
return RESULT_SHOWUSAGE;
}
if (!p) {
- ast_cli(fd,
- "No \"current\" console for skypiax_, please enter 'help console'\n");
+ ast_cli(fd, "No \"current\" console for skypiax_, please enter 'help console'\n");
return RESULT_SUCCESS;
}
if (!p->skype) {
Modified: freeswitch/branches/gmaruzz/mod_skypiax/asterisk/cyg_no_pthread_kill.c
==============================================================================
--- freeswitch/branches/gmaruzz/mod_skypiax/asterisk/cyg_no_pthread_kill.c (original)
+++ freeswitch/branches/gmaruzz/mod_skypiax/asterisk/cyg_no_pthread_kill.c Thu Feb 12 09:17:24 2009
@@ -4,11 +4,14 @@
extern int option_debug;
int cyg_no_pthreadkill(int thread, int sig);
-int cyg_no_pthreadkill(int thread, int sig){
+int cyg_no_pthreadkill(int thread, int sig)
+{
#ifdef PRINTMSGCYG
- if(option_debug){
- printf("\n\nHere there would have been a pthread_kill() on thread [%-7lx], with sig=%d, but it has been substituted by this printf in file cyg_no_pthread_kill.c because CYGWIN does not support sending a signal to a one only thread :-(\n\n", (unsigned long int)thread, sig);
- }
-#endif// PRINTMSGCYG
- return 0;
- }
+ if (option_debug) {
+ printf
+ ("\n\nHere there would have been a pthread_kill() on thread [%-7lx], with sig=%d, but it has been substituted by this printf in file cyg_no_pthread_kill.c because CYGWIN does not support sending a signal to a one only thread :-(\n\n",
+ (unsigned long int) thread, sig);
+ }
+#endif // PRINTMSGCYG
+ return 0;
+}
Modified: freeswitch/branches/gmaruzz/mod_skypiax/asterisk/skypiax.h
==============================================================================
--- freeswitch/branches/gmaruzz/mod_skypiax/asterisk/skypiax.h (original)
+++ freeswitch/branches/gmaruzz/mod_skypiax/asterisk/skypiax.h Thu Feb 12 09:17:24 2009
@@ -322,8 +322,7 @@
int skypiax_console_skype(int fd, int argc, char *argv[]);
#ifdef WANT_SKYPE_X11
int X11_errors_handler(Display * dpy, XErrorEvent * err);
-int skypiax_send_message(struct SkypiaxHandles *SkypiaxHandles,
- const char *message_P);
+int skypiax_send_message(struct SkypiaxHandles *SkypiaxHandles, const char *message_P);
int skypiax_present(struct SkypiaxHandles *SkypiaxHandles);
void skypiax_clean_disp(void *data);
#endif /* WANT_SKYPE_X11 */
Modified: freeswitch/branches/gmaruzz/mod_skypiax/configs/skypiax_auth.c
==============================================================================
--- freeswitch/branches/gmaruzz/mod_skypiax/configs/skypiax_auth.c (original)
+++ freeswitch/branches/gmaruzz/mod_skypiax/configs/skypiax_auth.c Thu Feb 12 09:17:24 2009
@@ -15,14 +15,15 @@
XErrorHandler old_handler = 0;
int xerror = 0;
- char *dispname;
+char *dispname;
int X11_errors_handler(Display * dpy, XErrorEvent * err)
{
(void) dpy;
xerror = err->error_code;
- printf("\n\nReceived error code %d from X Server on display '%s'\n\n", xerror, dispname);
+ printf("\n\nReceived error code %d from X Server on display '%s'\n\n", xerror,
+ dispname);
return 0; /* ignore the error */
}
@@ -38,9 +39,7 @@
return (xerror != BadValue) && (xerror != BadWindow);
}
-
-int skypiax_send_message(struct SkypiaxHandles *SkypiaxHandles,
- const char *message_P)
+int skypiax_send_message(struct SkypiaxHandles *SkypiaxHandles, const char *message_P)
{
Window w_P;
@@ -58,7 +57,6 @@
unsigned int len = strlen(message_P);
XEvent e;
-
memset(&e, 0, sizeof(e));
e.xclient.type = ClientMessage;
e.xclient.message_type = atom1; /* leading message */
@@ -83,7 +81,6 @@
if (!ok)
printf("Sending message failed with status %d\n", xerror);
-
return 1;
}
@@ -114,7 +111,7 @@
SkypiaxHandles->skype_win = *(const unsigned long *) prop & 0xffffffff;
printf("Skype instance found on display '%s', with id #%d\n", dispname,
- (unsigned int) SkypiaxHandles->skype_win);
+ (unsigned int) SkypiaxHandles->skype_win);
return 1;
}
@@ -143,10 +140,10 @@
Window root = -1;
Window win = -1;
- if(argc==2)
- dispname=argv[1];
+ if (argc == 2)
+ dispname = argv[1];
else
- dispname=":0.0";
+ dispname = ":0.0";
disp = XOpenDisplay(dispname);
if (!disp) {
@@ -172,13 +169,15 @@
snprintf(buf, 512, "NAME skypiax");
if (!skypiax_send_message(&SkypiaxHandles, buf)) {
- printf ("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypiax_auth again\n");
+ printf
+ ("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypiax_auth again\n");
return -1;
}
snprintf(buf, 512, "PROTOCOL 6");
if (!skypiax_send_message(&SkypiaxHandles, buf)) {
- printf ("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypiax_auth again\n");
+ printf
+ ("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypiax_auth again\n");
return -1;
}
@@ -221,9 +220,11 @@
}
}
} else {
- printf ("Skype client not found on display '%s'. Please run/restart Skype manually and launch skypiax_auth again\n\n\n", dispname);
- return -1;
+ printf
+ ("Skype client not found on display '%s'. Please run/restart Skype manually and launch skypiax_auth again\n\n\n",
+ dispname);
+ return -1;
}
- return 0;
+ return 0;
}
Modified: freeswitch/branches/gmaruzz/mod_skypiax/mod_skypiax.c
==============================================================================
--- freeswitch/branches/gmaruzz/mod_skypiax/mod_skypiax.c (original)
+++ freeswitch/branches/gmaruzz/mod_skypiax/mod_skypiax.c Thu Feb 12 09:17:24 2009
@@ -883,11 +883,9 @@
NOTICA("STARTING interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
switch_threadattr_create(&skypiax_api_thread_attr, skypiax_module_pool);
- switch_threadattr_stacksize_set(skypiax_api_thread_attr,
- SWITCH_THREAD_STACKSIZE);
- switch_thread_create(&globals.SKYPIAX_INTERFACES[interface_id].
- skypiax_api_thread, skypiax_api_thread_attr,
- skypiax_do_skypeapi_thread,
+ switch_threadattr_stacksize_set(skypiax_api_thread_attr, SWITCH_THREAD_STACKSIZE);
+ switch_thread_create(&globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread,
+ skypiax_api_thread_attr, skypiax_do_skypeapi_thread,
&globals.SKYPIAX_INTERFACES[interface_id],
skypiax_module_pool);
@@ -1002,7 +1000,9 @@
if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) {
#ifdef WIN32
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());
+ DEBUGA_SKYPE
+ ("got FALSE here, thread probably was already dead. GetLastError returned: %d\n",
+ SKYPIAX_P_LOG, GetLastError());
}
#else
XEvent e;
@@ -1032,8 +1032,7 @@
}
if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) {
switch_thread_join(&status,
- globals.SKYPIAX_INTERFACES[interface_id].
- skypiax_api_thread);
+ globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread);
}
}
return SWITCH_STATUS_SUCCESS;
@@ -1164,7 +1163,7 @@
private_t *find_available_skypiax_interface(void)
{
- private_t *tech_pvt=NULL;
+ private_t *tech_pvt = NULL;
int found = 0;
int i;
Modified: freeswitch/branches/gmaruzz/mod_skypiax/skypiax.h
==============================================================================
--- freeswitch/branches/gmaruzz/mod_skypiax/skypiax.h (original)
+++ freeswitch/branches/gmaruzz/mod_skypiax/skypiax.h Thu Feb 12 09:17:24 2009
@@ -234,8 +234,7 @@
typedef struct private_object private_t;
-void *SWITCH_THREAD_FUNC skypiax_api_thread_func(switch_thread_t * thread,
- void *obj);
+void *SWITCH_THREAD_FUNC skypiax_api_thread_func(switch_thread_t * thread, void *obj);
void skypiax_tech_init(private_t * tech_pvt, switch_core_session_t * session);
int skypiax_audio_read(private_t * tech_pvt);
int skypiax_audio_init(private_t * tech_pvt);
Modified: freeswitch/branches/gmaruzz/mod_skypiax/skypiax_protocol.c
==============================================================================
--- freeswitch/branches/gmaruzz/mod_skypiax/skypiax_protocol.c (original)
+++ freeswitch/branches/gmaruzz/mod_skypiax/skypiax_protocol.c Thu Feb 12 09:17:24 2009
@@ -898,7 +898,7 @@
}
LRESULT APIENTRY skypiax_present(HWND hWindow, UINT uiMessage, WPARAM uiParam,
- LPARAM ulParam)
+ LPARAM ulParam)
{
LRESULT lReturnCode;
int fIssueDefProc;
@@ -1141,8 +1141,7 @@
return (xerror != BadValue) && (xerror != BadWindow);
}
-int skypiax_send_message(struct SkypiaxHandles *SkypiaxHandles,
- const char *message_P)
+int skypiax_send_message(struct SkypiaxHandles *SkypiaxHandles, const char *message_P)
{
Window w_P;
More information about the Freeswitch-svn
mailing list