Unable to connect my SIP phone

[general]
context=internal
allowguest=no
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=no
disallow=all
allow=ulaw
alwaysauthreject=yes
canreinvite=no
nat=yes
session-timers=refuse
localnet=192.168.0.0/255.255.255.0

[7001]
type=friend
host=dynamic
secret=123
context=internal

[7002]
type=friend
host=dynamic
secret=456
context=internal

after reload, it show failed to bind 5060. Addr alrdy in use.

And I am not able to register myclient phones . please help, I am new to asterisk and Voip

Are you running pjsip as well? (In any case, why aren’t you using pjsip as chan_sip is as good as unsupported?)

Do you have a soft phone on the same machine?

Why do you have localnet without any external addresses?

Do you have anything working at all?

The following points are unlikely to cause failures in normal cases:

Why do you have nat=yes at all (hint: you should need it just because you are behind NAT)?

canreinvite was renamed to directmedia about a decade ago. Is there something about your network that requires you to disable it?

You might also want to try running “lsof -i :sip” to see what has 5060 open. (I’m not in a position to fully dry run this, to make sure those are the right options.)

Im using VMbox to download centos and I have installed zoiper and MicroSIP on my window. Both not working.
I tried to disable NAT, but also not working.
I tried to ping the IP address of the VM on window. it works.
But when I tried to ping the IP address of window on centos. It does not respond

That isn’t something that you do in Asterisk. nat= enables work arounds for broken NAT support in peers; it is mainly, or exclusively, for when Asterisk is outside NAT and a broken peer is inside. externip allows you to create unbroken SIP user agents when you are inside NAT and rhe peer is outside. localnet is useless without externip.

I don’t know enough about these to know the implications of using them, and in particular I don’t know how VMBox handles addressing.

I’d strongly suggest getting some experience in a simple configuration, all on the same LAN, and with hard phones, and physical machines, so that the PABX and phones only have one IP address each, and they are all different. Once you are comfortable about how it works, you can move to virtual machines and crossing NAT routers.

Many people use Raspberry Pi’s as practice hosts for Asterisk, or as production servers for home or small office use.

If you have to use soft phones, run them on different physical machines.

If you have to run multiple SIP user agents in virtual machines, on the same host, I’d advise you to configure each of them to use a different port number.

Also, you should disable chan_sip, and enable chan_pjsip (having them both enabled could produce the result you have seen) and rework you configuration for chan_pjsip, using up to date documentation.

Dear ncincy,

just try to turn off your firewall Windows Defender.

Best regard

Have check the VM network settings? It may be in NAT mode.
Better to set bridge mode.

Yes, I am already in bridge mode, and my IP is sth like 192.168.0.x and I set it to be static

I am using a wifi on my window. Should I use ethernet?

You should check about “failed to bind 5060…” can use netstat tool.

netstat -anp|grep 5060

Option grep it could use LISTEN, ESTABLISHED and so on with others.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.