Where is configuration being stored? Are you using realtime? If so then Asterisk has to be told about the AOR using the “pjsip reload qualify aor” or “pjsip reload qualify endpoint” CLI commands, which can be done over AMI. Trying to do this automatically proved to be disastrous to performance.