Merge "res_pjsip: New endpoint option "refer_blind_progress""
[asterisk/asterisk.git] / res / res_smdi.c
index 02f2e4a..e2e5b17 100644 (file)
@@ -46,8 +46,6 @@
 
 #include "asterisk.h"
 
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-
 #include <termios.h>
 #include <sys/time.h>
 #include <time.h>
@@ -873,10 +871,10 @@ static int smdi_md_q_cmp_fn(void *obj, void *arg, int flags)
 
        switch (flags & OBJ_SEARCH_MASK) {
        case OBJ_SEARCH_OBJECT:
-               if (search_msg->mesg_desk_num) {
+               if (!ast_strlen_zero(search_msg->mesg_desk_num)) {
                        cmp = strcmp(msg->mesg_desk_num, search_msg->mesg_desk_num);
                }
-               if (search_msg->mesg_desk_term) {
+               if (!ast_strlen_zero(search_msg->mesg_desk_term)) {
                        cmp |= strcmp(msg->mesg_desk_term, search_msg->mesg_desk_term);
                }
                break;
@@ -1128,7 +1126,7 @@ static int smdi_load(int reload)
        if (!AST_LIST_EMPTY(&mwi_monitor.mailbox_mappings) && mwi_monitor.thread == AST_PTHREADT_NULL
                && ast_pthread_create_background(&mwi_monitor.thread, NULL, mwi_monitor_handler, NULL)) {
                ast_log(LOG_ERROR, "Failed to start MWI monitoring thread.  This module will not operate.\n");
-               return AST_MODULE_LOAD_FAILURE;
+               return -1;
        }
 
        if (ao2_container_count(new_ifaces)) {
@@ -1371,7 +1369,7 @@ static int load_module(void)
        res = smdi_load(0);
        if (res < 0) {
                _unload_module(1);
-               return res;
+               return AST_MODULE_LOAD_DECLINE;
        } else if (res == 1) {
                _unload_module(1);
                ast_log(LOG_NOTICE, "No SMDI interfaces are available to listen on, not starting SMDI listener.\n");
@@ -1433,9 +1431,9 @@ static int reload(void)
 }
 
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ORDER, "Simplified Message Desk Interface (SMDI) Resource",
-               .support_level = AST_MODULE_SUPPORT_CORE,
-               .load = load_module,
-               .unload = unload_module,
-               .reload = reload,
-               .load_pri = AST_MODPRI_CHANNEL_DEPEND,
-              );
+       .support_level = AST_MODULE_SUPPORT_CORE,
+       .load = load_module,
+       .unload = unload_module,
+       .reload = reload,
+       .load_pri = AST_MODPRI_CHANNEL_DEPEND,
+);