I am using call files such as these:
Channel: SIP/TRUNK/1-111522282783163<br/>
CallerID: 522299308962<br/>
MaxRetries: 1<br/>
Data: GqFR7rubPw_10<br/>
Context: calls<br/>
Extension: s<br/>
Priority: 1 <br/>
Setvar: AUDIOFILE=GqFR7rubPw_10<br/>
Setvar: ID=BkzKlksau1<br/>
Setvar: DEST=522282783163<br/>
Archive: yes<br/>
As I already know, when the call is answered the dialplan (in the context) is executed but not with the calls that are "NO ANSWER, CONGESTION, BUSY, FAILED". What I want to do is execute a dialplan (in the same context or default context) when a Call is in the status that are not ANSWERED because I add an ID as variable in the call files which I use to identify the call.
I found this link Asterisk - executing agi script if call is not answerd? But I don't understand to be honest with you. If someone has an example of this I will appreciate it.
Dial Plan:
[calls]
exten => s,1,wait(2)
exten => s,n,Set(CDR(outbound_cnum)=${DEST})
exten => s,n,Set(CDR(userfield)=${ID})
exten => s,n,Playback(${AUDIOFILE})