Call Foward Context

Hello I have this in extensions_custom.conf. This allows my receptionist pushes a blf key to set the oncall tech. Everything works great excepts to call forwarding. When the blf is pressed the light turns red and the others are green, An email is sent off, and an announcement is made to the receptionist. This all works. I have the oncall extension at 1200. This should set the call forwarding of 1200 to the extension of the actual tech tech.

What am i missing so that the call forwarding can get set?

[from-internal-custom]
include => custom-601
include => custom-602
include => custom-603
include => custom-604

[custom-601]
;dial 601 to call forward ext 1200 to tech1
;sends email to tech informing that they are the on call tech
exten => 601,1,TrySystem(echo “Tech1 is currently the on call tech. Please reach out to Alicia if this is a mistake.” | mail -s ‘On Call tech’ [email protected])
exten => 601,hint,Custom:ONCALL601
exten => 601,1,Set(DB(CF/1200)=1010)
;set blf
exten => 601,n,Set(DEVICE_STATE(Custom:ONCALL602)=NOT_INUSE)
exten => 601,n,Set(DEVICE_STATE(Custom:ONCALL603)=NOT_INUSE)
exten => 601,n,Set(DEVICE_STATE(Custom:ONCALL604)=NOT_INUSE)
exten => 601,n,Set(DEVICE_STATE(Custom:ONCALL601)=INUSE)
;playback forwarding number
exten => 601,n,Playback(call-forward&has-been-set-to)
exten => 601,n,SayDigits(1010)
exten => 601,n,Hangup()

[custom-602]
;dial 602 to call forward ext 1200 to tech2
;sends email to tech informing that they are the on call tech
exten => 602,1,TrySystem(echo “Tech2 is currently the on call tech. Please reach out to Alicia if this is a mistake.” | mail -s ‘On Call tech’ [email protected])

exten => 602,hint,Custom:ONCALL602
exten => 602,1,Set(DB(CF/1200)=1011)
;set blf
exten => 602,n,Set(DEVICE_STATE(Custom:ONCALL601)=NOT_INUSE)
exten => 602,n,Set(DEVICE_STATE(Custom:ONCALL603)=NOT_INUSE)
exten => 602,n,Set(DEVICE_STATE(Custom:ONCALL604)=NOT_INUSE)
exten => 602,n,Set(DEVICE_STATE(Custom:ONCALL602)=INUSE)
;playback forwarding number
exten => 602,n,Playback(call-forward&has-been-set-to)
exten => 602,n,SayDigits(1011)
exten => 602,n,Hangup()

[custom-603]
;dial 603 to call forward ext 1200 to tech3
;sends email to tech informing that they are the on call tech
exten => 603,1,TrySystem(echo “Tech3 is currently the on call tech. Please reach out to Alicia if this is a mistake.” | mail -s ‘On Call tech’ [email protected])

exten => 603,hint,Custom:ONCALL603
exten => 603,1,Set(DB(CF/1200)=1015)
;set blf

exten => 603,n,Set(DEVICE_STATE(Custom:ONCALL601)=NOT_INUSE)
exten => 603,n,Set(DEVICE_STATE(Custom:ONCALL602)=NOT_INUSE)
exten => 603,n,Set(DEVICE_STATE(Custom:ONCALL604)=NOT_INUSE)
exten => 603,n,Set(DEVICE_STATE(Custom:ONCALL603)=INUSE)
;playback forwarding number
exten => 603,n,Playback(call-forward&has-been-set-to)
exten => 603,n,SayDigits(1015)
exten => 603,n,Hangup()

[custom-604]
;dial 604 to call forward ext 1200 to tech4
;sends email to tech informing that they are the on call tech
exten => 604,1,TrySystem(echo “tech4 is currently the on call tech. Please reach out to Alicia if this is a mistake.” | mail -s ‘On Call tech’ [email protected])

exten => 604,hint,Custom:ONCALL604
exten => 604,1,Set(DB(CF/1200)=1013)
;set blf
exten => 604,n,Set(DEVICE_STATE(Custom:ONCALL601)=NOT_INUSE)
exten => 604,n,Set(DEVICE_STATE(Custom:ONCALL602)=NOT_INUSE)
exten => 604,n,Set(DEVICE_STATE(Custom:ONCALL603)=NOT_INUSE)
exten => 604,n,Set(DEVICE_STATE(Custom:ONCALL604)=INUSE)
;playback forwarding number
exten => 604,n,Playback(call-forward&has-been-set-to)
exten => 604,n,SayDigits(1013)
exten => 604,n,Hangup()

exten => h,n,Hangup()

1 Like

Maybe Asterisk needs a reload for it to start working.

Anyway, if I would be you, I’d rather implement a Queue and make use of the login/logoff features. There’s already built in support for BLF agent login monitoring, and if you want email alerts you can still use custom context to cover that.

I found my mistake.
I had put exten => 601,1,Set(DB(CF/1200)=1010)
when it should be exten => 601,2,Set(DB(CF/1200)=1010)

Similar to this project https://gist.github.com/lgaetz/543da144d051a353ca0fab93b7f34cf2

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