Showing posts with label FreePBX. Show all posts
Showing posts with label FreePBX. Show all posts

Wednesday, February 18, 2015

Asterisk BLF with Mitel 5220 / 5215

I had been struggling to get some Mitel 5220 and 5215 phones I had got for testing to work properly with FreePBX / Asterisk, in particular BLF.

There are lots of bits of information everywhere, but no single source, and this was one of the hardest to find, though the answer is simple ONCE YOU KNOW !

First, make sure your phones have the latest firmware and can boot from tftp cfg files - see my post here :

http://computers-linux-other-nonsense.blogspot.com.es/2014/10/freepbx-and-mitel-phones-5215-and-5220.html


FreePBX / Asterisk should be set up for this out of the box. The magic comes either in the phone web panel, or in the cfg files

In the web panel go to User List Config and select the relevant configured user.

Look for : BLF User Group List

In the box you need to add the User numbers you want to have indicated, separated by commas.

Next go to Key Programming.

The phones see to be quite particular about how the keys are programmed. I got mine in a knot and then had to reinstall the firmware/config to clear up the mess !

Select a key. Set the Feature to Speed Dial+BLF. Set the context (Device number) and give it a label - careful on the letter limit - I am not sure how to separate the Label from the Description so to be sure I kept to 10 letters

Now add the number of the extension this button will call and set the Type to name/number.

Save and exit.

Now when the user of that extension picks up the phone their light should come on.

If you use config files you need to add the following :

<.... 
BlfGroup="1001,1002,1003,1004,1005...."
......>

For the 5215 you have 7 keys so with 2 line keys that leaves 5 extensions

   
     
     
     
     
     
     
     
   


With the 5220 the numbers are 25-38

25 is bottom right. 26 is bottom left. Columns work from the bottom up, odd on the right and even on the left. I chose to leave my 2 line keys where they were at 25 and 27.

To tell you what the Feature codes are you should refer to this document if you can find it : http://edocs.mitel.com/UG/EN/DK115611_16.xls

Alternatively try experimenting with different key codes and then try to the Config download to see what codes are created.

And presto. Happy users with flashing lights.

Tuesday, October 21, 2014

FreePBX EndPointManager. Schooze or Scmucks - you decide.

To save you a long read and wasting your money, get the free Endpoint Manager for FreePBX here :

https://github.com/FreePBX/endpointman

If you want to know why I recommend this over the 'Professional' version, read on.

