This gives me the functionality i want: [ext-did] include => ext-did-custom exten => s,1,Set(FROM_DID=s) exten => s,2,Set(Var_TO=${SIP_HEADER(TO)}) exten => s,3,GotoIf($${Var_TO}" = "?ext-local,81,1) exten => s,n,Goto(ext-local,77,1) exten => _X.,1,Noop(Catch-All DID Match - Found ${EXTEN} - You probably want a DID for this.) exten => _X.,n,Goto(ext-did,s,1) This does not: [ext-did-custom] exten => s,1,Set(FROM_DID=s exten => s,2,Set(Var_TO=${SIP_HEADER(TO)}) exten => s,3,GotoIf($${Var_TO}" = "?ext-local,81,1) [ext-did] include => ext-did-custom exten => s,1,Set(FROM_DID=s) exten => s,n,Goto(ext-local,77,1) exten => _X.,1,Noop(Catch-All DID Match - Found ${EXTEN} - You probably want a DID for this.) exten => _X.,n,Goto(ext-did,s,1)