X-Lite Registration Problem and no Debug output on CLI

Hi,

I have centos 5 with asterisk 1.8.23.0 and I am able to configure it with gTalk and Jabber. I am new with this asterisk stuff and have some knowledge about linux.

[code]CLI> jabber show connections
Jabber Users and their status:
[gmail] xxxxx@gmail.com/Talk - Connected

Number of users: 1
[/code]

my sip.conf and iax.conf

[home-phone]
context=users
port=5060
type=friend
secret=123456
dtmfmode=rfc2833
nat=yes
host=dynamic
username=home-phone

and extensions.conf

[entrada-gtalk]
exten => s,1,Set(CALLERID(name)="Desde Google Talk")
exten => s,n,Dial(SIP/mINumeroSIP)

[saliente-gtalk]
exten => 200,1,Dial(gtalk/gmail/buddy@gmail.com)


[docs:users]
[users]

exten=>s,1,Answer()
exten=>s,n,Wait(2)
exten=>s,n,SendDTMF(1)
exten=>s,n,Dial(SIP/home-phone,20)
exten=>603,1,Dial(SIP/home-phone,60)

Gmail stuff I have taken from Spanish website.

sip show peers output:

CLI> sip show peers
Name/username             Host                                    Dyn Forcerport ACL Port     Status
home-phone/home-phone     (Unspecified)                            D   N             0        Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 1 offline]

netstat -apn |grep 5060 output:

netstat -apn |grep 5060
udp        0      0 0.0.0.0:5060                0.0.0.0:*                               12319/asterisk

And on CLI, I have set these…

*CLI> core set verbose 5
*CLI> core set debug 5
*CLI> module reload logger
*CLI> logger rotate
*CLI> sip set debug on

Now on connecting with X-Lite

