Asterisk problem

hello! i’m new to asterisk.
i’m using CentOS 5.2 + ASterisk 1.6
when i finish installing asterisk, i configure sip.conf like:
[4455]
type=friend
username=4455
secret=1234
host=dynamic
context=internal

[4466]
type=friend
username=4466
secret=1234
host=dynamic
context=internal

and extensions.conf like:

[internal]
exten => 4455,1,Dial(SIP/4455)
exten => 4466,1,Dial(SIP/4466)

ok.

i start asterisk with: #asterisk -cvvvvvvv and open a softphone try to connect and nothing! :frowning:
i try nmap @ port 5060 but it’s closed! :frowning:
what i can do?

thx

how did you install centos maybe you have installed the fiewall you can disable the firewall with the command

service iptables stop
and to keep it off wenn you reboot type:
chkconfig iptables off

i’ve installed centos without iptables, alread checked.
look my sip.conf:

[general]
port = 5060
context = sip

[4455]
type=friend
username=4455
secret=1234
host=dynamic
context=internal

[4466]
type=friend
username=4466
secret=1234
host=dynamic
context=internal

extensions.conf

[internal]
exten => 4455,1,Dial(SIP/4455)
exten => 4466,1,Dial(SIP/4466)

what i forget?
help me please! :smiley:
c ya

You might want to try:

exten => _1000,1,Answer()
exten => _1000,n,Dial(SIP/1000,25) ; 25 is number of seconds to try
exten => _1000,n,hangup()

Also, in your sip.conf you have:
context = sip

but in your extensions.conf you have:
[internal]

Try changing the sip.conf to context = internal or the extensions.conf to [sip]

tried… nothing happened. asterisk appear to be ok… but nothing to open the port 5060

iptables is off. what more i can do?!

wireshark

Did you “extensions reload” and “sip reload” after making the changes? or shutdown asterisk and re-start it ?

Have you tried setting something up in extension.conf to answer and play a prompt? That will give you an idea if the problem is inbound to asterisk or dialing out.

You can try adding this to the beginning of sip.conf

Allowguest=no
context=internal
externip=xx.xx.xx.xx ; Your External IP
localnet=192.168.1.0/255.255.255.0 ; Your internal network
disallow=all ; For Codecs
allow=ulaw
allow=alaw
allow=g729
allow=gsm

Then complete your settings:

4455]
type=friend
username=4455
secret=1234
host=dynamic
context=internal
callerid="4455"
nat=yes ; OR NO if you are not behind NAT (Firewall)
canreinvite=no
mailbox=4455 ; For Voicemailo

In extensions.conf make sure you have:

[default]
include => internal

[internal]
exten => 4455,1,Dial(SIP/4455)
exten => 4466,1,Dial(SIP/4466)

nothing yet! :frowning:

Hi vinicius.neves,

Im using an old version of Asterisk (1.2.x). I may be wrong with 1.6 but try giving bindport=5060 in sip.conf. Reload asterisk or ‘asterisk -vvvvvvvvvgc’ and check.

Regards,

Kurian Thayil.

nothing again!

sip.conf

[general]
bindport=5060
port = 5060
context = sip
allowguest=no
context=internal
localnet=10.1.1.0/255.0.0.0
disallow=all
allow=ulaw
allow=alaw
allow=g729
allow=gsm

[5001]
type=friend
username=5001
secret=1234
host=dynamic
context=internal
callerid="5001"
canreinvite=no
mailbox=5001

[5002]
type=friend
username=5002
secret=1234
host=dynamic
context=internal
callerid="5002"
canreinvite=no
mailbox=5002

extensions.conf

[default]
include => internal

[internal]
exten => 5001,1,Dial(SIP/5001)
exten => 5002,1,Dial(SIP/5002)


still don’t connect.

the strange thing is: asterisk isn’t oppening the port 5060!

Hi vinicius.neves,

Did you try commenting port=5060 and using only bindport option? Hows the network setup.? Is the server/client behind NAT? And I hope you are using #netstat -nulp for checking the port status.

Regards,

Kurian.

asterisk will alway start on port 5060 default so it should work without the setting, are you sure asterisk is running? or does it stop when you start is with asterisk -cvvvvvvvvvvvvvg

can you connect to asterisk when you type asterisk -r ?

yeah, it starts when i type asterisk -cvvvvvvvvv
and stay working without any problem.

just this.

pls check ur selinux and linux default firewall. also check ur asterisk log file

selinux disabled
iptables off
asterisk 100% ok

the problem still…

now, i did… but i cant connect
look

*CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
5002/5002 10.1.1.52 5060 Unmonitored
5001/5001 10.1.1.51 5060 Unmonitored
2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 2 online, 0 offline]
*CLI>

with my sip.conf like this:

[5001]
type=friend
username=5001
secret=1234
host=10.1.1.51
context=internal
callerid="5001"
canreinvite=no
mailbox=5001

[5002]
type=friend
username=5002
secret=1234
host=10.1.1.52
context=internal
callerid="5002"
canreinvite=no
mailbox=5002


i still can’t connect. now, what is it?
holds.

now this:

[Jan 26 17:24:35] NOTICE[7639]: chan_sip.c:16968 handle_request_invite: Failed to authenticate user “Vinicius Neves” sip:5001@10.1.1.51;tag=e8b89ba2-4cea-dd11-8339-001374005c38