<p>Joshua Colp <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13594">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_voicemail: Set globals to default values when voicemail.conf missing<br><br>If voicemail.conf exists but is empty, the config parsing process will<br>default a number of global variables to non-zero values. On the other<br>hand, if voicemail.conf is missing (arguably semantically equivalent<br>to an empty file), this process is skipped and the globals are<br>defaulted to 0.<br><br>Set the globals to the same values they would be set to if a<br>configuration were present. This allows voicemail configuration to be<br>done completely by Realtime without the need to create an empty<br>voicemail.conf file.<br><br>ASTERISK-27622 #close<br>Reported by: Jim Van Meggelen<br><br>Change-Id: Id907d280f310f12e542ca527e6a025432b9fb409<br>---<br>M apps/app_voicemail.c<br>1 file changed, 24 insertions(+), 24 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c</span><br><span>index f89248b..9ef2a24 100644</span><br><span>--- a/apps/app_voicemail.c</span><br><span>+++ b/apps/app_voicemail.c</span><br><span>@@ -495,20 +495,20 @@</span><br><span> ***/</span><br><span> </span><br><span> #ifdef IMAP_STORAGE</span><br><span style="color: hsl(0, 100%, 40%);">-static char imapserver[48];</span><br><span style="color: hsl(0, 100%, 40%);">-static char imapport[8];</span><br><span style="color: hsl(120, 100%, 40%);">+static char imapserver[48] = "localhost";</span><br><span style="color: hsl(120, 100%, 40%);">+static char imapport[8] = "143";</span><br><span> static char imapflags[128];</span><br><span style="color: hsl(0, 100%, 40%);">-static char imapfolder[64];</span><br><span style="color: hsl(0, 100%, 40%);">-static char imapparentfolder[64] = "\0";</span><br><span style="color: hsl(0, 100%, 40%);">-static char greetingfolder[64];</span><br><span style="color: hsl(120, 100%, 40%);">+static char imapfolder[64] = "INBOX";</span><br><span style="color: hsl(120, 100%, 40%);">+static char imapparentfolder[64];</span><br><span style="color: hsl(120, 100%, 40%);">+static char greetingfolder[64] = "INBOX";</span><br><span> static char authuser[32];</span><br><span> static char authpassword[42];</span><br><span> static int imapversion = 1;</span><br><span> </span><br><span> static int expungeonhangup = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-static int imapgreetings = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-static int imap_poll_logout = 0;</span><br><span style="color: hsl(0, 100%, 40%);">-static char delimiter = '\0';</span><br><span style="color: hsl(120, 100%, 40%);">+static int imapgreetings;</span><br><span style="color: hsl(120, 100%, 40%);">+static int imap_poll_logout;</span><br><span style="color: hsl(120, 100%, 40%);">+static char delimiter;</span><br><span> </span><br><span> /* mail_open cannot be protected on a stream basis */</span><br><span> ast_mutex_t mail_open_lock;</span><br><span>@@ -894,8 +894,8 @@</span><br><span> };</span><br><span> </span><br><span> #ifdef ODBC_STORAGE</span><br><span style="color: hsl(0, 100%, 40%);">-static char odbc_database[80];</span><br><span style="color: hsl(0, 100%, 40%);">-static char odbc_table[80];</span><br><span style="color: hsl(120, 100%, 40%);">+static char odbc_database[80] = "asterisk";</span><br><span style="color: hsl(120, 100%, 40%);">+static char odbc_table[80] = "voicemessages";</span><br><span> #define RETRIEVE(a,b,c,d) retrieve_file(a,b)</span><br><span> #define DISPOSE(a,b) remove_file(a,b)</span><br><span> #define STORE(a,b,c,d,e,f,g,h,i,j,k) store_file(a,b,c,d)</span><br><span>@@ -969,21 +969,21 @@</span><br><span> static char zonetag[80];</span><br><span> static char locale[20];</span><br><span> static int maxsilence;</span><br><span style="color: hsl(0, 100%, 40%);">-static int maxmsg;</span><br><span style="color: hsl(120, 100%, 40%);">+static int maxmsg = MAXMSG;</span><br><span> static int maxdeletedmsg;</span><br><span> static int silencethreshold = 128;</span><br><span style="color: hsl(0, 100%, 40%);">-static char serveremail[80];</span><br><span style="color: hsl(0, 100%, 40%);">-static char mailcmd[160]; /* Configurable mail cmd */</span><br><span style="color: hsl(120, 100%, 40%);">+static char serveremail[80] = ASTERISK_USERNAME;</span><br><span style="color: hsl(120, 100%, 40%);">+static char mailcmd[160] = SENDMAIL; /* Configurable mail cmd */</span><br><span> static char externnotify[160];</span><br><span> static struct ast_smdi_interface *smdi_iface = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-static char vmfmts[80];</span><br><span style="color: hsl(120, 100%, 40%);">+static char vmfmts[80] = "wav";</span><br><span> static double volgain;</span><br><span> static int vmminsecs;</span><br><span> static int vmmaxsecs;</span><br><span> static int maxgreet;</span><br><span style="color: hsl(0, 100%, 40%);">-static int skipms;</span><br><span style="color: hsl(0, 100%, 40%);">-static int maxlogins;</span><br><span style="color: hsl(0, 100%, 40%);">-static int minpassword;</span><br><span style="color: hsl(120, 100%, 40%);">+static int skipms = 3000;</span><br><span style="color: hsl(120, 100%, 40%);">+static int maxlogins = 3;</span><br><span style="color: hsl(120, 100%, 40%);">+static int minpassword = MINPASSWORD;</span><br><span> static int passwordlocation;</span><br><span> static char aliasescontext[MAX_VM_CONTEXT_LEN];</span><br><span> </span><br><span>@@ -991,10 +991,10 @@</span><br><span> * app_voicemail that may change them. */</span><br><span> static unsigned int poll_mailboxes;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/*! Polling frequency */</span><br><span style="color: hsl(0, 100%, 40%);">-static unsigned int poll_freq;</span><br><span> /*! By default, poll every 30 seconds */</span><br><span> #define DEFAULT_POLL_FREQ 30</span><br><span style="color: hsl(120, 100%, 40%);">+/*! Polling frequency */</span><br><span style="color: hsl(120, 100%, 40%);">+static unsigned int poll_freq = DEFAULT_POLL_FREQ;</span><br><span> </span><br><span> AST_MUTEX_DEFINE_STATIC(poll_lock);</span><br><span> static ast_cond_t poll_cond = PTHREAD_COND_INITIALIZER;</span><br><span>@@ -1091,7 +1091,7 @@</span><br><span> </span><br><span> static struct ast_flags globalflags = {0};</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static int saydurationminfo;</span><br><span style="color: hsl(120, 100%, 40%);">+static int saydurationminfo = 2;</span><br><span> </span><br><span> static char dialcontext[AST_MAX_CONTEXT] = "";</span><br><span> static char callcontext[AST_MAX_CONTEXT] = "";</span><br><span>@@ -1100,10 +1100,10 @@</span><br><span> static char cidinternalcontexts[MAX_NUM_CID_CONTEXTS][64];</span><br><span> </span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-static char *emailbody = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-static char *emailsubject = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-static char *pagerbody = NULL;</span><br><span style="color: hsl(0, 100%, 40%);">-static char *pagersubject = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+static char *emailbody;</span><br><span style="color: hsl(120, 100%, 40%);">+static char *emailsubject;</span><br><span style="color: hsl(120, 100%, 40%);">+static char *pagerbody;</span><br><span style="color: hsl(120, 100%, 40%);">+static char *pagersubject;</span><br><span> static char fromstring[100];</span><br><span> static char pagerfromstring[100];</span><br><span> static char charset[32] = "ISO-8859-1";</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13594">change 13594</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/13594"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: Id907d280f310f12e542ca527e6a025432b9fb409 </div>
<div style="display:none"> Gerrit-Change-Number: 13594 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>