I have several locations that want to be able to dial zero and have the call directed to the front office of the location zero is dialed from. Each location has its own caller ID so that way I can find a way to route the call to the correct Operator.
I am planning on creating ring groups for each location but then add a macro that essentially checks that if someone dials zero (0) and the caller ID is matched then the call is directed to a particular ring group.
This is what I have thought of but does not work. I am not experience I am adding this to the extensions_custom.conf file:
[macro-Operator]
;;User dialing zero is redirected to Operator A
exten => s,1,GotoIf($["${OUTNUM}"=â0â & â${CALLERID(number)}â=âXXXXXXXXXXâ]?2:4)
exten => s,2,Dial(âLocal/7151@from-internalâ)
exten => s,3,MacroExit()
;;User dialing zero is redirected to Operator B
exten => s,4,GotoIf($["${OUTNUM}"=â0â & â${CALLERID(number)}â=âYYYYYYYYYYâ]?5)
exten => s,5,Dial(SIP/7152)
exten => s,6,MacroExit()
Currently I dial zero but nothing happens. Is this possible? Any help or pointers are appreciated. Thank you.
Thank you that makes sense and it now the macro is being called correctly but I need to work on the macro. Now anyone regardless of the caller ID rings the ring group.
It completely skips the first line of the macro.
[2018-10-10 17:13:07] VERBOSE[55696][C-000071e1] pbx.c: Spawn extension (macro-FrontOffice, s, 2) exited non-zero on âSIP/3063-0000cc38â
[2018-10-10 17:13:22] VERBOSE[56838][C-000071e3] pbx.c: Executing [0@from-internal:2] Goto(âSIP/3063-0000cc3aâ, âmacro-FrontOffice,s,1â) in new stack
[2018-10-10 17:13:22] VERBOSE[56838][C-000071e3] pbx_builtins.c: Goto (macro-FrontOffice,s,1)
[2018-10-10 17:13:22] VERBOSE[56838][C-000071e3] pbx.c: Executing [s@macro-FrontOffice:1] GotoIf(âSIP/3063-0000cc3aâ, â0?2â) in new stack
[2018-10-10 17:13:22] VERBOSE[56838][C-000071e3] pbx.c: Executing [s@macro-FrontOffice:2] Dial(âSIP/3063-0000cc3aâ, ââLocal/3065@from-internalââ) in new stack
@dicko sorry I had change the name of the macro. I am not sure I understand the question how does anyone ever dial 0?.
The idea of what I am trying to accomplish is someone in a building dials 0 and the call is directed to the front office in that building. e.g I am in building A and dial 0 and my call is directed to the front office in building A, if I am in building B and dial 0 the call goes to the front office in building B
Thank you for your comments.
[2018-10-11 12:34:31] VERBOSE[95548][C-00007cb8] pbx.c: Executing [0@from-internal:2] Goto("SIP/3063-0000e004", "macro-FrontOffice,s,1") in new stack
[2018-10-11 12:34:31] VERBOSE[95548][C-00007cb8] pbx_builtins.c: Goto (macro-FrontOffice,s,1)
[2018-10-11 12:34:31] VERBOSE[95548][C-00007cb8] pbx.c: Executing [s@macro-FrontOffice:1] GotoIf("SIP/3063-0000e004", "0?2:4") in new stack
[2018-10-11 12:34:31] VERBOSE[95548][C-00007cb8] pbx_builtins.c: Goto (macro-FrontOffice,s,4)
[2018-10-11 12:34:31] VERBOSE[95548][C-00007cb8] pbx.c: Executing [s@macro-FrontOffice:4] GotoIf("SIP/3063-0000e004", "0?5") in new stack
[2018-10-11 12:34:31] VERBOSE[95548][C-00007cb8] pbx.c: Executing [s@macro-FrontOffice:5] Dial("SIP/3063-0000e004", ""Local/3063@from-internal"") in new stack
If I am understanding this correctly the condition is evaluating to false thus not doing what I want. I guess I need to figure out how to check who dials zero because my gotoIf is not working.
I thought that OUTNUM would give me the number dialed and CALLERID(number) would give me the Outbound CID
GotoIf($["${OUTNUM}"=â0â & â${CALLERID(number)}â=âXXXXXXXXXXâ]?2:4)
** From the Outbound route:
When extensions make outbound calls, the CallerID will be their extension number and NOT their Outbound CID. The above special matching sequences can be used for CallerID matching similar to other number matches.**