So, I decided to go for FreePBX on Asterisk after my Israeli built (don't want them to get the publicity) PBX was condemned .

Now, I know not a lot about VOIP systems.

I have played with installing Asterisk and FreePBX on top of my Koozali SME servers before.

Now I would have to do it for real.

Fortunately I have some very good friends.

I asked LL the question and he said 'fire me up a Koozali SME v9 VM and I'll bash a system together for you.'

And 15 minutes after the VM was up I had a basic system. He's a god.

My biggest headache (and still is) are Devices vs Users and Dialing Patterns (not to be specifically confused with Dialing Plan).

Anyway, after some running about we got the extensions up, a trunk connected and inbound and outbound routes. We could call extensions, call out, call in, and life was good.

And then that's when my luck ran out.

Two of my nearest and dearest smartarse friends who both run FreePBX and have a lot of experience said 'get End Point Manager from Schmooze' to manage my phones.

Great idea. Looked cool - I don't use much commercial software - mainly opensource - so don't really know the form, but I buy from 'The Big Jungle' easily enough..... how hard can it be ?

Nip over to Schmooze. Uh oh. Register before you can do anything. I hate that. Oh well. Just quickly buy and install (my friends told me it was dead simple).

So I parted with my cash, and that's where the pain REALLY started.

You can't install EPM without ZendGuard. Damn. OK, grab a copy and install.

Next..... ah. sysadmin. No problems - install the module. But you can't without the RPM. OK, download said RPM and install. No you can't as it has dependencies, one of which is apcupsd which I don't really want and is no use on a virtual machine anyway.

OK - rpm --nodeps  - That will fix it. Errrr....... No it won't. That'll fuck it.

 Preparing...                ########################################### [100%]
   1:sysadmin               ########################################### [100%]
no table for root

Ah, but it completes(ish) and starts incrond (which was a dependency I installed) but the terminally stupid fucking install script in the RPM is badly written and dumps errors to /dev/null

# Make sure sysadmin module is installed now
/var/lib/asterisk/bin/module_admin enable sysadmin > /dev/null
/var/lib/asterisk/bin/module_admin download sysadmin > /dev/null
/var/lib/asterisk/bin/module_admin install sysadmin > /dev/null

Is it installed or isn't it installed ? Fucking numpties. No proper error handling if its a fail.

Even WORSE is where is the fucking UNINSTALL script to remove all their crap ?????

So now we have a wedged rpm half in and half out. All their crap software installed but non functional, and the only way to remove it is manually. Great. Overjoyed.

So, I chose to give up on the piece of shit and ask for a refund.

Charming bunch to start with. But then its all all the usual bluff and bollocks:

"it's all on the wiki."
wiki.freepbx.org ?

"Yes"
Didn't go there mate - didn't think I needed to. System works. Why go to the freepbx wiki when you are schmooze and my system works ???? Think I have nothing better to do with my time ?

"Ah, only guaranteed on our own FreePBX distro."

Sorry - had no idea there WAS a special distro (apparently my two friends use it and thought I did, and I had no idea there was a separate distro)

"It's perfectly clear".

No it fucking isn't. It might appear to be because you live and breath it, but I am an outsider who just turned up to buy a widget. Your information is SHIT and downright misleading.

I actually went back to repeat the buying process, and indeed up pops a box saying 'only guaranteed on the Official FreePBX distro'. But I never connected between Distro and Installation. There is a difference, and it's a show stopping one. But as I didn't know there was a complete distro, it was completely meaningless.

"Refund request is rejected as per our ToS all sales are final. Secondly we state everywhere we can that only the FreePBX Distro is supported with Commercial modules. You are using FreePBX in a unsupported manner. You do realize Schmooze runs and maintains FreePBX. "

Oh thanks a bunch, you tossers. No I *didn't* realise the connection.

Have you actually read your own TOS - better known as 'Terms of Shite' - written by overpaid lawyers to try and let thieving bastards stamp all over consumers ?

You buy an 'Outright' licence. But it's only for 25 years, and they own all the rights to everything. So you have a limited use of the software. 'Outright' my arse.



And no you DON'T state EVERYWHERE.  And no I DIDN'T know that Schmucks had anything to do with FreePBX.

Any half decent company would have said 'we're really sorry for the trouble, have your money back'. It's a no brainer. Our company does such things all the time. We are not rich but we do sleep at night and we have lots of happy customers.

Not these thieving bastards.

I then tried to write and follow this up. Eventually I got a reply to say that if I filled in the ssh details etc they would look at it. Great. So I then spent a considerable amount of time accurately describing the problems, and my efforts at a solution in full in the vain hope that they might look at it.

Guess what happened then ? Nothing. Nada. Zip. Not a fucking sausage. I emailed every day for more than a week, and got absolutely no response from this bunch of retards.

So with an attitude like that, instead of a frustrating buying experience with a happy ending that I would relate to others (I am sure the module would be perfect for some and I may well have recommended it, with caveats) I am now left foaming at the mouth, and will do my damndest to make sure those thieving bastards never see a penny from me, or anyone else I know, as long as I live. And I'll make sure they know exactly how much that costs them as well.

Funny how $75 can make such a difference isn't it? Piss all to them. A matter of principle to me.

A little sales and customer service tip.

Remember that it takes 100 people to get a good reputation, but only one to get a bad one.

You've just awarded yourself a bad one. And that was a REALLY silly mistake.

Friday, October 10, 2014

FreePBX and Mitel Phones 5215 and 5220

This has caused me more headaches than I can shake a stick at.

I am fortunate enough to have a very good and knowledgeable telco friend who installed and set up FreePBX for me. It is a very good system. This is not a HowTo for setting up FreePBX.

I landed myself a bunch of Mitel 5215 and Mitel 5220 for pennies. These are SIP capable and should be easy enough to configure. Or so I thought.

Herewith my notes. There are other 5xxx phones in the same family and I believe that this should apply reasonably equally to them. Before you ask, make sure they have a label underneath saying "DUAL MODE". This means they will work with boththe MINET and SIP protocols.

Make sure your FreePBX system is basically up and running. Keep it simple to start with for testing. 2 Devices/Users, one inbound and one outbound route and one trunk. Use strong passwords, but note theses phones only take 20 characters.

For security I suggest where possible you only connect to your server locally or via a secure VPN. It will save you a lot of headaches all round.

I am assuming that your FreePBX server is local or on a 'local' LAN connected via VPN.

Set up your DHCP and TFTPD servers. make sure they work, particularly the logging so you can see what files the phone requests  :-)


