@fxbastler can offer suggestions for using a trunk-level C# script. I can offer a service-level solution that monitors inbound calls and performs actions. He is much better at scripts than I am and can explain what is possible through scripts. I can offer what is possible with our approach that uses our VoIPTools events API. If you can get what you need through a script, that is going to be simpler than having us create a custom service for you.
We can watch all inbound calls at the trunk or DID level, wait for X seconds, and divert the call to a CFD application that performs the following tasks:
- Drop the call
- Look up the phone number of the caller in your CRM
- Decide wither to automatically create an order
- Create an order (via your CRM API)
But is this really the way to handle this customer interaction? The only thing that makes any sense to me is that the caller is wanting to save money on the phone call? Is that really the goal? If so, then the above solution will work. But I think you should be asking yourself whether reproducing an antiquated/imperfect solution is the goal, or offering your customers a significant improvement would generate more business/conversions.
If the caller's phone call cost is not the issue, but this is just the way it has always been done, then I suggest an significantly different approach. For example, my assumption is that during office hours someone will answer the phone and take the order. If the call comes outside of office hours, then route the call to an IVR that prompts the caller "To place an order, press 1". When they press 1, send the call to a CFD application. Have the CFD perform the following steps:
- Get the caller's phone number
- Lookup the phone number in the CRM
- Determine whether they are allowed to place an auto-order
- If allowed:
- Create the order in CRM
- Play a prompt "your order has been received"
- Send email to administrator that a new order was created
- If NOT allowed (customer does not exist or is on credit hold)
- If on credit hold or other disqualifying conditions
- Play a prompt: "I'm sorry, we are unable to create an auto-order for you at this time, please call during office hours"
- Send email to administrator that new order was rejected and why
- If caller not found
- Request necessary details
- Create the contact in the CRM
- Place the order
- Thank them for their order
- Send email to administrator that new customer was created and order placed
- Disconnect the call
If you want to go down the bleeding-edge, you could use an AI voice receptionist to complete the entire process, but that is much different than what you originally requested.