]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix handling of error cases in voicemail_inject (MODAPP-133)
authorMichael Jerris <mike@jerris.com>
Thu, 28 Aug 2008 02:21:21 +0000 (02:21 +0000)
committerMichael Jerris <mike@jerris.com>
Thu, 28 Aug 2008 02:21:21 +0000 (02:21 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9374 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_voicemail/mod_voicemail.c

index 9fbc59eef588bf1d1a9a59decd753e63ea758216..f284d6885b3dd2151875713b1bb4ea716f6fd9c7 100644 (file)
@@ -2141,6 +2141,7 @@ static switch_status_t voicemail_inject(const char *data)
 
        if ((argc = switch_separate_string(dup, ' ', argv, (sizeof(argv) / sizeof(argv[0])))) < 2) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "not enough args [%s]\n", data);
+               status = SWITCH_STATUS_FALSE;
                goto end;
        }
 
@@ -2166,6 +2167,7 @@ static switch_status_t voicemail_inject(const char *data)
        
        if (!(user && domain)) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid syntax [%s][%s]\n", switch_str_nil(user), switch_str_nil(domain));
+               status = SWITCH_STATUS_FALSE;
                goto end;
        }
 
@@ -2175,6 +2177,7 @@ static switch_status_t voicemail_inject(const char *data)
        
        if (!profile) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find profile\n");
+               status = SWITCH_STATUS_FALSE;
        } else {
                switch_xml_t x_domain, xml_root;
                switch_event_t *my_params = NULL;
@@ -2187,6 +2190,7 @@ static switch_status_t voicemail_inject(const char *data)
                
                if (switch_xml_locate_domain(domain, my_params, &xml_root, &x_domain) != SWITCH_STATUS_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot locate domain %s\n", domain);
+                       status = SWITCH_STATUS_FALSE;
                        switch_event_destroy(&my_params);
                        goto end;
                }