I am trying to register a peer (trust me, not my first). Here is what is happening:
I send a registration with the correct info, I see nothing pass in the CLI and the peer doesn’t register.
If I go in sip.conf and change the peer’s name (without changing it in my gateway), and I resend a registration, this time I see a failed registration attempt because No matching peer found.
I go back in sip.conf and re-enter the correct name that just failed, resend the registration, nothing happens.
I tried a tcpdump and I get a 401 not authorized.
Asterisk 1.4 is the equivalent of Windows 98… Why are you using it?
Changes are not “real time” so if you change a config file you have to reload asterisk.
What you are experiencing could very well be a bug. We are generations ahead of that code now.
Sorry it’s actually asterisk 1.8, but regardless the version I am using, I have over 10000 other peers running on 1.4 and 1.8 so the version is not the issue.
I know I have to reload the changes after they are done as well.
Problem 1 - this is a FreePBX forum. The fact that we all also use Asterisk is a cool coincidence.
You say this isn’t your first trunk, and then you write things that make me doubt that. If it wasn’t you’d have looked at Wikipedia and found this:
401 Unauthorized: The request requires user authentication. This response is issued by UASs and registrars
I doubt “nothing happens”. I suspect you are getting a different error that doesn’t show up in the CLI. Those are different things.
The problem with being succinct is that it leaves your statements open to interpretation.
You didn’t :“try”. You either successfully performed a tcpdump and got that back from the ITSP, or you didn’t successfully perform a tcpdump and got a ‘401’ from somewhere else.
So, if we assume you meant “I used tcpdump to watch the traffic and the registrar sent back a ‘401’ to my registration request,” one might naturally assume that your ITSP is telling you that your registration packet is not authorized because of either a username or password error. One could also assume from that that some other parameter in your registration or IP address is causing a problem.
If you google “Asterisk 401 error” you’ll get a lot of information about this particular “pseudo” error.
I noticed that you also failed to mention the error message that I’m certain is sitting in your /var/log/asterisk/full message log. There are also other places that could be causing you this specific grief, including (but not limited to) firewall rules, billing issues, companies going out of business, your gateway address quietly changed out from under you, etc.
Basically, for whatever reason, your ITSP and you are disagreeing about what your authentication should look like. I’d suggest calling them - stat with Billing and work your way forward to tech support. I think you two will find your disconnect.
Wow Dave thanks for the waste of time… If you didn’t understand that by “try a tcpdump” I actually did one, then you’re searching for problems where there are none…
If you think I didn’t google the issue first too then you’re wrong, again.
The /var/log/asterisk/full is the same as my CLI output which is why I didn’t mention it.
The username and password are perfectly identical, I am setting them on both ends, yet when I register no message appear in the CLI nor in the /var/log/asterisk/full.
when I DO a tcpdump, then I stop it, then I open the file with the packet captures from the tcpdump, I see the 401 not authorized message (hopefully I was precise enough of the steps taken).
If I head back in sip.conf, change 1 letter in the peer name and the reload asterisk, when I resend the registration request I then see in the CLI output that the registration failed due to wrong information.
Packets are arriving at destination, but when the credentials are good, they don’t successfully register.
And please, this ISN’T my first rodeo, so dont assume I am here asking with doing all the verifications that I can, you aren’t the only genius alive…
To get a better “view” of the transactions, in asterisk you can
sip set debug ip a.b.c.d
(both the cli and /var/log/asterisk/full)
if using pjsip then
pjsip set logger on
but I personally would stick to chan_sip for trunking until pjsip setup is more “stable” and “complete”.
(hehe, I guess if using <= 1.8 you won’t be using pjsip)
Thanks dicko, I am in fact using chan_sip
expect a two way flow, between to box and the VSP, don’t concern yourself about the first NOGO, it is part of a reasonably secure authentication to prevent sniffing. Closely watch the VIA IP’s as the flow continues.