From: Tilghman Lesher Date: Mon, 16 Jun 2008 19:21:58 +0000 (+0000) Subject: People expect that if "hasvoicemail" is set in users.conf, even if "mailbox" X-Git-Tag: 1.4.22-rc1~207 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b815ecf349e0a815cc8bc0209196c0e3ec428164;p=thirdparty%2Fasterisk.git People expect that if "hasvoicemail" is set in users.conf, even if "mailbox" isn't set, that SIP will detect a mailbox. (closes issue #12855) Reported by: PLL Patches: 20080614__bug12855__2.diff.txt uploaded by Corydon76 (license 14) Tested by: PLL git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@123110 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 6b5e8a147e..f257b94074 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -16841,6 +16841,12 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str ast_copy_string(peer->mohsuggest, v->value, sizeof(peer->mohsuggest)); } else if (!strcasecmp(v->name, "mailbox")) { ast_copy_string(peer->mailbox, v->value, sizeof(peer->mailbox)); + } else if (!strcasecmp(v->name, "hasvoicemail")) { + /* People expect that if 'hasvoicemail' is set, that the mailbox will + * be also set, even if not explicitly specified. */ + if (ast_true(v->value) && ast_strlen_zero(peer->mailbox)) { + ast_copy_string(peer->mailbox, name, sizeof(peer->mailbox)); + } } else if (!strcasecmp(v->name, "subscribemwi")) { ast_set2_flag(&peer->flags[1], ast_true(v->value), SIP_PAGE2_SUBSCRIBEMWIONLY); } else if (!strcasecmp(v->name, "vmexten")) {