Mitel 5215 and Mitel 5220 phones

These are reasonable phones from all accounts. The 5220 is basically identical but has more buttons.

Factory reset and convert to SIP procedure :

Press both Up and Down Arrow keys simultaneously while powering up the
phone.
NETWORK SETTINGS appears
Press NO until TOOLS & FEATURES appears and then press YES
Press NO until RESTORE DEFAULTS appears and then press YES
Press CONFIRM.
The phone resets with default settings.

When the screen goes blank, press and hold the keys * and 7  together. A page will show 'Release to cancel' - continue holding until this goes.

You are now in SIP mode.

Firmware

The first problem to deal with is firmware upgrades. Firmware is available on line but takes a bit of finding since Mitel decided to lock it up and give to their favoured ones only.

Have a search for the following files, but be careful of viruses etc.

SIPPhones_4.0.0.13.zip
SIPPhones_5.0.0.21.zip
SIPPhones_6.0.0.19.zip
SIPphones_7.2.0.4.zip
SIPphones_8.0.0.4.zip

You may find them here :

ftp://ftp.bluefeathertech.com/electronics/telephony/Mitel/mitel-sip

Whatever your level of firmware, raise one version at a time. It can be fatal to jump two levels. This may seem slow and painstaking, but you will end up with a bunch of working phones.

Careful when upgrading via the web panel with a tftp server. If like you me you suffer some sort of disconnect you can brick the bootloader and I haven't seen a solution to this - probably needs some sort of internal JTAG type cabling and a ROM flasher.


You need a working dhcp and tftpd server. Put the firmware in the root of the tftpd server.

Boot the phone in SIP mode. Go to the web page and login (default login is admin and the password is the phone model e.g. 5220 or 5215)

Go to Firmware Update

Choice of Manual download type : TFTP
HTTP : remove the HTTP URL
TFTP : add your server IP

Make sure you set a matching Language under Network Config

Click Update, and wait. Do not disconnect

An alternative is to upgrade using TFTP automatically on boot. This does work but takes a bit of doing. Make sure DHCP and TFTPD are working. Put the firmware in the TFTPD root folder. Make sure the server settings are correct, and the Autoupdate is selected for TFTP.


Another way is via the phone itself. Make sure the TFTP server settings are correct.

Press (SUPERKEY), and then press >> until SETTINGS & OPTIONS? appears.
Press OK, and then press ▼ until UPGRADE FIRMWARE? appears.
Press OK. CHOOSE PROTOCOL appears.
Press the desired protocol (HTTP or TFTP), or press AUTO. BEGIN UPGRADE NOW? appears.
Press CONFIRM. The downloading process begins and the phone reboots. This process may take approximately 1 to 2 minutes bhut possibly longer. Be patient. When the time and date appear on the display, the download and reboot is complete and the phone is ready for use.

Ok, we have our firmware in place.

Next is to configure the phone - if you do this manually you can then save the configuration and load it from your TFTP server at boot time

In simple terms the minimum you really need is as follows. Once you have the basics working, view the configuration and save it. Later we can build config files to load off the TFTPD server.


Minimum settings required :

User List config

User ID  -  (the device ID)
User display name   -   (I use the user/extension number)
SIP Auth Name   -   (the device ID)
SIP Auth password   -   (device ID password)

Line   -   SIP

SIP Proxy   -   (IP of your FreePBX box)
Port   -  5060
Scheme   -  UDP

SIP Registry server   -   (IP of your FreePBX box)
Port   -  5060
Scheme   -  UDP

Outbound server   -   (IP of your FreePBX box)
Port   -  5060
Scheme   -  UDP

Voicemail serve   -   (IP of your FreePBX box)
Port   -  5060
Scheme   -  UDP

Firewall   -   as necessary

Apply. That should be enough to get you registered.


Do a sound/echo test with *43

If all is well, view and then save the config.

OK, tftp config files.

The phone searches for files in this order :


MN_generic.cfg
MN_"Device_IP".cfg
MN_01234567890A.cfg

We'll ignore the Device_ID one.

