[Home]

Summary:ASTERISK-28259: CLONE - app_voicemail: Leaving voicemail sometimes doesn't trigger NOTIFYs
Reporter:Eric Person (eperson)Labels:pjsip
Date Opened:2019-01-24 10:46:45.000-0600Date Closed:2019-01-24 16:43:08.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Applications/app_voicemail
Versions:16.1.1 Frequency of
Occurrence
Constant
Related
Issues:
is the original version of this clone:ASTERISK-28215 app_voicemail: Leaving voicemail sometimes doesn't trigger NOTIFYs
Environment:Fast systemAttachments:
Description:Sometimes, after leaving voicemail for an extension MWI NOTIFYies aren't being sent.  It looks like a race condition in "leave_voicemail" where on cleanup we delete the mailbox state, possibly before the stasis message has been handled by res_pjsip_mwi.

Cloned this issue as problem appears to be the same. Posted over on the community forums first but I believe this is a bug. Here's what I posted over there.

Running Asterisk 16.1.1. I’m able to call an extension and leave a voicemail. The voicemail system will email the recipient notifying them a voicemail was left. But Asterisk doesn’t notify the phone there’s a voicemail for MWI. When I restart Asterisk, Asterisk will then send the notify to the phone turning on MWI. Any idea what’s wrong or is this a bug? See conf files and SIP notify’s below.
{noformat}
pjsip.conf sample:
[1234]
type = endpoint
transport = transport-udp
context = internal-spd
disallow = all
allow = g722
allow = ulaw
callerid = “Joe Blow” <1234>
mailboxes = 1234@abc
voicemail_extension = 1234
auth = 1234
aors = 1234

[1234]
type = auth
auth_type = userpass
username = 1234
password = XXXXXXXXXXXXXXX

