I am trying the below but finding that the first line in the macro is no longer being activated.
WHat happens with the A2B is that a trunk is setup that has a custom dial string of A2B/ and a number at the end which corresponds with the conf file in the billing. Normal setup is
[macro-dialout-trunk-predial-hook]
exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = “A2B/”]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten => s,2,MacroExit
This works fine, I can see the macro running and the custom-freepbx line in the logs. If a call goes through a trunk with A2B defined it passes it through the billing.
The numbers I am trying to match are in their own emergency outbound route using a trunk that does not go near the billing so I would have thought the below would have worked as I assume that with 1:2 a the end means it jumps to 2 if it can’t find A2B/
This doesnt seem to be the case. When running the below it exist the macro without doing anything, it doesn’t run the first line.
[macro-dialout-predial-hook]
exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = “A2B/”]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten => s,2,GotoIf($["${OUTNUM}" = “123”]?email:)
exten => s,3,GotoIf($["${OUTNUM}" = “9123”]?email:)
exten => s,4,GotoIf($["${OUTNUM}" = “999”]?email:)
exten => s,5,GotoIf($["${OUTNUM}" = “9999”]?email:noemail)
exten => s,6(email),System(/scripts/notifyemail.sh “${STRFTIME(,%c)}” “${CallerIDName}” “${AMPUSER}” “${OUTNUM}” ${EPOCH})
exten => s,7(noemail),MacroExit()