Attach DID number to the email notification

Hello.
I have successfully configured freepbx on a VPS using KVM and linked it to the DID provider.
What I really need is to attach the incoming DID number to the body of the voicemail email. I am using it with over 500 DIDs and mostly for voicemail so creating extensions for these many numbers will be a pain.
I also tried all the possible variables in asterisk but with no success.
I need some help if possible from someone with more experience than I have.
I attached the screenshot from Call Event Logging. What I need from there is to attach the number covered by the red square to the content of the email.

Perhaps if you have that many DID’s you should be using from-did-direct or a modification , we see now everything is going to anonymous.

More logs?. better description of your inbound trunking perhaps?

The vm notification is done by app_voicemail in Asterisk, and there is no native ability to reference the DID in the vm notification.

True but if the inbound call is DID specific and sent to a did specific context, then the channel will have that reference add an initial DumpChan() to your inbound context. . . .

@dicko that happens on Google Voice alone (so far). Rest of the calls have Caller ID.
If I can grab DID, CallerID (when it shows) and the .wav file that would be enough for me.
Not necessarily through email, it can also POST the three above to an external url and I can handle it from there.
The issue is that I must identify the DID and send the .wav alongside it. The rest matters a lot less for me and it can actually be ignored.
Really banging my head on the wall with this :slight_smile:
@lgaetz I am looking for an expert advice and a way to get this to work for me. Any help is really apreciated!

Sorry you are a little muddied, create a very noisy and explicit context for your inbound calls, post that context and then a call that hits such a context, failures should be self evident.

I am pretty much a total newb with this.
Can you explain in a bit more detail please?
Thanks!

Do you have a multiplicty of DIDs?

Who is you VSP?

How did they say to setup the trunk to/from them?

I have ~1k DIDs. I have set up the current ~500 using a set of simple rules (screenshots at the bottom).
The VPS is on OVH but it’s pretty much a standard one with all the ports open out of the box and with the ability to use KVM and VNC to install whatever you want. No restrictions on ports, traffic, etc.

The DID provider just has the following options: Gateway IP and codec.

The image is SNG7-FPBX-64bit-1904-2.iso installed using KVM.
The 2002 version has a lot of random MariaDB crashes so I dropped it and went with FreePBX 14 with Asterisk 13.32.0.
This has been stable for a while.
I am also using IBM Watson successfully to receive the transcripts in the email (it changes the mailcmd, nothing complex there)

Bellow you can see the settings on the system.
Ideally I just need to grab just the DID and a call recording or voicemail and send them to email or POST them to an URL and I can go from there
Many thanks.

Hello.
I don’t usually “up” posts but if someone can help I will appreciate it.
Many thanks!

First…I am no expert…
Do you use CID Superfecta? You could set CID Superfecta in your inbound route. In CID Superfecta there’s the option “send to email”. Use a separate email account like [email protected]. The voicemail emails should go there too.
The last email with the same CID before the voicemail email will show you the info about an incoming call. The text of the email (including the title) you can customize and add the DID of this incoming route. You need several CID superfecta schemes for every inbound route (there’s a duplicate option).

Yet, it might not be what you want :wink:

Just realized that the CID Superfecta emails already include the DID

That’s the standard email text:
Incoming call to [DID] from [NAME] at [NUMBER]. Automated notification email sent by the POSSA Superfecta Caller ID Module

…so you dont have to customize the text in the email template…and if the DID-field works, you just need ONE CID Superfecta scheme…

Just tested the DID field…somehow it doesnt work…there seems to be a bug in Superfecta

Incoming call to unknown from Edward Snowden at 012345678. Automated
notification email sent by phone system XY.

EDIT: Never mind…I called from another system through an IAX-trunk, this seems to have caused the “unknown”…

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