]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
skypiax: now interprets correctly the_interface whichever it is: interface_id, interf...
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Wed, 29 Jul 2009 15:43:04 +0000 (15:43 +0000)
committerGiovanni Maruzzelli <gmaruzz@gmail.com>
Wed, 29 Jul 2009 15:43:04 +0000 (15:43 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14414 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_skypiax/mod_skypiax.c

index 78be6f8b6fd63fd119db68bb7b6a2d97e49ed041..2ab1e0c32d4c5a8ef8330b12c472be8b68fa5b2a 100644 (file)
@@ -132,8 +132,8 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_rates_string,
                                   globals.codec_rates_string);
 
 /* BEGIN: Changes here */
-static switch_status_t interface_exists(char *skype_user);
-static switch_status_t remove_interface(char *skype_user);
+static switch_status_t interface_exists(char *the_interface);
+static switch_status_t remove_interface(char *the_interface);
 /* END: Changes here */
 
 static switch_status_t channel_on_init(switch_core_session_t * session);
@@ -229,7 +229,7 @@ static switch_status_t interface_exists(char *the_interface)
           return SWITCH_STATUS_SUCCESS;
         }
     } else {
-
+      /* interface name */
       for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
         if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].name, the_interface) == 0) {
           return SWITCH_STATUS_SUCCESS;
@@ -241,8 +241,8 @@ static switch_status_t interface_exists(char *the_interface)
 
 
   for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) {
-    if (strlen(globals.SKYPIAX_INTERFACES[i].name)) {
-      if (strcmp(globals.SKYPIAX_INTERFACES[i].name, the_interface) == 0) {
+    if (strlen(globals.SKYPIAX_INTERFACES[i].skype_user)) {
+      if (strcmp(globals.SKYPIAX_INTERFACES[i].skype_user, the_interface) == 0) {
         return SWITCH_STATUS_SUCCESS;
       }
     }
@@ -1049,7 +1049,10 @@ static switch_status_t load_config(int reload_type)
 
       /* BEGIN: Changes here */
       if (reload_type == SOFT_RELOAD) {
-        if (interface_exists(name) == SWITCH_STATUS_SUCCESS) {
+                 char the_interface[256];
+                 sprintf(the_interface, "#%s", name);
+
+        if (interface_exists(the_interface) == SWITCH_STATUS_SUCCESS) {
           continue;
         }
       }