Summary: | ASTERISK-24275: Tie inter-Asterisk SIP PUBLISHes for MWI into res_mwi_external | ||
Reporter: | Mark Michelson (mmichelson) | Labels: | |
Date Opened: | 2014-08-27 22:15:14 | Date Closed: | |
Priority: | Major | Regression? | No |
Status: | Open/New | Components: | Resources/res_mwi_external Resources/res_pjsip_publish_asterisk |
Versions: | 13.0.0-beta1 | Frequency of Occurrence | |
Related Issues: | |||
Environment: | Attachments: | ||
Description: | Asterisk 13 introduced the ability for Asterisk to publish device state and MWI messages between each other.
While writing a test for ASTERISK-24116, I noticed a discrepancy in the AMI MWI events that the publishee publishes. If Asterisk 1 publishes to Asterisk 2 that mailbox "alice" has 2 new messages and 0 old messages, then Asterisk 2 sends out the following AMI event: {noformat} Event: MessageWaiting Waiting: 0 New: 2 Old 0 {noformat} The problem is the Waiting header. Since there are 2 new messages, the Waiting value should be 1 instead of 0. The reason this happens is because the AMI event calls {{ast_app_has_voicemail()}} to determine if there are messages waiting. This means that either app_voicemail or res_mwi_external is called into to determine if there are messages waiting. This is indicative of a larger issue, which is that anything that tries to check the current message count (such as running the AMI MWIGet action) of a mailbox will not get accurate counts. My suggestion for this is to have the SIP publish handler in res_pjsip_publish_asterisk call into the API provided by res_mwi_external to update mailbox status. This way, the events still get published, and state can be queried. The real work here would actually be to make res_mwi_external knowledgeable about external servers. Currently, res_mwi_external does not understand EIDs and will treat all mailboxes as local. | ||
Comments: |