[1234]
type = aor
max_contacts = 1
{noformat}
voicemail.conf sample:
{noformat}
[general]
format = wav49|wav
serveremail = asterisk@pretenddomain.com
attach = yes
maxsecs = 180
minsecs = 4
skipms = 3000
maxsilence = 3
silencethreshold = 128
maxlogins = 3
fromstring = Asterisk Voicemail
emailbody = Dear {VM_NAME}:\n\n\tJust wanted to let you know you were just {IF(["{VM_CIDNUM}" = “{ORIG_VM_CIDNUM}"]?left:forwarded)} a {VM_DUR} voice mail (number {VM_MSGNUM})\n from {VM_CALLERID}, on {VM_DATE}\n{IF(["{VM_CIDNUM}” = "{ORIG_VM_CIDNUM}"]?:(originally sent by {ORIG_VM_CALLERID} on ${ORIG_VM_DATE})\nso)}. To check messages from outside the office, please dial your own DID and press the * (asterisk) key when you hear your voice recording.\n\n\nThanks!\n\nVoice Mail System\n
emaildateformat = %A, %B %d, %Y at %r
pagerdateformat = %A, %B %d, %Y at %r
sendvoicemail = yes ; Allow the user to compose and send a voicemail while inside
review = yes ; Allow sender to review/rerecord their message before saving it [OFF by default
nextaftercmd = yes ; Skips to the next message after hitting 7 or 9 to delete/save current message.
forcename = yes ; Forces a new user to record their name. A new user is
minpassword = 4 ; Enforce minimum password length

[zonemessages]
eastern = America/New_York|‘vm-received’ Q ‘digits/at’ IMp
central = America/Chicago|‘vm-received’ Q ‘digits/at’ IMp
mountain = America/Denver|‘vm-received’ Q ‘digits/at’ IMp
pacific = America/Los_Angeles|‘vm-received’ Q ‘digits/at’ IMp
central24 = America/Chicago|‘vm-received’ q ‘digits/at’ H N ‘hours’
military = Zulu|‘vm-received’ q ‘digits/at’ H N ‘hours’ ‘phonetic/z_p’
european = Europe/Copenhagen|‘vm-received’ a d b ‘digits/at’ HM

[default]

[abc]
1234 => 1234,Joe Blow,Joe.Blow@pretenddomain.com,tz=eastern
{noformat}
Here’s a sample not working:
{noformat}
<— Transmitting SIP request (651 bytes) to UDP:10.10.10.19:5060 —>
NOTIFY sip:1234@10.10.10.19 SIP/2.0
Via: SIP/2.0/UDP 10.10.10.254:5060;rport;branch=z9hG4bKPjd6a8e0fb-7e36-449f-8ce4-1d7a8997aabd
From: sip:1234@10.10.10.254;tag=aa37c564-38fd-4266-adc5-6367ea32a9ec
To: sip:1234@10.10.10.19
Contact: sip:1234@10.10.10.254:5060
Call-ID: 7dd4931a-0c81-47f0-a1b4-0415760df606
CSeq: 19505 NOTIFY
Subscription-State: terminated
Event: message-summary
Allow-Events: message-summary, presence, dialog, refer
Max-Forwards: 70
User-Agent: Asterisk PBX 16.1.1
Content-Type: application/simple-message-summary
Content-Length: 48

Messages-Waiting: no
Voice-Message: 0/0 (0/0)
{noformat}
Here’s a sample working:
{noformat}
NOTIFY sip:1234@10.10.10.19 SIP/2.0
Via: SIP/2.0/UDP 10.10.10.254:5060;rport;branch=z9hG4bKPj1fa02794-ddd1-48d8-a768-48ede6df759e
From: sip:1234@10.10.10.254;tag=b3cc5dbf-1bf2-4170-9845-1ef5bc0ecaf4
To: sip:1234@10.10.10.19
Contact: sip:1234@10.10.10.254:5060
Call-ID: 2356b794-6969-4271-b551-77d3c744cf5f
CSeq: 40994 NOTIFY
Subscription-State: terminated
Event: message-summary
Allow-Events: message-summary, presence, dialog, refer
Max-Forwards: 70
User-Agent: Asterisk PBX 16.1.1
Content-Type: application/simple-message-summary
Content-Length: 100

Messages-Waiting: yes
Message-Account: sip:1234@10.10.10.254:5060
Voice-Message: 1/0 (0/0)
{noformat}
Comments:By: Asterisk Team (asteriskteam) 2019-01-24 10:46:46.328-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Kevin Harwell (kharwell) 2019-01-24 16:14:50.626-0600

You found ASTERISK-28215, and cloned it. Did you try the patch associated with ASTERISK-28215? Does it fix your issue?

By: Eric Person (eperson) 2019-01-24 16:21:01.650-0600

I'm sorry but which patch are you referring to? Could you please link to it for me? Thank you!

By: Kevin Harwell (kharwell) 2019-01-24 16:41:11.182-0600

No problem. Here is a link to the Asterisk 16 branch version patch: [16 branch diff|https://gerrit.asterisk.org/changes/10820/revisions/aebb822d1f5604a376f78e1d8ae555580aad4d64/patch?zip]

Unzip the file, and then patch the Asterisk source (from top level Asterisk directory) using either _git_ (example commands as your diff file may be named something different):
{noformat}
$ git apply aebb822.diff
{noformat}
or _patch_
{noformat}
$ patch -p1 < aebb822.diff
{noformat}

Rebuild and reinstall Asterisk.

However for future reference all patches pass through the review process via gerrit. If things are linked appropriately you'll see the link to the gerrit review on the issue once a patch has been submitted for review. For instance you'll note on ASTERISK-28215 that 3 comments have been added by "Friendly Automation" that link that issue back to the gerrit review for each branch the patch is going, or went into.

If you click one of those links you'll see the [review for that branch|https://gerrit.asterisk.org/#/c/asterisk/+/10820/]. Near the upper right you'll see a "Cherry-picks" tab that allows you to view the other branch reviews. Click the branch you need and then click the "Download" drop down (again near upper right of screen). Choose how you want to download the patch. I chose the "Patch-File ... | [aebb822.diff.zip|https://gerrit.asterisk.org/changes/10820/revisions/aebb822d1f5604a376f78e1d8ae555580aad4d64/patch?zip]" for the link above.

By: Kevin Harwell (kharwell) 2019-01-24 16:43:08.237-0600

I'm going to go ahead and close this issue out as it's just a clone of the other issue, which has already been fixed.