We connect this server with other Asterisk boxes we own. For this reason, none of the “trunks” use username and password authentication, just IP-based authentication. Everything works great except when using Asterisk call files. Whenever we try, Asterisk complains that there is no authentication ID available.
When trying to make calls directly to the external server, everything works fine as expected. The same occurs with incoming calls. I’ve even tried the “channel originate” command from the CLI, and it worked like a charm!
For reference, I’m attaching the call file I used to test, as well as the debug that shows the error. As you will see, there are errors about a 403 response, but the destination server (MAC02) never gets contacted, at least the logs on MAC02 don’t say anything about it! Yet, the “trunk” on MAC02 uses IP-based authentication too, so I can’t figure out what is going on!
But why would the remote server challenge for authentication only when using call files? In other cases, everything works fine! I must be missing something… BTW, here’s the “trunk” configured on MAC02. It still uses chan_sip and wasn’t configured by me, unfortunately.
You could compare the working INVITE and non-working INVITE and see the difference, and then deduce based on that, or look at the remote side and its own logging for chan_sip and see. It could be matching another entry in sip.conf for matching which requests auth.
There is no secret, so there will be no challenge for a match on that entry, and insecure=invite has no effect at all. As such it must be matching something else.
With chan_sip, for that entry to match, either the user part of the From header URI must be MAC02, or the IP level source address must be 216.xxx.xxx.xxx AND the user part of the From header URI must not match the section name of any other type=user or type=friend entry. Obviously, you also shouldn’t have more than one entry with host=216.xxx.xxx.xxx.
That remote machine isn’t directly under my responsibility, so I didn’t see that, indeed, there was an entry “101112” in sip.conf that required authentication. Changing the “callerid” parameter in the call file caused the call to successfully go through.