Note the last is the phone MAC address. It is CASE SENSITIVE and any letters in the MAC must be in uppercase (if you are on Linux - can't speak for Windows)

Generic Settings

Here you can add GENERIC settings that apply to each MODEL of phone

MN_generic.cfg

e.g.
<Parameter Model="5220">
   <dhcpenable>1</dhcpenable>
   <tftp_config>1</tftp_config>
   <pppoe_enable>0</pppoe_enable>
   <tftp_task_enable>1</tftp_task_enable>
   <tftp_upgrade>0</tftp_upgrade>
   <http_upgrade>0</http_upgrade>
   <sip_mode>sip</sip_mode>
   <outbound_state>0</outbound_state>
   <tls_port>5061</tls_port>
   <local_sip_port>5060</local_sip_port>
   <tos>0</tos>
   <e802_priority>-1</e802_priority>
   <vlan_id>-1</vlan_id>
   <sntp>pool.ntp.org</sntp>
   <rss_feed></rss_feed>
   <blf_pickup>*98</blf_pickup>
   <domain>reetspetit.net</domain>
   <lancode>en_GB</lancode>
   <tonecode>GB</tonecode>
   <etc.........>
</Parameter>

  


<Parameter Model="5220">
   <dhcpenable>1</dhcpenable>
   <tftp_config>1</tftp_config>
   <pppoe_enable>0</pppoe_enable>
   <tftp_task_enable>1</tftp_task_enable>
   <tftp_upgrade>0</tftp_upgrade>
   <http_upgrade>0</http_upgrade>
   <sip_mode>sip</sip_mode>
   <outbound_state>0</outbound_state>
   <tls_port>5061</tls_port>
   <local_sip_port>5060</local_sip_port>
   <tos>0</tos>
   <e802_priority>-1</e802_priority>
   <vlan_id>-1</vlan_id>
   <sntp>pool.ntp.org</sntp>
   <rss_feed></rss_feed>
   <blf_pickup>*98</blf_pickup>
   <domain>reetspetit.net</domain>
   <lancode>en_GB</lancode>
   <tonecode>GB</tonecode>
   <etc.........>
</Parameter>


Mac Specific settings


Here you can add SPECIFIC settings that apply to each INDIVIDUAL phone by MAC address

One particular point of note. You may get 'no proxy available' if you try to use the wrong key settings for phones. This caused me no end of grief as I used the wrong key descriptors on one phone.

Make sure you use the correct for the type of phone. If you want to create more bespoke settings, shortcut keys etc, make the changes, save the new configuration file and diff the original and new files. Then copy the changes to the relevant cfg files.

e.g. here are two individual setups for two separate phones.

MN_01234567890A.cfg

<Parameter Model="5220">
   <pkDescription>
      <Key Line="25" Fea="6" Des="Line  1" Addr="" Addr2="" Mode="1" Mode2="1" UserID="8001"></Key>
      <Key Line="26" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="27" Fea="7" Des="Line 2" Addr="" Addr2="" Mode="1" Mode2="1" UserID="8001"></Key>
      <Key Line="28" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="29" Fea="8" Des="Line 3" Addr="" Addr2="" Mode="1" Mode2="1" UserID="8001"></Key>
      <Key Line="30" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="31" Fea="9" Des="Line 4" Addr="" Addr2="" Mode="1" Mode2="1" UserID="8001"></Key>
      <Key Line="32" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="33" Fea="4" Des="Headset             " Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="34" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="35" Fea="3" Des="Advisory            " Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="36" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="37" Fea="2" Des="Call logs" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="38" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
   </pkDescription>
   <time_zone>+1</time_zone>
   <user_passwd>5d41402abc4b2a76b9719d911017c592</user_passwd>
   <host_name>sip8001</host_name>
   <user_list>
      <User State="1" ID="8001" DispName="5001" Pwd="MySecretPassword" AuthName="8001" Realm="" RegSvr="192.168.1.1" RegPort="5060" RegScheme="2" ProxySvr="192.168.1.1" ProxyPort="5060" ProxyScheme="2" VMSvr="192.168.1.1" VMPort="5060" VMScheme="2" OutSvr="192.168.1.1" OutPort="5060" OutCtr="0" Ring="1" Line="0" EventSvr="" EventPort="5060" EventScheme="2" NatMode="1" NatType="stun" NatIp="0" BlfGroup=""></User>
   </user_list>
</Parameter>

MN_01234567890B.cfg

<Parameter Model="5215">
   <pkDescription>
      <Key Line="25" Fea="6" Des="Line  1" Addr="" Addr2="" Mode="1" Mode2="1" UserID="8002"></Key>
      <Key Line="26" Fea="7" Des="Line 2" Addr="" Addr2="" Mode="1" Mode2="1" UserID="8002"></Key>
      <Key Line="27" Fea="1" Des="5002" Addr="5002" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="28" Fea="0" Des="" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="29" Fea="4" Des="Headset             " Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="30" Fea="3" Des="Advisory            " Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
      <Key Line="31" Fea="2" Des="Call logs" Addr="" Addr2="" Mode="1" Mode2="1" UserID=""></Key>
   </pkDescription>
   <time_zone>+1</time_zone>
   <user_passwd>5d41402abc4b2a76b9719d911017c592</user_passwd>
   <host_name>sip8002</host_name>
   <user_list>
      <User State="1" ID="8002" DispName="5002" Pwd="MySecretPassword" AuthName="8002" Realm="" RegSvr="192.168.1.1" RegPort="5060" RegScheme="2" ProxySvr="192.168.1.1" ProxyPort="5060" ProxyScheme="2" VMSvr="192.168.1.1" VMPort="5060" VMScheme="2" OutSvr="192.168.1.1" OutPort="5060" OutCtr="0" Ring="1" Line="0" EventSvr="" EventPort="5060" EventScheme="2" NatMode="1" NatType="stun" NatIp="0" BlfGroup=""></User>
   </user_list>
</Parameter>


All things being equal you should be able to go to Advanced features, Reboot, and the phone will pick up the correct settings.

Quick list :

1. Clean boot, go to web page, set TFTPD server
2. Apply firmware
3. Take a copy of the clean config
4. Add basic settings to connect
5. Take a copy of the basic config
6. Make further changes
7. Take a copy of the advanced config
8. Diff and create cfg files
9. Get a beer :-)

