[asterisk-users] Asterisk-beginner : cannot make phone calls using Asterisk

Cary Fitch caryf at usawide.net
Tue Apr 14 13:16:46 CDT 2009


May I suggest divide and conquer? 

 

I haven't followed every detail, but it seems that your phones are not
registering.

 

Put them on the same net as the sip server and get them to register.

 

Then get it to where you can make a call from one to the other.

 

Then back off through your router or what ever, with what ever filtering you
have in place.

 

In other words get it working "up close" then move out. until you break it,
and find that problem.

 

With at least one phone working, you can be sure the system is "good" at any
instant and then make the other "distant" phone work too.

 

I hope this helps.  If I have missed the mark, explain more as to the point
it is failing.

 

Cary Fitch

 

  _____  

From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of jonas kellens
Sent: Tuesday, April 14, 2009 12:58 PM
To: asterisk-users at lists.digium.com
Subject: Re: [asterisk-users] Asterisk-beginner : cannot make phonecalls
using Asterisk

 

I will summarize everything  again and try to answer all the questions asked
while I was away.

First I stop Asterisk :

[root at asterisk asterisk]# /usr/sbin/asterisk -r
Asterisk 1.4.24, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer <markster at digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for
details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it
under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 1.4.24 currently running on asterisk (pid = 3189)
Verbosity is at least 3
asterisk*CLI> stop now
asterisk*CLI> 
Disconnected from Asterisk server
[root at asterisk asterisk]# ps aux | grep asterisk
avahi     3320  0.0  0.0   2588  1344 ?        Ss   18:49   0:00
avahi-daemon: running [asterisk.local]
root      3563  0.0  0.0   3912   676 pts/0    S+   19:11   0:00 grep
asterisk

Then I edit the files sip.conf and extensions.conf

SIP.CONF

[root at asterisk asterisk]# cat sip.conf
[general]
context=default
port=5060
bindaddr=192.168.4.248
srvlookup=yes
disallow=all
allow=ulaw
allow=gsm
allow=g711

[BT201]
type=friend
context=intern
host=dynamic
username=BT201
secret=testpaswoord
;canreinvite=yes

[GXP1200]
type=friend
context=intern
host=dynamic
username=GXP1200
secret=testpaswoord
;canreinvite=yes

EXTENSIONS.CONF

[root at asterisk asterisk]# cat extensions.conf
[globals]

[default]

[intern]
exten => 210,1,Dial(SIP/BT201,30)
exten => 211,1,Dial(SIP/GXP1200,30)

exten => 251,1,Answer()
exten => 251,n,Echo()
exten => 251,n,Hangup()

Then I configure my SIP-phone grandstream BT201 :

1) I press menu > dhcp [on]
2) I press menu > IP-address > 192.168.4.144
3) I go to the webinterface via the above IP-address
My settings :
> tab account
account name : BT201
SIP server : 192.168.4.248
Outbound proxy : 192.168.4.248
SIP user ID : BT201
Authenticate ID : BT201
Authenticate Password : testpaswoord
Name : BT201
Use DNS SRV : no
User ID is phone number : no
SIP registration : yes
Unregister on reboot : no
Register expiration : 60
local SIP port : 5060
SIP transport : UDP
Use RFC3581 Symmetric Routing : no
NAT Traversal (STUN) : no
SUBSCRIBE for MWI : no
Proxy-Require : (nothing)

> Update > Reboot

Then I configure my SIP-phone grandstream GX1200 :


1) I press menu > status
2) IP-address : 192.168.4.180
3) I go to the webinterface via the above IP-address
My settings :
> tab account
account 1 active : yes
account name : GX1200
SIP server : 192.168.4.248
Outbound proxy : 192.168.4.248
SIP user ID : GX1200
Authenticate ID : GX1200
Authenticate Password : testpaswoord
Name : GX1200
Use DNS SRV : no
User ID is phone number : no
SIP registration : yes
Unregister on reboot : no
Register expiration : 60
local SIP port : 5060
SIP transport : UDP
Use RFC3581 Symmetric Routing : no
NAT Traversal (STUN) : no
SUBSCRIBE for MWI : no
Proxy-Require : (nothing)

