Revision
14519
Author
gmaruzz
Date
2009-08-14 12:20:42 -0500 (Fri, 14 Aug 2009)

Log Message

skypiax: cosmetics

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c (14518 => 14519)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c	2009-08-14 17:14:40 UTC (rev 14518)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/mod_skypiax.c	2009-08-14 17:20:42 UTC (rev 14519)
@@ -1596,37 +1596,6 @@
 	return 0;
 }
 
-#if 0
-private_t *find_available_skypiax_interface(private_t * tech_pvt)
-{
-	private_t *tech_pvt2 = NULL;
-	int found = 0;
-	int i;
-
-	switch_mutex_lock(globals.mutex);
-
-	for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) {
-		if (strlen(globals.SKYPIAX_INTERFACES[i].name)) {
-			int skype_state = 0;
-
-			tech_pvt2 = &globals.SKYPIAX_INTERFACES[i];
-			skype_state = tech_pvt2->interface_state;
-			DEBUGA_SKYPE("skype interface: %d, name: %s, state: %d\n", SKYPIAX_P_LOG, i, globals.SKYPIAX_INTERFACES[i].name, skype_state);
-			if ((tech_pvt ? strcmp(tech_pvt2->skype_user, tech_pvt->skype_user) : 1) && (SKYPIAX_STATE_DOWN == skype_state || SKYPIAX_STATE_RING == skype_state || 0 == skype_state)) {	//(if we got tech_pvt NOT NULL) if user is NOT the same, and iface is idle
-				found = 1;
-				break;
-			}
-		}
-	}
-
-	switch_mutex_unlock(globals.mutex);
-	if (found)
-		return tech_pvt2;
-	else
-		return NULL;
-}
-#endif
-
 private_t *find_available_skypiax_interface_rr(private_t * tech_pvt_calling)
 {
 	private_t *tech_pvt = NULL;

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h (14518 => 14519)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h	2009-08-14 17:14:40 UTC (rev 14518)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax.h	2009-08-14 17:20:42 UTC (rev 14519)
@@ -277,7 +277,6 @@
 int skypiax_pipe_write(int pipe, short *buf, int howmany);
 #endif /* WIN32 */
 int skypiax_close_socket(unsigned int fd);
-private_t *find_available_skypiax_interface(private_t * tech_pvt);
 private_t *find_available_skypiax_interface_rr(private_t * tech_pvt_calling);
 int remote_party_is_ringing(private_t * tech_pvt);
 int remote_party_is_early_media(private_t * tech_pvt);

Modified: freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (14518 => 14519)


--- freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	2009-08-14 17:14:40 UTC (rev 14518)
+++ freeswitch/trunk/src/mod/endpoints/mod_skypiax/skypiax_protocol.c	2009-08-14 17:20:42 UTC (rev 14519)
@@ -120,34 +120,7 @@
 					tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
 				}
 			}
-			/*
-			   if (!strncasecmp(message, "ERROR 96 CALL", 12) ) {
-			   ERRORA("Skype got ERROR: |||%s|||, we are trying to use this interface to make or receive a call, but another call is half-active on this interface. We abort this attenpt and leave the previous one to continue.\n", SKYPIAX_P_LOG, message);
-			   tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED;
-			   DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG);
-			   tech_pvt->skype_call_id[0] = '\0';
 
-			   if (tech_pvt->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) {
-			   tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
-			   return CALLFLOW_INCOMING_HANGUP;
-			   } else {
-			   tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
-			   }
-			   }
-			 */
-			/*
-			   if (!strncasecmp(message, "ERROR 99 CALL", 12) ) {
-			   //TODO: let's kill the call
-			   ERRORA("Skype got ERROR: |||%s|||, another call is active on this interface\n\n\n", SKYPIAX_P_LOG, message);
-			   //tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED;
-			   //DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG);
-			   //tech_pvt->skype_call_id[0] = '\0';
-
-			   tech_pvt->interface_state = SKYPIAX_STATE_ERROR_DOUBLE_CALL;
-			   }
-			 */
-
-
 			if (!strncasecmp(message, "ERROR", 4)) {
 				if (!strncasecmp(message, "ERROR 96 CALL", 12)) {
 					DEBUGA_SKYPE
@@ -543,25 +516,6 @@
 	short kill_cli_buff[SAMPLES_PER_FRAME];
 	short totalbuf[SAMPLES_PER_FRAME];
 
-#ifdef  NOTDEF
-	memset(&my_addr, 0, sizeof(my_addr));
-	my_addr.sin_family = AF_INET;
-	my_addr.sin_addr.s_addr = htonl(0x7f000001);	/* use the localhost */
-	my_addr.sin_port = htons(tech_pvt->tcp_srv_port);
-
-	if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
-		ERRORA("socket Error\n", SKYPIAX_P_LOG);
-		tech_pvt->tcp_srv_thread = NULL;
-		return NULL;
-	}
-
-	if (bind(s, (struct sockaddr *) &my_addr, sizeof(struct sockaddr)) < 0) {
-		ERRORA("bind error: %s\n", SKYPIAX_P_LOG, strerror(errno));
-		tech_pvt->tcp_srv_thread = NULL;
-		return NULL;
-	}
-#endif //NOTDEF
-
 	s = skypiax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_srv_port);
 	if (s < 0) {
 		ERRORA("skypiax_socket_create_and_bind error!\n", SKYPIAX_P_LOG);
@@ -734,27 +688,6 @@
 	unsigned int sin_size;
 #endif /* WIN32 */
 
-#ifdef NOTDEF
-	memset(&my_addr, 0, sizeof(my_addr));
-	my_addr.sin_family = AF_INET;
-	my_addr.sin_addr.s_addr = htonl(0x7f000001);	/* use the localhost */
-	my_addr.sin_port = htons(tech_pvt->tcp_cli_port);
-
-	if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
-		ERRORA("socket Error\n", SKYPIAX_P_LOG);
-		tech_pvt->tcp_cli_thread = NULL;
-		return NULL;
-	}
-
-	if (bind(s, (struct sockaddr *) &my_addr, sizeof(struct sockaddr)) < 0) {
-		//ERRORA("bind Error\n", SKYPIAX_P_LOG);
-		ERRORA("bind error: %s\n", SKYPIAX_P_LOG, strerror(errno));
-		skypiax_close_socket(s);
-		tech_pvt->tcp_cli_thread = NULL;
-		return NULL;
-	}
-#endif // NOTDEF
-
 	s = skypiax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_cli_port);
 	if (s < 0) {
 		ERRORA("skypiax_socket_create_and_bind error!\n", SKYPIAX_P_LOG);