Different behavior between incoming internal & external call

Hi everyone,

I’m new to asterisk and looking for a way to implement below behavior.

Incoming external calls (routed directly to extension):

  • If the calls are not answered within 26 sec or busy, it will be forward to operator.
  • If operator is not available, user will hear announcement

Calls between internal extensions:

  • If the calls are not answered within 26 sec or busy, it will be hangup.

Thanks for your advise.
Louis

Asterisk generally does what you tell it to do in this regard, and what you want can be accomplished.

Maybe something like this…

[incoming]
exten => _X.,1,Dial(SIP/${NumberToDial},26)
same => n,GotoIf($["${DIALSTATUS}" = “BUSY”]?numberbusy)
same => n,Hangup()
same => n(numberbusy),Dial(SIP/${OperatorsNumber},26)
same => n,GotoIf($["${DIALSTATUS}" = “BUSY”]?operatorbusy)
same => n,Hangup()
same => n(operatorbusy),Playback(announcement)
same => n,Hangup()

[internal]
exten => _X.,1,Dial(SIP/${EXTEN},26)
same => n,GotoIf($["${DIALSTATUS}" = “BUSY”]?hangup)
same => n(hangup),Hangup()

There are several other DIALSTATUSes you’ll want to account for. See “core show application Dial”.