Then I unplug the power of the Grandstream IP-telephones.

I restart Asterisk on my server :

[root at asterisk asterisk]# /sbin/service asterisk start
Starting asterisk:                                         [  OK  ]
[root at asterisk asterisk]# /usr/sbin/asterisk
-vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvr
Asterisk 1.4.24, Copyright (C) 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer <markster at digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for
details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it
under
certain conditions. Type 'core show license' for details.
=========================================================================
  == Parsing '/etc/asterisk/asterisk.conf': Found
  == Parsing '/etc/asterisk/extconfig.conf': Found
Connected to Asterisk 1.4.24 currently running on asterisk (pid = 3683)
Verbosity was 3 and is now 34
asterisk*CLI> 

I wait a while but no output on the CLI...

Then I give some commands :

asterisk*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status

GXP1200/GXP1200            (Unspecified)    D          0        Unmonitored

BT201/BT201                (Unspecified)    D          0        Unmonitored

2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2
offline]

asterisk*CLI> sip debug
SIP Debugging enabled
The 'sip debug' command is deprecated and will be removed in a future
release. Please use 'sip set debug' instead.

Then I power back on my Grandstream IP-telephones.

Nothing happens on the CLI...

asterisk*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status

GXP1200/GXP1200            (Unspecified)    D          0        Unmonitored

BT201/BT201                (Unspecified)    D          0        Unmonitored

2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2
offline]

My iptables settings :

[root at asterisk sysconfig]# cat iptables
# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j
ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
-A RH-Firewall-1-INPUT -p udp -m udp --dport 5060 -j ACCEPT
COMMIT

I added the line "-A RH-Firewall-1-INPUT -p udp -m udp --dport 5060 -j
ACCEPT" to the file...

Netstat :

[root at asterisk sysconfig]# netstat -a -n -p | grep 5060
udp        0      0 192.168.4.248:5060          0.0.0.0:*
3683/asterisk  

TCPdump :

I put the power off and back on of the IP-phones, otherwise nothing happens
:

[root at asterisk sysconfig]# /usr/sbin/tcpdump port 5060
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
19:47:33.106887 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:47:34.106254 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:47:36.106065 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:47:37.343330 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523
19:47:38.342736 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523
19:47:40.105688 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:47:40.342297 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523
19:48:14.071499 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:48:14.819554 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523
19:48:15.068907 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:48:15.816712 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523
19:48:17.068718 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:48:17.816524 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523
19:48:21.068341 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:48:21.816147 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523
19:48:25.067975 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:48:25.815769 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523
19:48:49.066450 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:48:49.814257 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523
19:48:50.065855 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:48:50.813411 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523
19:48:52.065667 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:48:52.813473 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523
19:48:56.065290 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:48:56.813095 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523
19:49:00.064913 IP 192.168.4.144.sip > 192.168.4.248.sip: SIP, length: 505
19:49:00.812718 IP 192.168.4.180.sip > 192.168.4.248.sip: SIP, length: 523

Meanwhile the Grandstream IP-phones have powered up...
So on port 5060, there are packets that arrive...

Does my Asterisk really listen on 5060 ??

Are my iptables configured the right way ??

A last test + output on the CLI :

Connected to Asterisk 1.4.24 currently running on asterisk (pid = 3683)
Verbosity is at least 34
asterisk*CLI> originate SIP/BT201 application playback demo-instruct
Really destroying SIP dialog
'0e4fed4c60b54b44169dad7a0f84ca98 at 192.168.4.248' Method: INVITE
[Apr 14 19:54:04] NOTICE[3763]: channel.c:3033 __ast_request_and_dial:
Unable to request channel SIP/BT201
asterisk*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status

GXP1200/GXP1200            (Unspecified)    D          0        Unmonitored

BT201/BT201                (Unspecified)    D          0        Unmonitored

2 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 2
offline]
asterisk*CLI> 


Thanks to everyone who is trying to help me !! Sincerely !

Jonas. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090414/860bbced/attachment-0001.htm 


More information about the asterisk-users mailing list