Yuk - I just worked out how this works.  send_register_to_as has code to get the AoR from the received_register if it is specified.

I definitely think this is worth cleaning up as I suggested above.  Define the interface to this method so the AoR must always be specified.  The code will be simpler, easier to understand, and less fragile as a result.