[asterisk-users] Callback script anyone
Danny Nicholas
danny at debsinc.com
Thu Aug 12 15:16:00 CDT 2010
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of J. Oquendo
Sent: Thursday, August 12, 2010 3:02 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Callback script anyone
Danny Nicholas wrote:
>> From: asterisk-users-bounces at lists.digium.com
>>
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of J. Oquendo
>
>> Subject: [asterisk-users] Callback script anyone
>>
>
>
>
>> Without diving into too many details, does anyone have a simple callback
>>
> script that does the following:
>
>
>> Caller --> Dial
>> Asterisk --> "In order to place this call please enter a callback number
>>
> to place this call for your pin..."
>
>> Caller --> Enters DID to call back for pin
>> Asterisk --> stores a number to either a flat file or DB. (From here I
>>
> can take care of the rest)
>
>
>> I'm using Asterisk 1.4.
>>
> <snip>
>
> I'm a little confused; are you wanting a DISA setup where caller enters a
> PIN to continue the call, or are you wanting the caller to enter a DID
where
> you will call him back with a PIN?
>
Enter a DID where we can call back with a PIN.
Here's a simple snippet
Exten => 1234,1,read(anumber,amessage,11)
exten => 1234,n,Gotoif($[ "${LEN(${anumber})}" < "7"]?tooshort)
exten => 1234,n,Gotoif($[ "${LEN(${anumber})}" <>= "${EXTEN}"]?spoof)
exten => 1234,n,Set(DB(xkey)=${anumber}) writes anumber to the asterisk db
exten => 1234,n(tooshort),Playback(numtooshort)
exten => 1234,n,Goto(1)
exten => 1234,n(spoof),playback(liar)
exten => 1234,n,hangup
On line 3 you probably would use ${CALLERID(num)} instead of ${EXTEN} and
you would have to record the messages "amessage", "numtooshort" and "liar".
You could use a MYSQL command or system command in line 4; I just write
this kind of stuff to the asterisk DB for simplicity.
More information about the asterisk-users
mailing list