Inbound calls rejected because extension not found

Ran into a strange problem with our system.
It was all setup to handle all our inbound and outbound calls and was working fine, then we shutdown and restarted asterisk as we thought we had a problem.

When we restarted it initially it would not load fully and kept saying:

== Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Unable to connect to remote asterisk (does /var/run/asterisk.ctl exist?)
When it did get back up and running, colours were no longer displayed in the asterisk console view and none of our inbound calls worked any longer, just the outbound calls.

For our main asterisk number we get:

When we try to ring it, the extension for this number is set like so:

[02033750XXX] type=friend context=incoming

It was working this time yesterday and I can’t see any setting that has changed myself.
Has anyone ran into this problem before?
The only thing I can think of is if this an actual problem due to the way asterisk has restarted but restarting it just produces the problem again of it taking a long time to boot after saying does /var/run/asterisk.ctl exist?

This is version specific. You have not told us the version. My impresssion is that bug crept into some versions of 1.8 that means that SIP URLs without a user name no longer had “s” set as the user name. I don’t know if this has been fixed, or even officially reported as a bug, but you should certainly ensure that you are using the latest version.

Ah sorry about this. We are using on CentOS 5.1.

Oops myself. It was your CLI that was empty, not your dialled digits.

The version seems so old that it is not giving the context.

Make sure that allowguest is no, unless you specifically know you need it otherwise, as that can sometimes lead to a default match overriding a specific one, and is a security risk.

Uncommented allowguest=no and we are now getting on the console with an inbound call:

NOTICE[11791]: chan_sip.c:19961 handle_request_invite: Failed to authenticate device <sip:(0770312XXXX)@>;tag=3517035419-867931
Where 0770312XXXX is my mobile number I am using to call our inbound SIP number.
I assume thats because it doesnt recognise this number, and any number calling it would also be stopped. If so I’ll need to remove that as, due to it being an inbound number we do not know who will call it and will need to leave it open for anyone to call in.

Think you are right in that there is a bug somewhere, I had tried settings the general context to incoming yesterday afternoon but nothing happened, after restarting asterisk this morning and trying it today it now works for all incoming calls.
Still wouldn’t mind trying to find out why the specific extension for the inbound number is not recognised but I will try and find that out in time.
Thanks for your input anyway Chris.

Make sure you have the right context in the general section.

Cheers for the suggestion must have been trying it at about same time you mentioned funnily enough, as mentioned it wasn’t working yesterday when we tried it from what I am told, I assume as asterisk has been having problems loading up when I restarted it earlier today it fixed something.