Callback Caller ID

Hello Everyone, its been a little while!

Asterisk: 13.7.2
FreePBX Firmware: 6.12.65-32

I have been playing around with a callback script I wrote in the override file:

 * The system collects a callback number from the caller and calls the collected number back.
 * When the system calls the collected number back that call is eventually sent to an IVR to see if the caller is really there (press 1 to continue). 
 * If the caller is there (presses 1) they are then transferred to a miscellaneous destination. 

This all works fine, but one enhancement I would like to add is that the caller ID changes from my trunk CID (which it currently is) to the number of the caller that the system called.

Any ideas on what I need to add to the override file to accomplish this?


 * Caller calls in and provides a number.
 * System collects the number, 444.444.4444, and hangs up.
 * System calls 444.444.4444 and confirms the caller is there before transferring to misc destination.

How do I make it so the caller ID that the misc destination sees is 444.444.4444 and not the trunk CID?

Thanks for any help or guidance you may be able to provide!

I’m not clear on the requirement.

You want your outgoing call to have the Caller ID of the person that called you? Pretty sure you won’t need that “Enter 1 if you are there.” code if you do that.

If it’s something else, you should be setting a variable in the Asterisk context that holds the original caller ID so you can use that and override the trunk Caller ID in the script.

Thanks Cynjut

To clarify, here is the code (I removed the press 1, its not relevant to what I am trying to accomplish here):

exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Playback(PleaseEnterYourCallBackNumber)
exten => s,n,Read(CALLBACK_ALT,10)
exten => s,n,SayDigits(${CALLBACK_ALT})
exten => s,n,Set(CALL=${CALLBACK_ALT})
exten => s,n,Set(DESTINATION=ext-miscdests,6,1)
exten => s,n,Set(SLEEP=5)
exten => s,n,System(/var/lib/asterisk/bin/callback ${CALL} ${DESTINATION} ${SLEEP} &)
exten => s,n,Playback(custom/callbacksoon)
exten => s,n,Hangup

We use this code to create a static callback time (i.e. “We will call you back in exactly X minutes”).

Assume my outgoing trunk CID is 555.555.5555

Referencing the above code, if the caller input 444.444.4444, FreePBX would call the caller back at 444.444.4444 in 5 seconds. Before the call goes to ext-miscdests,6,1, is there a way to change the caller ID that ext-miscdests,6,1 receives from 555.555.5555 to 444.444.4444?

I am open to adding something in between the misc destination and the callback if anyone has an idea of what I need to add.

Thanks again!

You’re losing the destination state. In your callback AGI, set the incoming CID to the ${DESTINATION} variable and don’t look at the CID. This code isn’t where the CID is getting hosed - it’s the code in your callback program.

1 Like

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