Auto dial / Dahdi configuration

Hi,

I am working on Auto dial application.

Now my issue is that when call file is thrown to /var/asterisk/outgoing/ the call takes place to specified number and after

Answer
Wait(10)
The playback starts without knowning that user has picked the call or not. So, sometimes if there are 5-6 bells on user number then half of the playback is played and user can hear only half of it.

My .call file is as under

Channel: DAHDI/01/00923001000100
Callerid: abc
MaxRetries: 10
RetryTime: 5
WaitTime: 20
Context: abcde
Extension: 500

My extension.conf is as under for extension 500 is

[general]
static=yes
writeprotect=no
autofallthrough=no
[globals]
[aabcd]
exten => 500,1,Answer()
exten => 500,2,Wait(10)
exten => 500,3,Playback(/home/software/AsteriskPackage/asterisk-1.6.1.0/sounds/advertisement)
exten => 500,4,Hangup()

You should check for dialstatus and continue, using a gotoif() statement, if the status is “ANSWERED”. You don’t need an Answer() line, the called party has to answer the line.

voip-info.org/wiki/index.php … DIALSTATUS

voip-info.org/wiki/view/Asterisk+cmd+GotoIf

Can you provide me any example for it.

exten => s,n(loop),Gotoif($[ “${DIALSTATUS}” : “ANSWER”]?continue)
exten => s,n,Wait(1)
exten => s,n,Goto(loop)
exten => s,n(continue),NoOp(continueing the dialplan)
exten => s,n,Playback(your_message)

This is the basic idea. There is a check for the status and if the status is ANSWER then the routine continues. This way you solve the playing of the message before the phone is picked up.

I had tried this thing but code remains in a loop and no call is generated . See below the result.

– Executing [200@induslab:3] Goto(“DAHDI/1-1”, “loop”) in new stack
– Goto (induslab,200,1)
– Executing [200@induslab:1] GotoIf(“DAHDI/1-1”, “0?continue”) in new stack
– Executing [200@induslab:2] Wait(“DAHDI/1-1”, “1”) in new stack
– Executing [200@induslab:3] Goto(“DAHDI/1-1”, “loop”) in new stack
– Goto (induslab,200,1)
– Executing [200@induslab:1] GotoIf(“DAHDI/1-1”, “0?continue”) in new stack
– Executing [200@induslab:2] Wait(“DAHDI/1-1”, “1”) in new stack
– Executing [200@induslab:3] Goto(“DAHDI/1-1”, “loop”) in new stack
– Goto (induslab,200,1)
– Executing [200@induslab:1] GotoIf(“DAHDI/1-1”, “0?continue”) in new stack
– Executing [200@induslab:2] Wait(“DAHDI/1-1”, “1”) in new stack
– Executing [200@induslab:3] Goto(“DAHDI/1-1”, “loop”) in new stack
– Goto (induslab,200,1)
– Executing [200@induslab:1] GotoIf(“DAHDI/1-1”, “0?continue”) in new stack
– Executing [200@induslab:2] Wait(“DAHDI/1-1”, “1”) in new stack
– Executing [200@induslab:3] Goto(“DAHDI/1-1”, “loop”) in new stack
– Goto (induslab,200,1)
– Executing [200@induslab:1] GotoIf(“DAHDI/1-1”, “0?continue”) in new stack
– Executing [200@induslab:2] Wait(“DAHDI/1-1”, “1”) in new stack
– Executing [200@induslab:3] Goto(“DAHDI/1-1”, “loop”) in new stack
– Goto (induslab,200,1)
– Executing [200@induslab:1] GotoIf(“DAHDI/1-1”, “0?continue”) in new stack
– Executing [200@induslab:2] Wait(“DAHDI/1-1”, “1”) in new stack
– Executing [200@induslab:3] Goto(“DAHDI/1-1”, “loop”) in new stack
– Goto (induslab,200,1)
– Executing [200@induslab:1] GotoIf(“DAHDI/1-1”, “0?continue”) in new stack
– Executing [200@induslab:2] Wait(“DAHDI/1-1”, “1”) in new stack
– Executing [200@induslab:3] Goto(“DAHDI/1-1”, “loop”) in new stack
– Goto (induslab,200,1)
– Executing [200@induslab:1] GotoIf(“DAHDI/1-1”, “0?continue”) in new stack
– Executing [200@induslab:2] Wait(“DAHDI/1-1”, “1”) in new stack
– Executing [200@induslab:3] Goto(“DAHDI/1-1”, “loop”) in new stack
– Goto (induslab,200,1)
– Executing [200@induslab:1] GotoIf(“DAHDI/1-1”, “0?continue”) in new stack
– Executing [200@induslab:2] Wait(“DAHDI/1-1”, “1”) in new stack

*CLI>
*CLI>
*CLI> – Executing [200@induslab:3] Goto(“DAHDI/1-1”, “loop”) in new stack
– Goto (induslab,200,1)
– Executing [200@induslab:1] GotoIf(“DAHDI/1-1”, “0?continue”) in new stack
– Executing [200@induslab:2] Wait(“DAHDI/1-1”, “1”) in new stack

I misinterpreted your question and my suggestion isn’t correct. What you do is using a call file to make an outbound phonecall. If Asterisk calls to a pbx, like Asterisk, the dialplan continues after the pbx picked up the line and starts routing the call to the proper internal phone. The ringing of the phone is an internal thing of the called party happening while your dialplan continues and start playing the message.

When calling a mobile or a direct landline without a pbx in between your routine should work ok.

You can handle this by adding a short message like “please press a key to hear an important message of …” and hold the dialplan in a loop until the key is pressed or a certain time has passed. As far as I know you can not solve your problem with Asterisk features.

My advice is to check your callfile

Channel: DAHDI/01/00923001000100
Callerid: abc
MaxRetries: 10
RetryTime: 5
WaitTime: 20
Context: abcde
Extension: 500

MaxRetries: Number of retries before failing (not including the initial attempt, e.g. 0 = total of 1 attempt to make the call). Default is 0.

RetryTime: Seconds between retries, don’t hammer an unavailable phone. Default is 300 (5 min)

WaitTime: Seconds to wait for an answer. Default is 45.

for more info see voip-info.org/tiki-index.php … o-dial+out

Sorry for wasting some of your time.