A possible rethink, any call that traverses an inbound route will have the FROM_DID
channel variable set with the dialed number. Local calls won’t have this, so an expression like this
${ISNULL(${FROM_DID})}
should evaluate to either a 0 (the variable is null so local) or a 1 (the variable is populated therefore a trunk call). You would then create match entries for 0 and 1 like in this example.