Having some issues with Dialplan

Dial Plan:

[context]
exten => s,1,Answer
exten => s,2,Set(CALLFILENAME=radcontest-${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)},g)
exten => s,3,Monitor(wav,${CALLFILENAME},m)
exten => s,4,Wait(1)
exten => s,5,Playback(/var/lib/asterisk/sounds/scammer,skip)
exten => s,6,Hangup()

callfile.call:

Channel: SIP/1111111@Flowroute
CallerID: 111111111
MaxRetries: 2
RetryTime: 3
Context: radcontest
Extension: s
Priority: 1

Issues:

1.) The audio file plays even if the call is still ringing. How can I make it play when the line actually picks up?
2.) When dialing the callfile.call how can I make it include specific extension? Like automatically make it dial 1 on each call

Don’t answer the call, only when SIP/111111111 answers the call will it then go to your context

exten => s,1,noop( if I Answer , it goes to the next priority)

(You need to fix your typos [context] should be [radcontest] )

1 Like

noop? i tried that. Still same issue. The context/radcontest is not relevant.

That’s a bold statement. I’m pretty sure your assumption on that needs some backup. The callfile you posted specifically uses the radcontest context, so if your changes aren’t getting picked up, the context isn’t being included.

Take a look at your call in the /var/log/asterisk/full log file to see what contexts are actually being used in your call.

1 Like

NoOp does not interact with the call treatment, it can be used as a marker to more easily ensure you are hitting the areas of your dial plan you are expecting.

you can use the set command to add variables to your channel. Then call these variables in your treatment.
http://the-asterisk-book.com/1.6/call-file.html

(You should probably add a loop counter to give up eventually)

exten => s,1,Answer()
exten => s,n(gotoif),Gotoif($[ “${DIALSTATUS}” : “NOANSWER”]?wait:continue)
exten => s,n(wait),Wait(1)
exten => s,n,Goto(gotoif)
exten => s,n(continue),Playback(/var/lib/asterisk/sounds/scammer,skip)
exten => s,n,Hangup()

Another option is to maybe implement AMD, but just not use the result.

exten => s,n,AMD

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