0

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})
jose_bacoy
  • 12,227
  • 1
  • 20
  • 38

1 Answers1

0

First of all it is not only issue you will get in attempt of writing your own dialling core. It is HIGHLY recommended use already written core/some opensource project.

This exact issue can be fixed by using Local/ channel and call via dialplan. That way you will get feedback on dialplan and can check DIALSTATUS variable after end of call.

https://wiki.asterisk.org/wiki/display/AST/Local+Channel

arheops
  • 15,544
  • 1
  • 21
  • 27