Incoming external calls via URI

Hello!

Can someone please help me how to configure Asterisk (1.4) to accept incoming external calls via URI. For example, i have user 1999 and I want to accept sip call from outside to my URI: sip:1999@xxx.xxx.xxx.xxx. I keep gettin Authentication required.

Thans in advance…

Are the phones trying to register ? Also did you set up the extension correctly under the default context ?

Yes, it looks like Asterisk try to register external user. Default context is correctly setup…

I think I found out how Asterisk is dealing with this external SIP calls. If have user 1999 at my server and some user with same username (1999) from different server is calling me via URI, Asterisk tries to authenticate it, thus I get Authentication required. How can I prevent such behaviour, so that Asterisk also checks domain, not only user?

I think that there is something with autodomain and allowxternalinvites in sip.conf

I don’t think that is the issue. In the default context you would need to create extension 1999 and tell it to go to sip phone 1999.
(e.g. Exten => 1999,1,Dial(SIP/1999)

I have done this and I can accept call. However if i have defined user 1999, than Asterisk tries to authenticate calling party. So if call is placed from 1999@someexternalserver than Asterisk looks if user 1999 is defined on my server and tries to authenticate it. It does not looks for domain also.

If I do not have defined user 1999 than i can redirect call to me (i am user 1500), but i see like user 1999@myserver is calling me instead user 1999@someexternalserver, so i cannot call back

It is a bit complicated to explain this issue… but it think that this is something with sip.conf configuration.

Please, help…

Basiclly what i want… I want to configure Asterisk server so it can accepts external sip calls. If call is from 1999@external server to 1500@myserver i want to accept call and see that 1999@externalserver is calling me…

So you want to only accept calls from a certain IP ?