Hello guys,
I would like to create an IVR where i get the latest extension number that called a customer, so if the customer didn’t answer to the phone and call back to my company, asterisk forward the
call to the latest extension that have done the latest call to the customer.
I don’t know where to start, can someone help me please?
In your incoming call context,
-Answer the call
-Use Read or Background application to play a message and collect some DTMFs from caller.
-Dial the application
This is very basic(un-tested) dialplan and doesn’t perform any validation on user’s input. I suggest you study those applications and some other basic Asterisk Dialplan stuff
Assuming your incoming call context is [incoming]
[incoming]
exten => _X.,1,Answer()
same => n,Read(extensionEntered,audioFile)
same => n,Dial(SIP/${extensionEntered})
I interpret the OPs task as “when an agent calls a customer and the customer doesn’t answer, save the agent extension and the customer phone number in a database so if the customer calls back, the call can be routed to the agent who placed the last call to the customer.”
If correct, please show us what you have done so far (extensions.conf) and where it fails (console log) so we can suggest specific solutions.
Hello sedwards,
yes is correct, for now I’ve only the CDR but I don’t know how can procede…I don’t have much experience in asterisk
In my mind I would like to do the following steps:
when a call arrive I want to store in a variable1 the caller number (example 234xxxxxx),
make a query in the CDR
SELECT * FROM call_log
WHERE number_dialed LIKE ‘234xxxxxx’
ORDER BY start_time DESC LIMIT 1
from the result, store the extension in a variable2
connect the caller number to the variable2
if is not reachable forward the call to a specific group.
Can you help me please?
We believe in the ‘teach a man to fish…’ approach where ‘teach’ means ‘offer suggestions to help guide you’, but asking for ‘a practical example’ is unlikely to serve you in the long term.
What you see on this list is all volunteering. Digium may have employees who’s job covers monitoring this list, but they’re here to keep the ball rolling, not hand out ‘work product.’
It sounds like you would profit from a bit of reading and experimentation. I suggest reading through relevant chapters of ’ Asterisk: The Future of Telephony’ and trying some of the concepts.
What you are asking for is not difficult. I’d focus on topics like writing dialplan and database access.
My personal bias is that database access belongs in an AGI, but your needs can also be satisfied using the ODBC method. There are examples of both, just a google away.