RonR,
I understand what you are saying, but just so we are on the same page with respect to the actual behaviour, perhaps you can try this experiment:
Create a rule in your OutboundCallRoute that maps a test phone # to say, sp2. Something like
{XXXXXXX:sp2}
where XXXXXXX is your test number.
Now, create a trunk group (say trunk group 2) that has just sp2 in it's list (a rather boring trunk group, but to illustrate the point).
Finally, amend the digitMap for sp2 so that it blocks your test #.
(!XXXXXXX|[whatever else was here])
OK, now you can test what happens when you dial your test number when the OutgoingCallRoute clause is set to
{XXXXXXX:sp2}
as compared to
{XXXXXXX:tg2}
What you will see is that in the first example, the call is accepted by sp2 (the sp2 digitMap blocking of the call is ignored), but in the second instance, the digitMap of sp2 blocks the call.
Leaving aside for one moment the question of whether this inconsistency in behaviour of how and when to treat the sp2 digitMap is a bug or a feature, it does suggest (at least to me) that the processing of the routing is more dynamic than a single stage macro expansion, as you are suggesting above.
Having said that, if indeed the the result of trunk group "hunt" _was_ evaluated as a part of a one-shot macro expansion, as you are suggesting, it would strike me as a rather odd design decision to do it that way.
It would be odd because it would be unduly limiting to how the "hunt" could be conducted -- only information at hand on the availability of service on each port at one point in time could be used, which is at odds with the essential time sequential nature of the search.
Dynamic processing, more in the style of an interpreter, rather than in the static style of a macro processor, would be much more natural, and extensible. For example, using a dynamic processing model, it would be possible to do "deep" trunk group hunting (which is actually one of my fond hopes for the future as requested in the Feature Requests subforum
http://www.obitalk.com/forum/index.php?topic=420.0), whereas using a static macro expansion model, it wouldn't.
But, odd or not, I suppose it is possible.
Perhaps an OBi engineer can chime in to clarify the nature of these deep philosophical questions. :-)