mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-26 04:27:25 +00:00
skypiax: patch from Carlos Talbot, interface is a reserved word on Windows VC++
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14413 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
0bb1b8c7d7
commit
19bb4d410a
@ -213,25 +213,25 @@ void skypiax_tech_init(private_t * tech_pvt, switch_core_session_t * session)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* BEGIN: Changes here */
|
/* BEGIN: Changes here */
|
||||||
static switch_status_t interface_exists(char *interface)
|
static switch_status_t interface_exists(char *the_interface)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int interface_id;
|
int interface_id;
|
||||||
|
|
||||||
if ( *interface == '#') { /* look by interface id or interface name */
|
if ( *the_interface == '#') { /* look by interface id or interface name */
|
||||||
interface++;
|
the_interface++;
|
||||||
switch_assert(interface);
|
switch_assert(the_interface);
|
||||||
interface_id = atoi(interface);
|
interface_id = atoi(the_interface);
|
||||||
|
|
||||||
/* take a number as interface id */
|
/* take a number as interface id */
|
||||||
if ( interface_id > 0 || (interface_id == 0 && strcmp(interface, "0") == 0 )) {
|
if ( interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0 )) {
|
||||||
if (strlen(globals.SKYPIAX_INTERFACES[interface_id].name)) {
|
if (strlen(globals.SKYPIAX_INTERFACES[interface_id].name)) {
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
|
for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
|
||||||
if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].name, interface) == 0) {
|
if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].name, the_interface) == 0) {
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -242,7 +242,7 @@ static switch_status_t interface_exists(char *interface)
|
|||||||
|
|
||||||
for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) {
|
for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) {
|
||||||
if (strlen(globals.SKYPIAX_INTERFACES[i].name)) {
|
if (strlen(globals.SKYPIAX_INTERFACES[i].name)) {
|
||||||
if (strcmp(globals.SKYPIAX_INTERFACES[i].name, interface) == 0) {
|
if (strcmp(globals.SKYPIAX_INTERFACES[i].name, the_interface) == 0) {
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -251,7 +251,7 @@ static switch_status_t interface_exists(char *interface)
|
|||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static switch_status_t remove_interface(char *interface)
|
static switch_status_t remove_interface(char *the_interface)
|
||||||
{
|
{
|
||||||
int x = 100;
|
int x = 100;
|
||||||
unsigned int howmany = 8;
|
unsigned int howmany = 8;
|
||||||
@ -262,18 +262,18 @@ static switch_status_t remove_interface(char *interface)
|
|||||||
//running = 0;
|
//running = 0;
|
||||||
|
|
||||||
|
|
||||||
if ( *interface == '#') { /* remove by interface id or interface name */
|
if ( *the_interface == '#') { /* remove by interface id or interface name */
|
||||||
interface++;
|
the_interface++;
|
||||||
switch_assert(interface);
|
switch_assert(the_interface);
|
||||||
interface_id = atoi(interface);
|
interface_id = atoi(the_interface);
|
||||||
|
|
||||||
if ( interface_id > 0 || (interface_id == 0 && strcmp(interface, "0") == 0 )) {
|
if ( interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0 )) {
|
||||||
/* take a number as interface id */
|
/* take a number as interface id */
|
||||||
tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
|
tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
|
for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
|
||||||
if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].name, interface) == 0) {
|
if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].name, the_interface) == 0) {
|
||||||
tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
|
tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ static switch_status_t remove_interface(char *interface)
|
|||||||
}
|
}
|
||||||
} else { /* remove by skype_user */
|
} else { /* remove by skype_user */
|
||||||
for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
|
for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
|
||||||
if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].skype_user, interface) == 0) {
|
if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].skype_user, the_interface) == 0) {
|
||||||
tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
|
tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -290,12 +290,12 @@ static switch_status_t remove_interface(char *interface)
|
|||||||
|
|
||||||
if (!tech_pvt) {
|
if (!tech_pvt) {
|
||||||
DEBUGA_SKYPE("interface '%s' does not exist\n", SKYPIAX_P_LOG,
|
DEBUGA_SKYPE("interface '%s' does not exist\n", SKYPIAX_P_LOG,
|
||||||
interface);
|
the_interface);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen(globals.SKYPIAX_INTERFACES[interface_id].session_uuid_str)) {
|
if (strlen(globals.SKYPIAX_INTERFACES[interface_id].session_uuid_str)) {
|
||||||
DEBUGA_SKYPE("interface '%s' is busy\n", SKYPIAX_P_LOG, interface);
|
DEBUGA_SKYPE("interface '%s' is busy\n", SKYPIAX_P_LOG, the_interface);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,17 +350,17 @@ static switch_status_t remove_interface(char *interface)
|
|||||||
|
|
||||||
switch_mutex_lock(globals.mutex);
|
switch_mutex_lock(globals.mutex);
|
||||||
if(globals.sk_console == &globals.SKYPIAX_INTERFACES[interface_id]){
|
if(globals.sk_console == &globals.SKYPIAX_INTERFACES[interface_id]){
|
||||||
DEBUGA_SKYPE("interface '%s' no more console\n", SKYPIAX_P_LOG, interface);
|
DEBUGA_SKYPE("interface '%s' no more console\n", SKYPIAX_P_LOG, the_interface);
|
||||||
globals.sk_console = NULL;
|
globals.sk_console = NULL;
|
||||||
} else {
|
} else {
|
||||||
DEBUGA_SKYPE("interface '%s' STILL console\n", SKYPIAX_P_LOG, interface);
|
DEBUGA_SKYPE("interface '%s' STILL console\n", SKYPIAX_P_LOG, the_interface);
|
||||||
}
|
}
|
||||||
memset(&globals.SKYPIAX_INTERFACES[interface_id], '\0', sizeof(private_t));
|
memset(&globals.SKYPIAX_INTERFACES[interface_id], '\0', sizeof(private_t));
|
||||||
globals.real_interfaces--;
|
globals.real_interfaces--;
|
||||||
switch_mutex_unlock(globals.mutex);
|
switch_mutex_unlock(globals.mutex);
|
||||||
|
|
||||||
DEBUGA_SKYPE("interface '%s' deleted successfully\n", SKYPIAX_P_LOG,
|
DEBUGA_SKYPE("interface '%s' deleted successfully\n", SKYPIAX_P_LOG,
|
||||||
interface);
|
the_interface);
|
||||||
globals.SKYPIAX_INTERFACES[interface_id].running=1;
|
globals.SKYPIAX_INTERFACES[interface_id].running=1;
|
||||||
end:
|
end:
|
||||||
//running = 1;
|
//running = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user