extensions_custom only add header when calling numbers with specific prefix

I’m using [macro-dialout-trunk-predial-hook] in extenstions_custom.conf to add a diversion header to all outgoing calls. But for some reason the calls fail when calling a specific number. All other outgoing calls work with the header, except for this specific number

Can I somehow tell the asterisk to not add the header when this specific number is being called?

This works:

[macro-dialout-trunk-predial-hook]
exten => s,1,Gotoif($["${OUTNUM}" = “0000000000”]?skip)
exten => s,n,SIPAddHeader(Diversion:”1111111111”sip:[email protected];privacy=off;reason=unconditional;counter=1)
exten => s,n(skip),MacroExit()

Is it possible to use this rule if a number begins with some specific digits? Something like this:
exten => s,1,Gotoif($["${OUTNUM}" = “0000000XXX”]?skip)

[quote=“fralla, post:2, topic:24539”]Is it possible to use this rule if a number begins with some specific digits? Something like this:
exten => s,1,Gotoif($["${OUTNUM}" = “0000000XXX”]?skip)
[/quote]

You can have multiple conditions between the brackets:

exten => s,1,Gotoif($["${OUTNUM:0:7}" = "0000000" & "${LEN(${OUTNUM})}" = "10" ]?skip)

The elegant way to do this is with a regular expression, tho admittedly much more complicated, the regex needs editing and testing:

exten => s,1,set(regexp=^0000000[0-9]{3}$)  ; NOT TESTED!
exten => s,n,set(foo=${REGEX("${regexp}" ${OUTNUM})})
exten => s,n,GotoIf($[${foo} = 1]?skip)