Add variable for number dialed to Voicemail to Email

This may be the wrong place but it is a place to start.

Is there a way to add a dialed number variable to the voicemail to email settings?

Currently, the below are what is listed.

The email body. Change the from, body and/or subject, variables: VM_NAME, VM_DUR, VM_MSGNUM, VM_MAILBOX, VM_CALLERID, VM_CIDNUM, VM_CIDNAME, VM_DATE. Additionally, on forwarded messages, you have the variables: ORIG_VM_CALLERID, ORIG_VM_CIDNUM, ORIG_VM_CIDNAME, ORIG_VM_DATE You can select between two variables by using dialplan functions, e.g. ${IF(${ISNULL(${ORIG_VM_DATE})}?${VM_DATE}:${ORIG_VM_DATE})}. [emailbody] Don’t leave single period on end of line by itself.

Looking at https://www.voip-info.org/asterisk-variables/

I can see a few options that may be already in Asterisk.

${DNID} : Dialed Number Identifier. Limitations apply, see DNID

${CALLERID(dnid)}

${FROM_DID}

Any thoughts?

Not all Asterisk channel variables are available to app_voicemail. AFAIK the only variables available are as listed here: VoiceMail Channel Variables - Asterisk Documentation

Thank you for the quick reply.
So, the only way to go about this would be to see if the previous variables I mentioned could be added to app_voicemail in Asterisk?
Is that correct?

This is used for POTS/ISDN stuff. If you’re using a SIP Trunk, it’s not going to exist work tech for it.

Yes, you would have to modify the app_voicemail source code which will require the source of Asterisk, modifying the code, rebuilding the Asterisk source and the Asterisk RPMs for FreePBX so that you can apply your patch.

So, not a quick fix.

But, just to be clear, I could put in a feature request to Asterisk to add the applicable variable to app_voicemail.

Then once FreePBX starts to use that version of Asterisk, it would be as simple to use as the other variables used in the current Voicemail to Email feature.

Does that seem correct?

Yes, you would have to modify the app_voicemail source code which will require the source of Asterisk, modifying the code, rebuilding the Asterisk source and the Asterisk RPMs for FreePBX so that you can apply your patch.

Sidenote: It also seems that if I was smart enough to do the above, I could also submit the code to the Asterisk project, and eventually, it could be added that way as well.

This is a FreePBX made up variable. It’s not a standard Asterisk variable so writing something for Asterisk to use this variable isn’t going to be helpful unless you make that variable something for Asterisk. And again, the CALLER type you are using is for POTS/ISDN lines so not all types of connections support it plus it may not even exist for voicemail (user to user calls).

You can do this but I doubt it is something that would be merged into Asterisk.

@jcolp and @mattf
Is there any chance of the above being implemented in Asterisk?

At the very least is there somewhere I can put this request?
I can provide whatever details necessary.

The Asterisk project itself doesn’t accept feature requests without patches. If someone were to create such a thing we would certainly review it if it were put up for review for inclusion.

… and once the request has been built into Asterisk, FreePBX would need to stand up a page to manage that stuff for you.

Both projects are (largely) open source, so providing patches is the way forward.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.