This one took me a little by surprise recently.
I was working with a HP SBA/SBM for Lync, equipped with FXS and FXO ports.
I’d setup the Trunk Configuration for outgoing FXO calls to strip the Country Code and insert a 0 (as is pretty standard in Oz), and once that was working OK I turned to the FXS. Despite my best efforts, I found I couldn’t get a call to ring the phone. Every call I sent to the gateway (whether intended for the PSTN or the FXS ports) was being spat out the FXO ports!
Turns out that whilst I’d set the SBM’s FXS ports to be “+61<blah>” – the same number that I’d set in new-csAnalogDevice (as per my earlier post on the subject) – by the time the call reached the Gateway it was back in 10-digit Aussie “Full National Number” format (02-12345678) and destined for the PSTN.
Fair enough I s’pose. After all, if you look again at your Topology, the analog extension Gateway *is* after all a “PSTN Gateway” and as such you’d presume the trunk configuration rules will apply to it regardless of its use:
Simple to fix – just amend the SBM to trap the local number and all was a source of joy.