Friday, March 22, 2013

Asterisk, FreePBX, and Draytel/Draytek accounts

Lord this has been fun to set up.

Had it working before with Asterisk/SARK/SAIL but trying it with FreePBX on my trusty SME Server

First remember that calls go like this :

PSTN > Trunk > Inbound Route > Extension > Outbound Route > Trunk > PSTN

1. Devices

Secret : a password
Device ID : a number e.g start from 9001
Device type : adhoc
This is better as users have to log in and out using *11 and *12 giving you a 2 layer security

2. Users

User Extension : a number e.g. start from 5001
User password : a multi digit PIN
Display Name : username

3. Ring Groups (if required)

Ring-Group Number : pick a number e.g. 600
Description : Draytel Ring all
Extension list : add your extensions


4. Trunk

I have had various settings. This works but I get 'Unmonitored' in Asterisk info and I'm sure it wasn't when I first did it - I thought it said 'OK'. Such is life.

Name : Draytel
Outbound CID : <Your PSTN number>
CID Options : Allow Any CID
Max Channels - Set currently at 2 but I think it can be 5

Outgoing Settings :

Name : Draytel
Peer Details :
type=friend
username=your customer/account number
fromuser=your customer/account number
secret=your customer/account password
host=draytel.org
fromdomain=draytel.org
qualify=yes
context=from-pstn
dtmfmode=rfc2833
insecure=very
disallow=all
allow=ulaw
Incoming Settings : are empty


Registration string :

In the following form

accountnumber:password@draytel.org/your incoming number

e.g. :

6548975:pass@draytel.org/02091234567

5. Outbound Route

Name : Draytel Outbound

Some Dial patterns

Trunk Sequence for Matched : Draytel

6. Inbound Route

Desctiption : Draytel Inbound
DID number : your PSTN Drayel Number
Destination : Pick an extension or a Ring Group




That should be it.

For issues with no sound look carefully at your NAT settings (after you have checked your Mic is working !) I think that 99% of all sound problems are due to incorrect NAT settings, so check, check, and check again.

SIP Phones settings :

Qutecom :

Username : The device name from above e.g. 9001
Password : from the Device password

SIP Domain/Realm : IP or Domain name of server
Displayname : Your name :-)

If necessary

Server : IP or Domain name of server
Proxy: IP or Domain name of server

 Enjoy :-)