Just look into call files. http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out . Using the AT() command when generating the call files you can schedule the execution of the call files. For auto dialing you can use two Asterisk servers and let one server make calls to other.
You can’t generate a call file in the /var/spool/asterisk/outgoing directory because Asterisk is kind of aggressive with grabbing anything that is placed into this directory and there is a real chance that the file will be processed before finished and ready to proces. You have to generate it using another directory and, when finished, move (not copy) it to /var/spool/asterisk/outgoing.
This is an example on how to generate and execute a call file with Asterisk script but there are a thousand ways to do this.
; with just one “>” the file is created.
exten => s,n,System(echo -E “Channel: SIP/31208080652/04*${LEG}#” > ${PAD})
; with two “>>” a line is added to the file
exten => s,n,System(echo -E “MaxRetries: 0” >> ${PAD})
exten => s,n,System(echo -E “RetryTime: 4000” >> ${PAD})
exten => s,n,System(echo -E “WaitTime: 3600” >> ${PAD})
exten => s,n,System(echo -E “Context: gtalk_conference” >> ${PAD})
exten => s,n,System(echo -E “Extension: s” >> ${PAD})
exten => s,n,System(echo -E “SetVar: LEG=${LEG}” >> ${PAD})
exten => s,n,System(echo -E “SetVar: TIMEOUT(absolute)=600)” >> ${PAD})
exten => s,n,System(echo -E “SetVar: IM_ACCOUNT=${IM_ACCOUNT}” >> ${PAD})
exten => s,n,System(echo -E “SetVar: KLANT_NUMMER=${KLANT_NUMMER}” >> ${PAD})
exten => s,n,System(echo -E “SetVar: ROOM=${ROOM}” >> ${PAD})
exten => s,n,System(echo -E “SetVar: OUTBOUND=${LEG}” >> ${PAD})
exten => s,n,System(echo -E “Priority: 1” >> ${PAD})
;exten => s,n,System(echo -E “SetVar: ROOM=${ROOM:2}” >> ${PAD})
; this line assures that there is a return at the end of the last line
exten => s,n,System(echo -E " " >> ${PAD})
this line makes a .bak file of the just generated call file. Not really needed but very handsome when used for testing
exten => s,n,System(echo cp ${PAD} ${PAD}.bak|at now+ 0 minutes)
this is where the action starts. With changing 0 in some other positive number you will schedule the execution of the call file (actually you are scheduling moving the call file to /var/spool/asterisk/outgoing. I’m not sure but I guess at also has a second option
exten => s,n,System(echo mv ${PAD} /var/spool/asterisk/outgoing/|at now+ 0 minutes)