[color=#0040FF]-------------X-Lite Settings-------------------
Account name: Account 1
Protocol: SIP
Allow this call for
Call(checked)
IM/Presence(checked)
User Details:
userID : home-phone
domain : xx.xx.xx.xx:5060
password: 123456
Display name: home-phone
Authorization name: home-phone
Domain Proxy : selected Domain radio button
Dialplan:

Under Transport Tab: Automatic
Under Topology : None(use local IP address) is selected


[/color]

It give me this message:

Account failed to enable. Account: Account 1 could not be enabled. Verify your network data(e.g server address)

and on CLI, it does not show anything, any debug any message related to connection or registration.
It just keep showing:

JABBER: gmail INCOMING:

Or Jabber Keep Alive

Please help me out in connecting SIP account :frowning:

And…
nmap -v -sU localhost

[code]nmap -v -sU localhost

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-08-08 19:17 MSD
Initiating UDP Scan against localhost.localdomain (127.0.0.1) [1487 ports] at 19:17
The UDP Scan took 1.24s to scan 1487 total ports.
Host localhost.localdomain (127.0.0.1) appears to be up … good.
Interesting ports on localhost.localdomain (127.0.0.1):
Not shown: 1485 closed ports
PORT STATE SERVICE
5000/udp open|filtered UPnP
5060/udp open|filtered sip

Nmap finished: 1 IP address (1 host up) scanned in 1.255 seconds
Raw packets sent: 1489 (41.692KB) | Rcvd: 2974 (124.852KB)
[/code]

Is “filtered” creating problem? I am using VPS service.

Can someone please help me? :frowning:

3 hours 30 minutes is a lot less that 24 hours!

I’ve never heard of nmap, so I have no idea what it means by “filtered”, however, if sip set debug on is not showing anything and you are sending to the standard port number, that indicates a network problem outside of Asterisk, so specific Asterisk knowledge will not help.

Oh… :confused: What if something is blocking on server? I have set iptables for 5060 and sip is listening on that port but may be on VPS it is blocked by service provider?
How can I check that? because it says “filtered”

is my sip.conf and extensions.conf correct? Or Do I have to add externaddr and local addresses too?

I would appreciate your help :smile:

It may or may not be correct, but fixing it will not make it start logging the arrival of packets.

Whether you need externaddr, etc., depend on information that I don’t think you have provided. nat= is probably not needed, but won’t stop the arrival of packets being logged. You have no general section and the defaults are not very secure. type=peer is generally better than type=friend.

[quote=“david55”]It may or may not be correct, but fixing it will not make it start logging the arrival of packets.

Whether you need externaddr, etc., depend on information that I don’t think you have provided. nat= is probably not needed, but won’t stop the arrival of packets being logged. You have no general section and the defaults are not very secure. type=peer is generally better than type=friend.[/quote]

Hello David,

For testing, I have changed sip.conf and listening for TCP instead of UDP.

sip.conf

[general]
tcpenable=yes
tcpbindaddr=0.0.0.0
externaddr=x.x.x.x:5060
domain=mydomain.com
localnet=192.168.0.0/255.255.0.0


[home-phone]
context=users
port=5060
type=peer
secret=123456
dtmfmode=rfc2833
;nat=yes
host=dynamic
username=home-phone
;allow=alaw
canreinvite=yes
transport=tcp

ifconfig shows local ip: 127.0.0.1 so I am not sure IF i use that one for localnet :confused:

my iptables-save shows:

# Generated by iptables-save v1.3.5 on Sun Aug 11 01:33:54 2013
*nat
:PREROUTING ACCEPT [2231:130401]
:POSTROUTING ACCEPT [11274:471708]
:OUTPUT ACCEPT [11274:471708]
COMMIT
# Completed on Sun Aug 11 01:33:54 2013
# Generated by iptables-save v1.3.5 on Sun Aug 11 01:33:54 2013
*mangle
:PREROUTING ACCEPT [46226:3453479]
:INPUT ACCEPT [46226:3453479]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [49608:5328532]
:POSTROUTING ACCEPT [49608:5328532]
COMMIT
# Completed on Sun Aug 11 01:33:54 2013
# Generated by iptables-save v1.3.5 on Sun Aug 11 01:33:54 2013
*filter
:INPUT ACCEPT [11759:476926]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [49609:5329008]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p udp -m udp --dport 5060 -j ACCEPT
-A INPUT -p udp -m udp --dport 10000:20000 -j ACCEPT
COMMIT
# Completed on Sun Aug 11 01:33:54 2013

after restarting asterisk, I checked ports…

nmap -v -p5060 localhost

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-08-11 01:35 MSD
Initiating SYN Stealth Scan against localhost.localdomain (127.0.0.1) [1 port] at 01:35
Discovered open port 5060/tcp on 127.0.0.1
The SYN Stealth Scan took 0.01s to scan 1 total ports.
Host localhost.localdomain (127.0.0.1) appears to be up ... good.
Interesting ports on localhost.localdomain (127.0.0.1):
PORT     STATE SERVICE
5060/tcp open  sip

Nmap finished: 1 IP address (1 host up) scanned in 0.057 seconds
               Raw packets sent: 1 (44B) | Rcvd: 2 (88B)

and using IP of server…

nmap -v -p5060 x.x.x.x

Starting Nmap 4.11 ( http://www.insecure.org/nmap/ ) at 2013-08-11 01:37 MSD
Initiating SYN Stealth Scan against mydomain.com (x.x.x.x) [1 port] at 01:37
Discovered open port 5060/tcp on x.x.x.x
The SYN Stealth Scan took 0.01s to scan 1 total ports.
Host mydomain.com (x.x.x.x) appears to be up ... good.
Interesting ports on mydomain.com (x.x.x.x):
PORT     STATE SERVICE
5060/tcp open  sip

Nmap finished: 1 IP address (1 host up) scanned in 0.020 seconds
               Raw packets sent: 1 (44B) | Rcvd: 2 (88B)

And using netstat

netstat -apn |grep 5060
tcp        0      0 0.0.0.0:5060                0.0.0.0:*                   LISTEN      7171/asterisk
udp        0      0 0.0.0.0:5060                0.0.0.0:*                               7171/asterisk

which means that Asterisk is now listening on port 5060 which is in OPEN state (as in UDP case, it was OPEN|FILTERED)

I again tested with x-lite and still… no output on CLI :frowning: and same message as before…
I tried telnet 5060 localhost and with x.x.x.x IP for 5060 and it says connected…
:neutral_face:
Is there any way in linux like command for SSH for checking Asterisk SIP Connection?

Filtered is something that nmap deduces. It is not something that will show in netstat. It might be a consequence of firewall settings.

Hello David,

I found something strange.

I installed sipsak on server and tested it using domain name and IP too… and CLI shows message.
I created account with sip2sip.info and tried to registered using x-lite and I got same message. So I am sure now that my ISP does not allow SIP and they have blocked ports :cry:

I have installed a SIP dialer on BlackBerry and using 3G, I am able to connect to my account :smiley:

sip show peers

Name/username             Host                                    Dyn Forcerport ACL Port     Status      Description
home-phone/home-phone     42.83.85.73                              D   N             15429    Unmonitored 
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline]

Thank youuuu so much for your support :smile: I really appreciate it… I was trying to configure Asterisk since last 6 days and I didnt know my stupid ISP has blocked the service because they provide their own VoIP service :frowning:

Thanksss A Ton :smiley: