Inbound routing issue after upgrading from asterisk 1.6.0.9 to 1.6.1.0

Did the upgrade and (since I’m paranoid), tried calling my voip number. Got a message about “not in service”. Checked the log and saw that it was getting the old gripe about a call from an unknown peer. I can work around that by enabling anonymous calls, but that circumvents the custom context I had that does various special tweaks before injecting the call back into the freepbx-generated dialplan code. I backed out to 1.6.0.9 and it works fine. I’m assuming it’s something in the SIP channel driver (either a bug, or something I was doing before that wasn’t quite right, and am now being spanked for.)

Turns out (based on info I saw online about user vs friend vs peer), my outbound and inbound contexts both had ‘type=peer’. Prior to 1.6.1.0, the channel name used was the username, which is unchanged in my config, so it worked. Subsequent to this, it used the peername, which would have been okay, except for the different peername in the outbound context being found first (and not knowing what to do with it). Not 100% sure this is right, but I changed the outbound to ‘type=user’ and it works now. Hmph…