skypiax: cosmetics
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14519 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
f1134fdd5b
commit
f11f9aab52
|
@ -1596,37 +1596,6 @@ int outbound_channel_answered(private_t * tech_pvt)
|
||||||
return 0;
|
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 *find_available_skypiax_interface_rr(private_t * tech_pvt_calling)
|
||||||
{
|
{
|
||||||
private_t *tech_pvt = NULL;
|
private_t *tech_pvt = NULL;
|
||||||
|
|
|
@ -277,7 +277,6 @@ int skypiax_pipe_read(int pipe, short *buf, int howmany);
|
||||||
int skypiax_pipe_write(int pipe, short *buf, int howmany);
|
int skypiax_pipe_write(int pipe, short *buf, int howmany);
|
||||||
#endif /* WIN32 */
|
#endif /* WIN32 */
|
||||||
int skypiax_close_socket(unsigned int fd);
|
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);
|
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_ringing(private_t * tech_pvt);
|
||||||
int remote_party_is_early_media(private_t * tech_pvt);
|
int remote_party_is_early_media(private_t * tech_pvt);
|
||||||
|
|
|
@ -120,33 +120,6 @@ int skypiax_signaling_read(private_t * tech_pvt)
|
||||||
tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
|
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", 4)) {
|
||||||
if (!strncasecmp(message, "ERROR 96 CALL", 12)) {
|
if (!strncasecmp(message, "ERROR 96 CALL", 12)) {
|
||||||
|
@ -543,25 +516,6 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
|
||||||
short kill_cli_buff[SAMPLES_PER_FRAME];
|
short kill_cli_buff[SAMPLES_PER_FRAME];
|
||||||
short totalbuf[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);
|
s = skypiax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_srv_port);
|
||||||
if (s < 0) {
|
if (s < 0) {
|
||||||
ERRORA("skypiax_socket_create_and_bind error!\n", SKYPIAX_P_LOG);
|
ERRORA("skypiax_socket_create_and_bind error!\n", SKYPIAX_P_LOG);
|
||||||
|
@ -734,27 +688,6 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
|
||||||
unsigned int sin_size;
|
unsigned int sin_size;
|
||||||
#endif /* WIN32 */
|
#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);
|
s = skypiax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_cli_port);
|
||||||
if (s < 0) {
|
if (s < 0) {
|
||||||
ERRORA("skypiax_socket_create_and_bind error!\n", SKYPIAX_P_LOG);
|
ERRORA("skypiax_socket_create_and_bind error!\n", SKYPIAX_P_LOG);
|
||||||
|
|
Loading…
Reference in New Issue