I can access the CDR database using Admirer and it works well. I’m trying to use FreePBX to capture information that the caller types into the phone dial pad after the call is answered. Here’s the call logic:
User calls in to a specific phone number, they enter in an employee ID number (There are hundreds), after they enter their employee ID it shoots the call over to a DISA. They then dial another phone number.
I need to be able to pull this data from the database:
The number they called in from
The time they called in
The employee ID they typed in
The number they dialed after reaching the DISA.
In order to get the call logic to work I used a IVR on the inbound route. I then enabled direct dialing expecting the employee ID to never match an actual extension. If it doesn’t match an extension it gets routed to the DISA.
I’ve been able to pull all the data I need from the CDR database EXCEPT for the employee ID they typed in. That doesn’t seem to be recorded in the database anywhere.
Is there a better way to achieve the same result? Where in FreePBX can I set up a call route so the user has to first dial a number (that doesn’t match anything in the system), that number is recorded and then the call get’s sent to a DISA?
Writing variables and routing on them would need to be done via custom dialplan. You could link the custom dialplan to your GUI via the Custom Destinations module, once you have written it.
Any chance you could help me write the custom dial plan in a way that would capture what was input by the caller and populate one of those fields? I don’t care if its account code or usrfield. I’m not experienced in custom dial plans.
Unfortunately I do not have the time, but several members here are capable and may help you. If you are looking for something more “concrete” Sangoma can be engaged for custom development.
Lastly, I would say that this is quickly learnable if you’re interested. The Asterisk Book was a quick way to learn and gain proficiency with Asterisk. It really opened a lot of doors as far as what is possible (basically anything).
Yes I know. comtech helped me understand this earlier in the thread. Now I’m just trying to figure out how to use a custom dial plan to capture the digits into the usrfield so I can pull it out of the cdr database. Struggling with this.
Here is the custom dial plan being referenced in “Target”:
[get-user-input]
; Prompt caller for TRM number and store in CDR userfield
; created by lgaetz 2019-08-19
; Usage: Custom Destination with goto line set to get-user-input,s,1
; Enable return destination and send caller to next destination
exten => s,1,Noop(Entering user defined context [get-user-input] in extensions_custom.conf)
;exten => s,n,Read(CDR(userfield),please-enter-your&letters/t&letters/r&letters/m&number&then-press-pound,,,,)
exten => s,n,Read(CDR(userfield),custom/TRM_No_and_then_Dial_Tone_for_District_Contact,,,,)
exten => s,n,Return