From 598d6df506bc03b9b1f924d55ac8402b0473b4ef Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 8 Oct 2008 21:47:41 +0000 Subject: [PATCH] possible fix for MODAPP-153 git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9900 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_voicemail/mod_voicemail.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c index 1031132c87..ee421dd4f6 100644 --- a/src/mod/applications/mod_voicemail/mod_voicemail.c +++ b/src/mod/applications/mod_voicemail/mod_voicemail.c @@ -1546,9 +1546,7 @@ static switch_status_t listen_file(switch_core_session_t *session, vm_profile_t } -static void -update_mwi(vm_profile_t *profile, const char *id, const char *domain_name, - const char *myfolder) +static void update_mwi(vm_profile_t *profile, const char *id, const char *domain_name, const char *myfolder) { char *mwi_id; const char *yn = "no"; @@ -1589,7 +1587,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro switch_xml_t x_domain = NULL, x_domain_root = NULL, x_user = NULL, x_params, x_param; switch_status_t status; char pass_buf[80] = "", *mypass = NULL, id_buf[80] = "", *myfolder = NULL; - const char *thepass = NULL, *myid = id; + const char *thepass = NULL, *myid = id, *actual_id = NULL; char term = 0; uint32_t timeout, attempts = 0; int failed = 0; @@ -1640,6 +1638,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro play_msg_type = MSG_NONE; attempts = profile->max_login_attempts; myid = id; + actual_id = NULL; mypass = NULL; myfolder = "inbox"; vm_check_state = VM_CHECK_AUTH; @@ -1746,7 +1745,7 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro vm_execute_sql(profile, sql, profile->mutex); vm_check_state = VM_CHECK_FOLDER_SUMMARY; - update_mwi(profile, id, domain_name, myfolder); + update_mwi(profile, actual_id, domain_name, myfolder); } break; case VM_CHECK_CONFIG: @@ -1950,6 +1949,10 @@ static void voicemail_check_main(switch_core_session_t *session, const char *pro if (x_box) { myid = switch_core_session_strdup(session, x_box); } + + if (!(actual_id = switch_xml_attr(x_user, "id"))) { + actual_id = id; + } } }