Fix parsing of the SIP URI in db_get_auth_id() .

Closes #340.

(cherry picked from commit 465a978b812a1eae6a219e26f9a55d1d985a176b)