George Pajari
2004-Feb-22 12:31 UTC
[Asterisk-Users] How to best debug SIP registration failure
I am having trouble getting SIP phones to register with Asterisk. I know that the phone can register with FWD and I have used tcpdump to see the registration packets arrive at the Asterisk server, but nothing goes back. How should I attack the problem? What debugging tools exist to try to determine why Asterisk is not accepting the registration requests? I have googled for answers but no one seems to have posted a general approach to attacking such problem, or, if they have, I missed it. g.
Olle E. Johansson
2004-Feb-22 14:18 UTC
[Asterisk-Users] How to best debug SIP registration failure
George Pajari wrote:> I am having trouble getting SIP phones to register with Asterisk. I know > that the phone can register with FWD and I have used tcpdump to see the > registration packets arrive at the Asterisk server, but nothing goes back. > > How should I attack the problem? > > What debugging tools exist to try to determine why Asterisk is not > accepting the registration requests? > > I have googled for answers but no one seems to have posted a general > approach to attacking such problem, or, if they have, I missed it.Start asterisk with a lot of verbose and debug, i.e. asterisk -vvvvvvvvvvvvvvvrd And then turn on "sip debug". /O
Philipp von Klitzing
2004-Feb-22 14:41 UTC
[Asterisk-Users] How to best debug SIP registration failure
Hi!> I am having trouble getting SIP phones to register with Asterisk. I know > that the phone can register with FWD and I have used tcpdump to see the > registration packets arrive at the Asterisk server, but nothing goes back.Sounds like your SIP client is behind NAT and you need nat=yes in sip.conf, and/or you need to enable STUN support in your SIP client so that the correct sender IP address. Note that SIP clients can only register with Asterisk if you have set host=dynamic and you have type=friend or type=peer set.> How should I attack the problem?First collect and provide meaningful information incl. sip.conf 1. Is NAT between the SIP phone and Asterisk? Does your SIP client use STUN? Which SIP client do you use? 2. Is Asterisk itself behind NAT? If yes first try to run Asterisk without NAT. 3. Does it work if you use a IAX client instead of a SIP client?> What debugging tools exist to try to determine why Asterisk is not > accepting the registration requests?- at the CLI enter SIP DEBUG (and SIP NO DEBUG when done) - press F9 if your client is X-Lite - you can use ethereal for more details, however usually the above two tools should already be sufficient Philipp
George Pajari
2004-Feb-22 21:59 UTC
[Asterisk-Users] Re: How to best debug SIP registration failure
Further to my question about how to approach a failure for a SIP phone to register with asterisk: "Olle E. Johansson" suggested:>Start asterisk with a lot of verbose and debug, i.e. > asterisk -vvvvvvvvvvvvvvvrd>And then turn on "sip debug".Tried that -- and used tethereal to verify that register packets arrived from the SIP phone, and nothing appeared on the screen or logs from asterisk. If you run the above and then fire up a SIP phone to register, what do you see? How can I get asterisk to indicate why it is ignoring SIP REGISTER requests? P.S. - netstat shows that someone is listening on port 5060 "Philipp von Klitzing" suggested/asked:>Sounds like your SIP client is behind NAT and you need nat=yes in >sip.conf, and/or you need to enable STUN support in your SIP client so >that the correct sender IP address. > >Note that SIP clients can only register with Asterisk if you have set >host=dynamic and you have type=friend or type=peer set.First of all I am more interested in general approaches to resolving this problem than merely diagnosing my particular situation as I expect to have to solve these problems in different scenarios in future. To use a common metaphor, I want to be taught to fish. To address your specific points: (a) yes, the client is behind a NAT -- nat=yes and STUN support is enabled. We can register with FWD successfully without using the FWD proxy so we have some confidence that the phone and NAT box are properly configured. But it is not clear why this would have anything to do with NAT. My experience is that one can register from behind a NAT without any difficulty -- the problem is geting acknowledgement of the registration and in making calls. What we have here is happening so early in the protocol exchange that the question of client NAT is probably moot. (b) host=dynamic and type=friend have been set>1. Is NAT between the SIP phone and Asterisk? Does your SIP client use >STUN? Which SIP client do you use?NAT is between SIP phone and Asterisk (Asterisk is not behind a NAT). SIP uses STUN -- again this will not affect registration. Using a Grandstream BudgeTone.>2. Is Asterisk itself behind NAT? If yes first try to run Asterisk >without NAT.Asterisk is not behind a NAT.>3. Does it work if you use a IAX client instead of a SIP client?Not an option -- and anyway I'm trying to diagnos a SIP client failure.>- at the CLI enter SIP DEBUG (and SIP NO DEBUG when done)Tried that but get nothing.>- press F9 if your client is X-LiteNot an option>- you can use ethereal for more details, however usually the above two >tools should already be sufficientTried both -- can see register packets arriving but nothing from Asterisk. g.
andrewg@felinemenace.org
2004-Feb-22 22:12 UTC
[Asterisk-Users] Re: How to best debug SIP registration failure
Just a silly question, but can the asterisk box ping/contact the client? (IE, is the routing correct on the * box?)> > How can I get asterisk to indicate why it is ignoring SIP REGISTER requests? > > P.S. - netstat shows that someone is listening on port 5060 >
andrewg@felinemenace.org
2004-Feb-22 22:15 UTC
[Asterisk-Users] Re: How to best debug SIP registration failure
On Sun, Feb 22, 2004 at 09:12:47PM -0800, andrewg@felinemenace.org wrote:> Just a silly question, but can the asterisk box ping/contact the client? > (IE, is the routing correct on the * box?) >(just to clarify, I mean the natted IP address..)
Anton Tinchev
2004-Feb-22 22:23 UTC
[Asterisk-Users] How to best debug SIP registration failure
ngrep. There is some patch for better displaying from iptel, that works grat George Pajari wrote:> I am having trouble getting SIP phones to register with Asterisk. I know > that the phone can register with FWD and I have used tcpdump to see the > registration packets arrive at the Asterisk server, but nothing goes > back. > > How should I attack the problem? > > What debugging tools exist to try to determine why Asterisk is not > accepting the registration requests? > > I have googled for answers but no one seems to have posted a general > approach to attacking such problem, or, if they have, I missed it. > > g.