Script for simple boss secretary feature

Applicable Device

Device Model: S series

Firmware Version:



Only the secretary can make a call or consult transfer a call to boss

All calls to the boss will be redirected to secretary



In the code example, boss extension number is 4000, secretary extension number is 4002


exten = s,1,Set(IsFromOutside=0)
exten = s,n,Set(PBXDIALNUM=${ARG1})
exten = s,n,Gosub(check_boss_internal_calls,boss,1)
exten = s,n,Gotoif($[${LEN(${FromSystemAlert})}>0]?sys-dial,1)
exten = s,n,Gotoif($[${LEN(${BCBTYPE})}>0]?set:noset)
exten = s,n(set),Set(CALLERID(num)=${SRCEXTENSION})
exten = s,n,Set(CALLERID(name)=${SRCEXTENSION})
exten = s,n(noset),Set(CHECKCALLERNUM=${CALLERID(num)})
exten = s,n,ExecIf($[x${TYPE_OF_EXTEN${CALLERID(num)}}=xFXS]?Set(FAXOPT(gateway)=${IF($[${LEN(${T38SUPPORT_OF_EXTEN${PBXDIALNUM}})}>0]?${T38SUPPORT_OF_EXTEN${PBXDIALNUM}}:no)}):Noop(Not set faxopt))
exten = s,n,Set(TMPDIALOPT=${IF($[x${BUSYCP_CONTROL}=x${PBXDIALNUM}]?${DIALOPTIONS}A(record/ls_builtin_busy_camp_on_connected):${DIALOPTIONS})})
exten = sys-dial,1,Set(CHECKCALLERNUM=${CALLERID(num)})
exten = sys-dial,2,Macro(sysdial,${DIALPARAM_OF_EXTEN${PBXDIALNUM}},${RINGTIME},${DIALOPTIONS})

exten = boss,1,Noop(modify boss call destination)
exten = boss,n,Gosub(check_boss_incoming,check_incoming,1)
exten = boss,n,Return()

exten = check_incoming,1,Noop(check incoming call)
exten = check_incoming,n,ExecIf($[${PBXDIALNUM}!=4000]?Return())
exten = check_incoming,n,Set(REACHABLE=0)
exten = check_incoming,n,ExecIf($[(${CALLERID(num)}==4002)&(${PBXDIALNUM}==4000)]?Set(REACHABLE=1))
exten = check_incoming,n,ExecIf($[${REACHABLE}<1]?Set(PBXDIALNUM=4002))
exten = check_incoming,n,Return()

Have more questions? Submit a request


  • 1

    This is an inadequate solution. There are requests for use especially in government institutions and it is a specification item. Therefore, this should not be considered as a feature, but as a configuration requirement and should be added to the menus.
    1- More than one secretary should be able to be appointed to a manager.
    2- A secretary can have more than one manager.
    3- The secretary should be able to make and cancel call forward when necessary.
    4- Managers should be able to be grouped so that they can call each other. Managers who are assigned the same level of authority should call each other, those with a high level of authority should call the lower one, and those with a low level of authority should not call the higher one.

    As a result, it will be more successful if these functions are provided.

    Thank you for your co-operation

    Edited by Devrim DAGBAKAN
Please sign in to leave a comment.