Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
; Customization: Add a trunk predial hook to examine the outbound caller ID number and set the
;   outbound caller ID name based on the number (a workaround for a foreign PBX that cannot set the caller ID name string)
[macro-dialout-trunk-predial-hook]
; for debugging, add log output to show outgoing caller ID information before any changes are made
(remove; comments to enable)
;; note: don't comment out the first line without modifying the new actual first line of code to be sequence number 1
exten => s,1,NoOp(CUSTOM: calleridall is ${CALLERID(all)})
;;exten => s,n,NoOp(CUSTOM: calleridnumber is ${CALLERID(number)})
; test number case for debugging: override outgoing caller name and caller ID number for calls set to have the outgoing caller ID number to 555-555-1212 (remove comments to enable)
;;exten => s,n,ExecIf($["${CALLERID(number)}" = "+15555551212"]?NoOp(CUSTOM: Setting Caller ID override for source ${CALLERID(number)}))
;;exten => s,n,ExecIf($["${CALLERID(number)}" = "+15555551212"]?Set(CALLERID(all)="Test Number" <5555551212>))
; branch office location 1: override outgoing caller name and caller ID number for calls set to have the outgoing caller ID number to 519-123-4567
exten => s,n,ExecIf($["${CALLERID(number)}" = "+15191234567"]?NoOp(CUSTOM: Setting Caller ID override for source ${CALLERID(number)}))
exten => s,n,ExecIf($["${CALLERID(number)}" = "+15191234567"]?Set(CALLERID(all)="Branch Office" <5191234567>))
; default case for the main office: override outgoing caller name and caller ID number for calls set to have the outgoing caller ID number to nothing to be the main office caller ID name and number
exten => s,n,ExecIf($["${CALLERID(number)}" = ""]?Set(CALLERID(all)="Main Office" <5192345678>))
; exit back
exten => s,n,MacroExit()

...

For the changes to take effect, the FreePBX configuration needs to be reloaded by submitting any configuration page in the Web GUI and clicking "Apply Config" or using the "amportal a r" command line command.