Digium GUI extensions.conf CallerID overwrites

I configured Asterisk with digium GUI-version 2.1.0-rc1 running on Synology DS413/DSM 5.0 and wondered why outbound calls do not show any CallerID information.

Some tracing and debugging revealed that “macro-trunkdial-failover-0.3” in extensions.conf overwrites settings for CALLERID(num) and CALLERID(all) taken from user.conf with blanks (if functions with empty else statement marked in red).

Here is the code snipplet:

[size=85]exten = s,n,Set(CALLERID(num)=${[color=#BF0040]IF($[${LEN(${CID_${CALLERID(num)}})} > 2]?${CID_${CALLERID(num)}}:[/color])})
exten = s,n,Set(CALLERID(all)=${[color=#BF0040]IF($[${LEN(${ARG5})} > 2]?${ARG5}:)[/color]})
exten = s,n,GotoIf($[${LEN(${CALLERID(num)})} > 6]?1-dial,1)
exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${CID_${ARG3}})} > 6]?${CID_${ARG3}}:${GLOBAL_OUTBOUNDCID})})
exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${ARG5})} > 2]?${ARG5}:)})[/size]

I can edit this code in extensions.conf to make it work properly, but next time the GUI will be used, it will overwrite my edits with the auto-generated file like before.

My question: Is there any way to prevent the auto-generated file to contain this faulty code? Is there any kind of template that I might edit?

Any hint appreciated


Contact Synology for support; they made the decision to supply code for which support ended several years ago, so they should take on the support responsibility.

Hi Ralf,

facing the same issue, I wonder, did you get anywhere with Synology support?


The issue is not so much a Synology issue as it has an Asterisk ticket: issues.asterisk.org/jira/browse/AGUI-302

This one should get you going for (now at least). The next package update will overwrite this file (most likely). So keep it in a safe place


It’s a Synology problem because they chose to use unsupported, end of life, software, so they took on support responsibility.

I got an similar issue with:

this code will deleted every time I’m logging in the gui.
gui was downloaded from:

Is there any posibility to fix this?

the tempalte can be found in: js/pbx.js about at line 100:

check_For_Contexts[ 'macro-' + ASTGUI.contexts.dialtrunks ] = [                                                          
 // "; Macro by =  Brandon Kruse, Matthew O'Gorman 
// & Erin Spiceland <espiceland@digium.com>",                    
 'exten=s,1,GotoIf($[${LEN(${FMCIDNUM})} > 6]?1-fmsetcid,1)',                                                                                                                        
 'exten=s,n,SipAddHeader(P-Preferred-Identity: sip:${IF($[${LEN(${CID_${CALLERID(num)}})} > 2]?${CID_${CALLERID(nu
 'exten=s,n,GotoIf($[${LEN(${GLOBAL_OUTBOUNDCIDNAME})} >1]?1 setgbobname,1)',                                    
 'exten=s,n,Set(CALLERID(num)=${IF($[${LEN(${CID_${CALLERID(num)}})} > 2]?${CID_${CALLERID(num)}}:)})',           
 'exten=s,n,Set(CALLERID(all)=${IF($[${LEN(${ARG5})} > 2]?${ARG5}:)})',                                           
 'exten=s,n,GotoIf($[${LEN(${CALLERID(num)})} > 6]?1-dial,1)',                                                    
   'exten=s,n,Set(CALLERID(all)=${IF($[${LEN(${CID_${ARG3}})} > 6]?${CID_${ARG3}}:${GLOBAL_OUTBOUNDCID})})',        
 'exten=s,n,Set(CALLERID(all)=${IF($[${LEN(${ARG5})} > 2]?${ARG5}:)})',                                           
'exten=1-dial,n,Gotoif(${LEN(${ARG2})} > 0 ?1-${DIALSTATUS},1:1-out,1)',                                         

Its annoying that Synology won’t update their package to something reasonably recent (or clean out the insane amount of junk code in the configs), but I’ve found that this can be worked around by setting the CallerID fields in the Outgoing Calling Rules settings.