Asterisk not working
-
I have trouble getting Asterisk working on my pfSense box. This is what I did to build another test box. I used the second edition of 'Asterisk' by Meggelen, Madsen and Smith as a guide for the SIP stuff because it has worked in the past.
1. Fresh install of pfSense ver 2.2.4-Release(amd64) from disk (downloaded today 23 Sep)
2. Installed TFTP package and moved these files into the /tftpboot directory
OS79XX.TXT P003-8-12-00.sbn P0S3-8-12-00.sb2
P003-8-12-00.bin P0S3-8-12-00.loads3. OS79XX.TXT only has:
P003-8-12-004. Created SIPDefault.cnf in the /tftpboot directory IAW Asterisk book
image_version: P0S3-8-12-00
Proxy1_address: 10.200.0.25. Created SIP <one of="" my="" mac="" addresses="">in the /tftpboot directory IAW Asterisk book
# Line 1 Configuration
line1_name: "1000"
line1_authname: "1000"
line1_shortname: "Jimmy Carter"
line1_password: "cisco"
line1_displayname: ""# The phone label, displayed in the upper-righthand corner of the phone
phone_label: "aristotle" ; Has no effect on SIP messaging# Phone password used for console or telnet access, limited to 31 characters
phone_password: "cisco"6. Moved sip.conf to sip.conf.old and made a new sip.conf with vi and put it in
/cf/conf/asterisk/ directory IAW the Asterisk book.
[general][1000]
type=friend
context=phones
host=dynamic
secret=cisco7. Moved extensions.conf and made a new one
[globals][general]
[default]
exten => s,1,Verbose(1|Unrouted call handler)
exten => s,n,Answer()
exten => s,n,Wait(1)
exten => s,n,Playback(tt-weasels)
exten => s,n,Hangup()[incoming_calls]
[internal]
exten => 500,1,Verbose(1|Echo test application)
exten => 500,n,Echo()
exten => 500,n,Hangup()[phones]
include => internal8. Setup DHCP server (pfSense) to give out addresses and identify the TFTP server and the NTP server (pfSense).
9. SSH into the pfSense, selected shell, turned on the Asterisk CLI and connected a Cisco 7960 phone and did a factory reset. The reset showed that it found the firmware file and a check of settings shows it got the expected IP address, TFTP server etc. The SIP settings show the right stuff for line 1. The Asterisk CLI shows nothing at all.
[2.2.4-RELEASE][admin@TestAsterisk.VoIP]/cf/conf/asterisk: /usr/pbi/bin/asterisk -rvvvvv
Asterisk 1.8.32.1, Copyright (C) 1999 - 2013 Digium, Inc. and others.
Created by Mark Spencer markster@digium.comAsterisk 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.8.32.1 currently running on TestAsterisk (pid = 17193)
Verbosity was 0 and is now 5
TestAsterisk*CLI>/markster@digium.com10. So I thought I would try and dial the Echo test application. The CLI shows:
'TestAsteriskCLI>' (type 'core show help TestAsteriskCLI>' for other possible commands)
[Sep 23 16:04:12] WARNING[-1]: chan_sip.c:3883 retrans_pkt: Timeout on 000d2858-81330002-108be185-10f589d9@10.200.0.21 on non-critical invite transaction.THATS ALL. Nothing indicating that Asterisk is even alive. The phone started with a dialtone and went silent after I pressed Dial. Something is wrong.
Dialplan Show gives:
TestAsterisk*CLI> dialplan show
[ Context 'app_queue_gosub_virtual_context' created by 'app_queue' ]
's' => 1. NoOp() [app_queue][ Context 'demo' created by 'pbx_lua' ]
Alt. Switch => 'Lua/' [pbx_lua][ Context 'local' created by 'pbx_lua' ]
Alt. Switch => 'Lua/' [pbx_lua][ Context 'parkedcalls' created by 'features' ]
'700' => 1. Park() [features][ Context 'app_dial_gosub_virtual_context' created by 'app_dial' ]
's' => 1. NoOp() [app_dial][ Context 'phones' created by 'pbx_config' ]
Include => 'internal' [pbx_config][ Context 'internal' created by 'pbx_config' ]
'500' => 1. Verbose(1|Echo test application) [pbx_config]
2. Echo() [pbx_config]
3. Hangup() [pbx_config][ Context 'incoming_calls' created by 'pbx_config' ]
[ Context 'default' created by 'pbx_config' ]
's' => 1. Verbose(1|Unrouted call handler) [pbx_config]
2. Answer() [pbx_config]
3. Wait(1) [pbx_config]
4. Playback(tt-weasels) [pbx_config]
5. Hangup() [pbx_config]
Alt. Switch => 'Lua/' [pbx_lua]-= 5 extensions (11 priorities) in 9 contexts. =-
Thought I had missed something so checked out https://doc.pfsense.org/index.php/Asterisk_VoIP and added a local net in sip.conf. So now it looks like this:
[general]
localnet=10.200.0.0/16[1000]
type=friend
context=phones
host=dynamic
secret=ciscoThen I pressed the Restart Asterisk on the pfSense GUI… No change.
SIP Registry shows nothing:
Host dnsmgr Username Refresh State Reg.Time
0 SIP registrations.SIP Peers shows something, but it looks like the phone isn't registering:
Name/username Host Dyn Forcerport ACL Port Status
1000 (Unspecified) D N 0 Unmonitored
1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 0 online, 1 offline]SIP Settings shows:
Global Settings:
–--------------
UDP Bindaddress: 0.0.0.0:5060
TCP SIP Bindaddress: Disabled
TLS SIP Bindaddress: Disabled
Videosupport: No
Textsupport: No
Ignore SDP sess. ver.: No
AutoCreate Peer: No
Match Auth Username: No
Allow unknown access: Yes
Allow subscriptions: Yes
Allow overlap dialing: Yes
Allow promisc. redir: No
Enable call counters: No
SIP domain support: No
Realm. auth: No
Our auth realm asterisk
Use domains as realms: No
Call to non-local dom.: Yes
URI user is phone no: No
Always auth rejects: Yes
Direct RTP setup: No
User Agent: Asterisk PBX 1.8.32.1
SDP Session Name: Asterisk PBX 1.8.32.1
SDP Owner Name: root
Reg. context: (not set)
Regexten on Qualify: No
Legacy userfield parse: No
Caller ID: Unknown
From: Domain:
Record SIP history: Off
Call Events: Off
Auth. Failure Events: Off
T.38 support: No
T.38 EC mode: Unknown
T.38 MaxDtgrm: 4294967295
SIP realtime: Disabled
Qualify Freq : 60000 ms
Q.850 Reason header: No
Store SIP_CAUSE: NoNetwork QoS Settings:
IP ToS SIP: CS0
IP ToS RTP audio: CS0
IP ToS RTP video: CS0
IP ToS RTP text: CS0
802.1p CoS SIP: 4
802.1p CoS RTP audio: 5
802.1p CoS RTP video: 6
802.1p CoS RTP text: 5
Jitterbuffer enabled: NoNetwork Settings:
SIP address remapping: Disabled
Externhost:
Externaddr: (null)
Externrefresh: 10
Localnet: 10.200.0.0/255.255.0.0Global Signalling Settings:
Codecs: 0x80000008000e (gsm|ulaw|alaw|h263|testlaw)
Codec Order: none
Relax DTMF: No
RFC2833 Compensation: No
Symmetric RTP: No
Compact SIP headers: No
RTP Keepalive: 0 (Disabled)
RTP Timeout: 0 (Disabled)
RTP Hold Timeout: 0 (Disabled)
MWI NOTIFY mime type: application/simple-message-summary
DNS SRV lookup: Yes
Pedantic SIP support: Yes
Reg. min duration 60 secs
Reg. max duration: 3600 secs
Reg. default duration: 120 secs
Outbound reg. timeout: 20 secs
Outbound reg. attempts: 0
Outbound reg. retry 403:0
Notify ringing state: Yes
Include CID: No
Notify hold state: No
SIP Transfer mode: open
Max Call Bitrate: 384 kbps
Auto-Framing: No
Outb. proxy:
Session Timers: Accept
Session Refresher: uas
Session Expires: 1800 secs
Session Min-SE: 90 secs
Timer T1: 500
Timer T1 minimum: 100
Timer B: 32000
No premature media: Yes
Max forwards: 70Default Settings:
Allowed transports: UDP
Outbound transport: UDP
Context: default
Force rport: Yes
DTMF: rfc2833
Qualify: 0
Use ClientCode: No
Progress inband: Never
Language:
MOH Interpret: default
MOH Suggest:
Voice Mail Extension: asterisk
The log shows this:
[Sep 23 15:56:45] NOTICE[-1] cdr.c: CDR simple logging enabled.
[Sep 23 15:56:45] WARNING[-1] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
[Sep 23 15:56:45] NOTICE[-1] loader.c: 162 modules will be loaded.
[Sep 23 15:56:45] WARNING[-1] loader.c: Error loading module 'res_snmp.so': Shared object "libperl.so" not found, required by "libnetsnmpmibs.so.30"
[Sep 23 15:56:45] NOTICE[-1] pbx_lua.c: Lua PBX Switch loaded.
[Sep 23 15:56:45] WARNING[-1] loader.c: Error loading module 'res_snmp.so': Shared object "libperl.so" not found, required by "libnetsnmpmibs.so.30"
[Sep 23 15:56:45] WARNING[-1] loader.c: Module 'res_snmp.so' could not be loaded.
[Sep 23 15:56:45] NOTICE[-1] res_smdi.c: No SMDI interfaces are available to listen on, not starting SMDI listener.
[Sep 23 15:56:45] WARNING[-1] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
[Sep 23 15:56:45] WARNING[-1] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
[Sep 23 15:56:45] WARNING[-1] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
[Sep 23 15:56:45] WARNING[-1] db.c: Database unavailable
[Sep 23 15:56:45] NOTICE[-1] cel_custom.c: No mappings found in cel_custom.conf. Not logging CEL to custom CSVs.
[Sep 23 15:56:46] WARNING[-1] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
[Sep 23 15:56:46] WARNING[-1] db.c: Database unavailable
[Sep 23 15:56:46] WARNING[-1] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
[Sep 23 15:56:46] WARNING[-1] db.c: Database unavailable
[Sep 23 16:04:12] WARNING[-1] chan_sip.c: Timeout on 000d2858-81330002-108be185-10f589d9@10.200.0.21 on non-critical invite transaction.
[Sep 23 16:12:20] NOTICE[-1] cdr.c: CDR simple logging enabled.
[Sep 23 16:12:20] WARNING[-1] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
[Sep 23 16:12:20] NOTICE[-1] loader.c: 162 modules will be loaded.
[Sep 23 16:12:20] WARNING[-1] loader.c: Error loading module 'res_snmp.so': Shared object "libperl.so" not found, required by "libnetsnmpmibs.so.30"
[Sep 23 16:12:20] NOTICE[-1] pbx_lua.c: Lua PBX Switch loaded.
[Sep 23 16:12:20] WARNING[-1] loader.c: Error loading module 'res_snmp.so': Shared object "libperl.so" not found, required by "libnetsnmpmibs.so.30"
[Sep 23 16:12:20] WARNING[-1] loader.c: Module 'res_snmp.so' could not be loaded.
[Sep 23 16:12:20] NOTICE[-1] res_smdi.c: No SMDI interfaces are available to listen on, not starting SMDI listener.
[Sep 23 16:12:20] WARNING[-1] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
[Sep 23 16:12:20] WARNING[-1] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
[Sep 23 16:12:20] WARNING[-1] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
[Sep 23 16:12:20] WARNING[-1] db.c: Database unavailable
[Sep 23 16:12:20] NOTICE[-1] cel_custom.c: No mappings found in cel_custom.conf. Not logging CEL to custom CSVs.
[Sep 23 16:12:20] WARNING[-1] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
[Sep 23 16:12:20] WARNING[-1] db.c: Database unavailable
[Sep 23 16:12:20] WARNING[-1] db.c: Unable to open Asterisk database '/var/db/asterisk/astdb': No such file or directory
[Sep 23 16:12:20] WARNING[-1] db.c: Database unavailable
[Sep 23 16:13:35] WARNING[-1] chan_sip.c: Timeout on 000d2858-81330003-47a528d6-55d338a7@10.200.0.21 on non-critical invite transaction.I did the following:
1. I created a directory and then 'touched' /var/db/asterisk/astdb.
2. Created a symbolic link for perl ie. ln -s /usr/pbi/asterisk-amd64/local/lib/perl5/5.18/mach/CORE/libperl.so /usr/local/lib
3. Rebooted the whole shebangNothing was added to the log this time. Still nothing at the CLI or on the phone.
Now, in the past, I have seen the Asterisk CLI show some info as phones register, make calls, run tt-weasels etc. I suppose if I could see that info it may help with faultfinding a bit more. BUT it would be even better if it worked.
Has anyone had the same problem recently or can see what I have missed?
I have been working on this for some time and can't crack it. I don't try and go through the firewall all I have (so far) is one phone inside the firewall that I am trying to get echos on.
Please. Please. Please. Please. Please. Please. Please. Please. Please. Please. :'( :'( :'( Help</one>
-
After a bit more reading I have come to a few conclusions.
-
The latest version of the Asterisk package (0.3.3) does not work with the latest version of pfSense (2.2.4-RELEASE (amd64)
built on Sat Jul 25 19:57:37 CDT 2015 FreeBSD 10.1-RELEASE-p15) -
Nobody wants to talk about it
So… what next? Can anyone suggest how to get Asterisk to work with pfSense? OR can anyone suggest a good way to make an independent Asterisk server? OR suggest a firewall/Asterisk server that does work?
Hugs and kisses.
TheCook -
-
Ask the asterisk folks. Why anyone would want to combine an IP-PBX with a firewall is beyond me.
-
'Firewalls' can also be used to control traffic between various local LANs. Whilst it is good to have a physically separate computer for each task, not everyone has the funds or space to stack up machines. Protection from the bad guys out there in the big, bad WWW, is a whole different matter and a specialised, dedicated box is important.
I am using pfSense effectively as an easily configurable 'router (on a stick)' that allows very easy control between LANs and that allows high visibility of what is going on. It was convenient to also use it as a DHCP server, TFTP server, Asterisk Server etc.
I might check out a Raspberry Pi solution… at least it won't take up too much space and I should be able to save up for one of those fairly quickly.
Thanks for the response, even though it didn't really help at all. At least I know someone thought of me for, at least, a short time.
TheCook
-
Hi TheCook,
I use an older version of pfsense (2.1.3 - running on freeBSD 8.3) to run Asterisk as a package, installing that will give you something working (if you did not have that already).
Any attempts to upgrade my system failed miserably sofar :(, never got the Asterisk services running properly again after an update. However I do not use it as my main firewall, I just like the control pfsense give over the access of my pbx services.Guess it just a matter of waiting till someone has the time and tenacity to sort the problems out and gets it running again on the 2.2.4
D.
-
TheCook,
I've used Asterisk and have sold and supported Asterisk platforms for several years now. Look at the PbxInAFlash distros. They have one (I think it's labeled "Green") that is just a straight ISO you can boot as a VM in VirtualBox. Works really well and I think is Asterisk 10 or 11. All you need to get it up and running is to set an IP to the VM and set up the sip.conf localnet and extip and you should be good to go. All the dial patterns and stuff is already done and you get a FreePBX which makes life a lot easier. I wouldn't put Asterisk on your firewall, especially with timing and jitter. You don't want your PBX to have any unneeded load.
Having said that, if you can get into the Asterisk CLI (which it appears you can) run a "sip show peers", "sip show registry", and "sip show channels". That should give you an indication if your devices are registering with the PBX and if your trunks are connected. Also, I see you have your localnet set, but do you have your external IP set in the sip.conf? That would stop traffic.
Good Luck!