Index: res_smdi.c =================================================================== --- res_smdi.c (revision 116349) +++ res_smdi.c (working copy) @@ -440,7 +440,14 @@ /* If there were no messages in the queue, then go to sleep until one * arrives. */ - ast_cond_timedwait(&iface->md_q_cond, &iface->md_q_lock, &ts); + switch (type) { + case SMDI_MWI: + ast_cond_timedwait(&iface->mwi_q_cond, &iface->mwi_q_lock, &ts); + break; + case SMDI_MD: + ast_cond_timedwait(&iface->md_q_cond, &iface->md_q_lock, &ts); + break; + } if ((msg = smdi_msg_find(iface, type, search_key, options))) { unlock_msg_q(iface, type);