Sip.conf issues


#1

Hey all,

I’m pretty new, so I don’t know what goes in what place in my SIP client and the sip.conf file. Please help me figure these things out :slight_smile:

My Asterisk box is on my router, which has the IP address of 10.15.9.1, also known as karma.viceroy.swn :slight_smile: Since I never use the viceroy.swn domain, let’s just go with the IP address.

My SJPhone settings:
proxy domain: 10.15.9.1
user domain: 10.15.9.1
Account: cjcollier
password: password
Caller ID: cjcollier

The only line I’ve changed in my sip.conf file is to add this line:
register => cjcollier:password@10.15.9.1

I fire up asterisk with this command:
asterisk -dvvvv

When I get “Asterisk Ready.” and wait a few seconds, I get these errors:

Jul 20 09:37:46 NOTICE[9459]: chan_sip.c:9422 handle_request_register: Registration from ‘sip:cjcollier@10.15.9.1’ failed for '10.15.9.1’
Jul 20 09:37:46 WARNING[9459]: chan_sip.c:8246 handle_response_register: Forbidden - wrong password on authentication for REGISTER for ‘cjcollier’ to ‘10.15.9.1’

I then attempt to log in with SJPhone, and get these errors:

Jul 20 09:38:39 NOTICE[9459]: chan_sip.c:9422 handle_request_register: Registration from ‘sip:anonymous@10.15.9.1’ failed for '10.15.9.8’
Jul 20 09:38:39 NOTICE[9459]: chan_sip.c:9422 handle_request_register: Registration from ‘sip:anonymous@10.15.9.1’ failed for '10.15.9.8’
Jul 20 09:39:25 NOTICE[9459]: chan_sip.c:9422 handle_request_register: Registration from ‘sip:cjcollier@10.15.9.1’ failed for '10.15.9.8’
Jul 20 09:39:25 NOTICE[9459]: chan_sip.c:9422 handle_request_register: Registration from ‘sip:cjcollier@10.15.9.1’ failed for ‘10.15.9.8’

Does this make sense to anyone?

Thanks in advance for your help!

C.J.


#2

Here’s a couple of things to help you out. First, the ‘register’ definition is used to register Asterisk as a client. This command is used to register your Asterisk box with an external SIP provider.

It seems that you are trying to connect with a SIP Client ( SJPhone ) to your private Asterisk box. That is different and needs to be configured differently. Below is an example sip.conf file that should help you. Look up the different definitions to see what they do. It may not work exactly with SJPhone, I don’t use that client, I prefer X-Lite.

But here’s a brief rundown of what this sip.conf file does.

1.) Asterisk will listen on port 5060 for sip calls, and will listen on all available ethernet devices.
2.) Each Sip User is set into the ‘default’ context
3.) User ‘sjphone’ is setup with password 'hackme’
4.) ‘sjphone’ is a friend so they can place and receive calls
5.) Asterisk will register dynamic extension 1234 for ‘sjphone’

[general]
context=default
port=5060
bindaddr=0.0.0.0

[sjphone]
type=friend
regexten=1234
username=sjphone
password=hackme
callerid=“SJPhone Demo” <1234>
host=dynamic
nat=yes
canreinvite=no

Lastly when you are debugging a configuration the easiest way is to launch asterisk with the -vvvgc options. ‘vvv’ sets the verbosity to high, ‘g’ sets debugging information ( core dumps ), and c starts asterisk in console mode ( most important ). You can then watch the calls in real time and get more information where needed.

Hope this all helps.
Dan


#3

Thank you Dan. I’m going to try this now. This is all very good information to know.


#4

[quote=“dmikusa”]Here’s a couple of things to help you out. First, the ‘register’ definition is used to register Asterisk as a client. This command is used to register your Asterisk box with an external SIP provider.

It seems that you are trying to connect with a SIP Client ( SJPhone ) to your private Asterisk box. That is different and needs to be configured differently. Below is an example sip.conf file that should help you. Look up the different definitions to see what they do. It may not work exactly with SJPhone, I don’t use that client, I prefer X-Lite.

But here’s a brief rundown of what this sip.conf file does.

1.) Asterisk will listen on port 5060 for sip calls, and will listen on all available ethernet devices.
2.) Each Sip User is set into the ‘default’ context
3.) User ‘sjphone’ is setup with password 'hackme’
4.) ‘sjphone’ is a friend so they can place and receive calls
5.) Asterisk will register dynamic extension 1234 for ‘sjphone’

[general]
context=default
port=5060
bindaddr=0.0.0.0

[sjphone]
type=friend
regexten=1234
username=sjphone
password=hackme
callerid=“SJPhone Demo” <1234>
host=dynamic
nat=yes
canreinvite=no

Lastly when you are debugging a configuration the easiest way is to launch asterisk with the -vvvgc options. ‘vvv’ sets the verbosity to high, ‘g’ sets debugging information ( core dumps ), and c starts asterisk in console mode ( most important ). You can then watch the calls in real time and get more information where needed.

Hope this all helps.
Dan[/quote]

