Do we run the dialplan in callfiles if the peer dont answer?

Hello,
Do you know we can run dialplan in callfiles if peers dont asnwer the call? We know the context dialplan runs if the peers answer the the call, But what about if the peers dont answer the call or when the peers is busy?
With Regards.Mespio

Use local channels to handle the Call.

dear navaismo,
Thank you for replying
But if Local channel i have the same issue,
Suppose you want run php agi script if the callee don’t asnwer the call, How can we found it in local channels without refer to CDR tables or? (We need a way to found it and set some fields in our tables).
suppose this example:

in callfile :
Channel: Local/123@devices
MaxRetries: 3
RetryTime: 60
WaitTime: 60
Archive: yes
Context: our-context
Set: EXT= 88834643

and our dialplan in extensions.conf
[our-context]
exten => _X.,1,NoOp()
same => n,Playback(soundfile)
same => n,Hangup()

[devices]
exten => 123,1,NoOp()
same => n,Do somethings
same => n,Dial(SIP/Trunk0/${EXT},60)
same => n,Verbose(the callee do’nt answer the call, Update some fields in DB)
same => n,Hnagup()

Now: if the callee answer the call, th callee route to [our-context] and playback app is run, and if the callee don’t answer the call, the next priority app is run in [devices] context and then hangup.Is it true?

If the callee doesn’t answer the dialplan will continue with the next “priority” after Dial.

And use DIALSTATUS.

I test this scenario, But if the callee dont answer, the next priority not run,
here is my code:
in callfile:
Channel: Local/123@itel-cdr-local
RetryTime: 60
WaitTime: 20
Archive: yes
Context: itel-cdr-api
Extension: 88876543
Priority: 1
Set: AUDIOFILE=/var/www/html/itel/filesaudio/audiofiles

In extensions.conf:
[itel-cdr-api]
exten => _X.,1,NoOp(Call from WebService)
; same => n,Set(CDR(accountcode)=${TASKID})
; same => n,Verbose(I need some more ${CDR(accountcode)})
same => n,Playback(${AUDIOFILE})
same => n,Hangup()

[itel-cdr-local]
exten => 123,1,NoOp(Here is Local callfile)
same => n,Dial(SIP/trunk0/88876543,20)
same => n,Verbose(the callee not answer)
same => n,Verbose(dialstatus: ${DIALSTATUS})
same => n,Hangup()

Here the log file in asterisk cli:

– Attempting call on Local/123@itel-cdr-local for 88876543@itel-cdr-api:1 (Retry 1)
– Executing [123@itel-cdr-local:1] NoOp(“Local/123@itel-cdr-local-00000056;2”, “Here is Local callfile”) in new stack
– Executing [123@itel-cdr-local:2] Dial(“Local/123@itel-cdr-local-00000056;2”, “SIP/trunk0/88876543,20”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/trunk0/88876543
– SIP/trunk0-000002f7 is ringing
== Spawn extension (itel-cdr-local, 123, 2) exited non-zero on ‘Local/123@itel-cdr-local-00000056;2’
– Remote UNIX connection
– Remote UNIX connection disconnected

Try increasing WaitTime in your call file and see.
Alternatively you can use a special extension ‘failed’ in Context (itel-cdr-api, in your case) to catch the unanswered calls.

–Satish Barot
satish4asterisk@gmail.com

Thank you for replying.
I tested the both way and answerd. I thinks the Asterisk standard extension (failed) is beter.
Thanks. with regards.Mespio