Well! That worked quite well, thank you. But you’re right, X-Lite would probably be better, since it has a dial pad and all. Would I do much the same thing to register with X-Lite instead? I’ll go check that out now whilest I wait for an answer.

Thanks again!


#5

You would do almost the exact same thing for xlite. This is the exact setup I use for an xlite user. Which I grabbed from the sample sip.conf file generated when you run ‘make samples’ from the asterisk directory.

[xlite]
;Turn off silence suppression in X-Lite (“Transmit Silence”=YES)!
;Note that Xlite sends NAT keep-alive packets, so qualify=yes is not needed
type=friend
regexten=1234 ; When they register, create extension 1234
username=xlite
password=hackme
callerid=“Jane Smith” <5678>
host=dynamic
nat=yes ; X-Lite is behind a NAT router
canreinvite=no ; Typically set to NO if behind NAT
disallow=all
allow=gsm ; GSM consumes far less bandwidth than ulaw
allow=ulaw
allow=alaw

Here’s a good website for configuring many different types of clients. asteriskguru.com/tutorials/. If your interested in using a differnt client than xlite.

Dan


#6

Thanks, I’ll take a look now.


#7

If I’m understanding this right, once you setup the config for the SIP proxy then all the VOIP calls will automatically be routed to Asterisk?


#8

Once you set you sip phone to use your asterisk server as the Sip Gateway / SIP Proxy ( different phones use different terminology ) all calls made from that Sip Phone will go out through the Asterisk server.

So if you set your sip phone to use 10.0.0.1 as the proxy / gateway, which is your asterisk machine’s ip address, when you dial extension 1234 the phone will send a sip call to the asterisk machine that will check your dialplan executing extension 1234 as setup in the extensions.conf file.

Dan


#9

Can you provide more info on how I would setup for incoming calls without a softphone?

Basically I have a voip provider and I just want to see I can make a call and have it go to Asterisk any default/random already setup extension with minimal effort to learn :smile:

It would be much appreciated.

I’ll give you beer or anything you need!

thx


#10

I’m a little confused with what you are trying to do.

"Can you provide more info on how I would setup for incoming calls without a softphone?"
1.) If you do not want to use a sip phone, you want to use a regular analog phone then you need phone boards. There are a few companies that make these, Digium makes the widest selection of boards. Then using the Zaptel driver ( /etc/zaptel.conf & /etc/asterisk/zapata.conf ) files you can configure your board to run with Asterisk.

Basically I have a voip provider and I just want to see I can make a call and have it go to Asterisk any default/random already setup extension with minimal effort to learn Smile

2.) This is easy enough, I’d search on this message board for the company you are using as a voip provider, it’s likely someone already has a howto for setting it up.

Also I’d highly recommend this website. It has the largest amount of Asterisk information I’ve come across. It also probably has howto guides on setting up both things you’ve mentioned in your post. It’s only downfall is that it can be slow sometimes.

voip-info.org/wiki-Asterisk

If you have more specific questions post them, but most of your general howto’s can be found on that site.

Dan


#11

Hi Dan,

Believe me I’ve been reading for days and I think I just need an example context or to be shown the areas of sip.conf to setup for the incoming calls.

The only thing I’m clear on is how to setup for outgoing calls but really I just need to setup for incoming.

Thanks :smile:


#12

I think that maybe your source of confusion. /etc/asterisk/sip.conf is not used to setup incoming calls. sip.conf is only used to create users with the capabilities of making either incoming calls, outgoing calls, or both. You create the user in sip.conf like I described in the beginning of this post.

Then in the /etc/asterisk/extensions.conf file you create an extension that the user can dial. With the sample configuration files extension 1000 is the demo. I would recommend using this. However if you want your own you can use this, it will answer play the welcome message, and hangup.

[default]
exten => 1000,1,Answer
exten => 1000,2,Playback(welcome)
exten => 1000,3,Hangup

Just make sure that when you create you user in the sip.conf file that you put them in the correct context. In the above sample, I put the code in the default context.

Now with this in extensions.conf, and a user configured in sip.conf I can go to my SIP Phone and dial extension 1000. I should see the call come in via the Asterisk Console ( asterisk -vvvgc ), and through my speakers I should hear ‘Welcome’. Then it hangsup.

Hope that helps, feel free to keep asking questions.
Dan


#13

Thanks for your help guys.

I had it so it would give an error message and recognize the number calling in but that’s all.

Dan you’re right I’m confused about what parts affect what…

What exactly does ‘register’ do? It seems that is what links me to the VOIP service and I can do that but it requires you to specify an extension.

I know I’m missing something because register obviously cannot send all incoming calls to just one default extension right?


#14

I am not exactly sure about register myself. I do not use any services that require it. However, after reading about it briefly it sounds like you put the register command into your sip.conf or iax.conf file and it will cause the asterisk server to register / login with an external service provider such as Free World Dialup.

You haven’t mentioned who is providing your service, so I can’t really tell you much more. Try posting a new message, along the lines of ‘Trying to connect to XXX SIP Provider, need help…’. I’m sure someone else has done it already and can help you, I just have never done what you are trying to do before.

Dan