Telecom Features

From LinuxMCE
Revision as of 04:41, 1 July 2011 by Dan249 (Talk | contribs)

(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

This tries to be a complete list of LinuxMCE's telecom features. I will try to describe the feature, how to use it and a few implementation details.

Hard phones plug&play

Allows the user to simply plug the phone into the network, it should be detected and automatically configured.

Note : To each phone an extension is assigned : a small 3 digit number usually in range 200-299. Please don't try to change it unless you know what are you doing.

How to use it

Plug the phone (reboot it or reset it if needed), in few seconds on Orbiter you'll see something like

New device MAC XX:XX:XX:XX:XX:XX was found
Please choose device type

And you are presented with a datagrid with all device templates that matches MAC range of that specific device. After you select it, it will present you a screen to select room in which that device should be added. After selection wait a few seconds while device is configured, then you'll see a screen telling you that device is ready to use after a quick reload.

Technical details

First few steps are handled by Dhcpd-plugin so please read there. Then it comes to calling the configuration script.

The configuration script needs 6 command line parameters : -d DEVICE_ID -i DEVICE_IP -m DEVICE_MAC. Check one of /usr/pluto/bin/configure_*.pl to see how it's done.

The script usually will call another script /usr/pluto/bin/sync_pluto2amp.pl which will allocate a new extension to the phone and will submit a few pages in AMP to create proper asterisk configuration for the phone.

Then it comes to device specific stuff, it may:

  • submit some pages on phone's web interface (Snom, GrandStream)
  • create some files in /tftpboot (Cisco)
  • other ways (like running iaxyprov to setup IAXy)

Easy phoneline creation

When you sign up with a voip provider it usually gives you the following details : UserName, Password, PhoneNumber, HostToConnect. Using this data you may create a working phoneline in a few seconds.

Note : sometimes UserName is same with PhoneNumber, but not always, sometimes you may have one username/password to connect to provider's website (billing, support, call history) and OTHER pair of username/password to actually use the service. Be careful which one you use.

How to use it

Go to Users > Devices > Phone Lines.

It's a good idea before adding any phone line to fill the data in local prefixes section, like in this image. Filling it after phone line creation is useless, because that configuration can not be easily changed. You'll have to delete and recreate the phone line to make local numbers work.

Local prefixes.png

Select one of the providers (there are no 'fit them all' settings so there is a script to set up each provider, you are free to add more, just make sure that webpage is changed accordingly)

Fill the fields with your data and submit the page. The phone line should be set almost immediately, if everything is correct, there are no payment problems and the network is ok, then you can make calls right away. (for troubleshooting please read asterisk documentation)

Technical details

On submit a script is called with at least 3 parameters UserName Password PhoneNumber [ Host [ LinePrefix ] ]. Host is optional, it will be set to host assigned for existing VoIP accounts, new account may be assigned to other server. Line prefix is the prefix for dialing to outside, it's '9' by default.

Just check one of /usr/pluto/bin/create_amp_*.pl too see more details. As a main idea the script simply submits several pages in AMP web interface (creating a Trunk, an Incoming Route and an Outgoing Route).

  • For creation of the trunk we use all data provided to the script.
  • For incoming route usually PhoneNumber is used. Incoming call will be routed to special asterisk context from-LinuxMCE-custom which will be explained in Phoneline call routing
  • For outgoing route we use trunk number (from first step), local prefixes data submitted before line creation.

The parameters for trunk creation differ a lot between providers. The script we have will create a working configuration, it may not be optimal, some are just hacks to allow proper call routing, but it worked last time we checked.

Make and receive calls

Even before creating phoneline you already can call from/to any LinuxMCE phone added to installation. This includes hardphones, softphones and as a special case of softphone any MediaDirector, more specifically SimplePhone running on that media director.

If phoneline is added then you can call anywhere your service plan allows. If you set local prefix like in picture from previous section, then you also can just dial 3372199 to actually dial 919543372199.

For international calls usually you have to dial 9(dial out)+011(international)+40(Romania)+332(IasiRDS)+402618

(this is true for US providers only, for European providers to dial internationally you need 00)

How to use it

From a hard phone just dial the extension of the other phone and it will ring.

From a MD, go to Telecom > Dial Direct, then enter the number, select from which device to place the call or simply press "place call from here". If you are trying to place call from anything but a SimplePhone, it will ring you'll have to pick it up, and after that it will dial the number you entered.

Technical details

If the call is initiated without orbiter's help (like from hard phone), then the call is simply routed by asterisk to local extension or outside number.

Otherwise a PL_Originate command is sent to Telecom_Plugin which will send CMD_Phone_Initiate if you are trying to place a call from an Orbiter's Embedded Phone or CMD_PBX_Originate to Asterisk which will pass is to asterisk.

User call routing

Each LinuxMCE user gets a telecom extension (like a virtual number) in range 301-399.

Then he/she may setup a way to handle the call, like try to call phone in my room, then in kitchen, then ring several other phones, then send the call to voicemail.

But if it's a priority caller then instead after trying the phone in the room will call directly on mobile. Also you may set different routes if you are at home, or sleeping, or away.

How to use it

Go to Telecom > CallRouting, you'll see for each user something like the image below.

User routing first.png

Then you can set up for each usermode and each called type (normal or priority) what steps to make to reach you.

User routing second.png

Technical details

After submitting the second page the /usr/pluto/bin/create_pluto_dialplan.pl script is run which will query pluto_telecom :UserRouting, and will create a dialplan according to your settings, which will be saved in /etc/asterisk/extensions_pluto_dial.conf

This is a fragment of generated file.

exten => 301,1,AGI(pluto-getusermode.agi)
exten => 301,2,Goto(301-um${USERMODE}-pri${PRIORITYCALLER},1)
exten => 301,3,Hangup
exten => 301-um1-pri0,1,Goto(301-um1-pri0-try1,1)
exten => 301-um1-pri0-try1,1,Dial(Local/200@trusted,15)
exten => 301-um1-pri0-try1,2,Goto(301-um1-pri0-try1-${DIALSTATUS},1)
exten => 301-um1-pri0-try1,3,Hangup
exten => 301-um1-pri0-try1-BUSY,1,Goto(301-um1-pri0-try2,1)
exten => 301-um1-pri0-try1-NOANSWER,1,Goto(301-um1-pri0-try2,1)
exten => 301-um1-pri0-try1-CONGESTION,1,Goto(301-um1-pri0-try2,1)
exten => 301-um1-pri0-try1-CHANUNAVAIL,1,Goto(301-um1-pri0-try2,1)
exten => 301-um1-pri0-try2,1,Dial(Local/201@trusted,15)
exten => 301-um1-pri0-try2,2,Goto(301-um1-pri0-try2-${DIALSTATUS},1)
exten => 301-um1-pri0-try2,3,Hangup
exten => 301-um1-pri0-try2-BUSY,1,Goto(301-um1-pri0-try3,1)
exten => 301-um1-pri0-try2-NOANSWER,1,Goto(301-um1-pri0-try3,1)
exten => 301-um1-pri0-try2-CONGESTION,1,Goto(301-um1-pri0-try3,1)
exten => 301-um1-pri0-try2-CHANUNAVAIL,1,Goto(301-um1-pri0-try3,1)
exten => 301-um1-pri0-try3,1,Dial(Local/919543372199@trusted,15)
exten => 301-um1-pri0-try3,2,Goto(301-um1-pri0-try3-${DIALSTATUS},1)
exten => 301-um1-pri0-try3,3,Hangup
exten => 301-um1-pri0-try3-BUSY,1,Goto(301-um1-pri0-try4,1)
exten => 301-um1-pri0-try3-NOANSWER,1,Goto(301-um1-pri0-try4,1)
exten => 301-um1-pri0-try3-CONGESTION,1,Goto(301-um1-pri0-try4,1)
exten => 301-um1-pri0-try3-CHANUNAVAIL,1,Goto(301-um1-pri0-try4,1)

You will see a lot of Local/ @trusted numbers. Using this channel will allow you not to care about specific technology (like SIP, IAX2, SCCP or ZAP)

Phoneline call routing

Is somehow similar to user call routing, However it doesn't allow fail steps (so if the action specified fails, the call will be sent to mailbox). You'll have to select what to do on each housemode.

How to use it

Go to Wizard > Devices > PhoneLines and then click on Settings on phoneline you want, and set the route you want

Line routing.png

Technical details

The same script which generates user call routes also generates phone line routing. To fill this part of it, it looks into pluto_telecom : Line_HouseMode

This is a sample of what can be done:

exten => 100,1,VoiceMail(100)
exten => 100,2,Hangup
exten => 102,1,AGI(pluto-gethousemode.agi)
exten => 102,2,Goto(102-hm${HOUSEMODE},1)
exten => 102,3,Hangup
exten => 102-hm1,1,Dial(Local/200@trusted&Local/201@trusted,15)
exten => 102-hm1,2,Goto(102-hm1-${DIALSTATUS},1)
exten => 102-hm1,3,Hangup
exten => 102-hm1-BUSY,1,Goto(100,1)
exten => 102-hm1-NOANSWER,1,Goto(100,1)
exten => 102-hm1-CONGESTION,1,Goto(100,1)
exten => 102-hm1-CHANUNAVAIL,1,Goto(100,1)
exten => 102-hm2,1,Macro(vm,301)
exten => 102-hm2,2,Goto(102-hm2-${DIALSTATUS},1)
exten => 102-hm2,3,Hangup
exten => 102-hm2-BUSY,1,Goto(100,1)
exten => 102-hm2-NOANSWER,1,Goto(100,1)
exten => 102-hm2-CONGESTION,1,Goto(100,1)
exten => 102-hm2-CHANUNAVAIL,1,Goto(100,1)
exten => 102-hm3,1,Dial(Local/200@trusted&Local/201@trusted,15)
exten => 102-hm3,2,Goto(102-hm3-${DIALSTATUS},1)
exten => 102-hm3,3,Hangup
exten => 102-hm3-BUSY,1,Goto(100,1)
exten => 102-hm3-NOANSWER,1,Goto(100,1)
exten => 102-hm3-CONGESTION,1,Goto(100,1)
exten => 102-hm3-CHANUNAVAIL,1,Goto(100,1)
exten => 102-hm4,1,Macro(vm,301)
exten => 102-hm4,2,Goto(102-hm4-${DIALSTATUS},1)
exten => 102-hm4,3,Hangup
exten => 102-hm4-BUSY,1,Goto(100,1)
exten => 102-hm4-NOANSWER,1,Goto(100,1)
exten => 102-hm4-CONGESTION,1,Goto(100,1)
exten => 102-hm4-CHANUNAVAIL,1,Goto(100,1)
exten => 102-hm5,1,Goto(voice-menu-pluto-custom,s,1)
exten => 102-hm5,2,Goto(102-hm5-${DIALSTATUS},1)
exten => 102-hm5,3,Hangup
exten => 102-hm5-BUSY,1,Goto(100,1)
exten => 102-hm5-NOANSWER,1,Goto(100,1)
exten => 102-hm5-CONGESTION,1,Goto(100,1)
exten => 102-hm5-CHANUNAVAIL,1,Goto(100,1)
exten => 102-hm6,1,Dial(Local/919543373199@trusted,15)
exten => 102-hm6,2,Goto(102-hm6-${DIALSTATUS},1)
exten => 102-hm6,3,Hangup
exten => 102-hm6-BUSY,1,Goto(100,1)
exten => 102-hm6-NOANSWER,1,Goto(100,1)
exten => 102-hm6-CONGESTION,1,Goto(100,1)
exten => 102-hm6-CHANUNAVAIL,1,Goto(100,1)

Priority callers and callers for me

This feature allows user to route differently calls coming from some numbers.

Priority caller implies possibility of different routing when dialing a user.

For example your mother is a priority caller, you don't want to miss a call from her, because when she finally reaches you, you'll be in big trouble

Caller for me will be redirected to user extension instead of playing voicemenu when "Prompt user to choose extension or user" is selected as an option for given housemode.

The call from your boss is a call for you and not for your wife. Your wife's boss is a caller for your wife and not for you.

A caller for me will be treated as priority caller for me but the reverse is not true.

Meaning that call from your boss will be as special as the call from your mother (or you can be fired). But If your mother is calling, it doesn't always mean that she wants to talk with you, maybe she wants to speak with her grandchildren, but if she wants to talk to you, then she is treated as a priority caller.

How to use it

Go to Telecom > PriorityCallers and set priority callers for each user.

Then go to Telecom > CallersForMe and set callers for each user.

Pay attention how you set up those numbers, no checks are done if the same number is a 'caller for me' for more than one user.

Technical details

In dialplan we call pluto-getusermode.agi and pluto-callersforme.agi scripts which both are responsible to take care of call. The data is also stored in pluto_telecom database

Blind transfer of a call

Allows you to redirect an ongoing call to another destination.

How to use it

When you are speaking on an Orbiter's Emmbedded Phone you can simply press a button Transfer and select a device or a user or a outside number. In this case you'll hangup and the call will be redirected to destination chosen by you. It will call directly a device or outside number or will follow the user's routing.

Technical details

CMD_PL_Transfer is sent to Telecom_Plugin with bIsConference=false which will send CMD_PBX_Transfer to Asterisk with exact extension (3xx for a user, 2xx for device). The Asterisk will send a redirect command to asterisk.

If the call is already a conference call then it will continue to be conference call and you'll have to hangup manually.

Conference calls

Allows you to have conference with many phones.

It doesn't use asterisk's standard MeetMe because it needs a zaptel card for realtime clock. Instead we use app_conference which is not standard, but works remarkably well.

How to use it

When you are speaking on an Orbiter's Emmbedded Phone you can simply press a button Conference and select a device or a user or a outside number. In this case you and your party will join in next available conference room, and the selected extention will join you into the conference.

Technical details

CMD_PL_Transfer is sent to Telecom_Plugin with bIsConference=true which will send CMD_PBX_Transfer to Asterisk. The Asterisk will send a redirect command to asterisk (so far very similar with transfer), but that redirect command will have an additional channel to allow both channels to enter conference room.

Then Telecom_Plugin sends CMD_PL_External_Originate to invite the other party to join the conference room.

Join existing call

Give you the possibility to join the existing conversation, practically putting it into a conference room and adding more phones to it.

How to use it

When there is an ongoing call you can see it by going to telecom floor plan. Select one or more devices and click in datagrid on the call you want to join. The call will be put into a conference room and selected devices will be invited to join it.

Technical details

Check CMD_PL_Join_Call in Telecom_Plugin, is the one responsable for whole thing, practically it parses channels, devices deciding what devices are already in the call, and what need fo be added, and then

  • sends CMD_PL_Transfer with bIsConference=true if a conference need to be created
  • just invites new devices into the conference if the call is already a conference
  • do nothing if no new devices are selected

Also by clicking on that datagrid you will bring up the call in progress screen on all SimplePhones connected in that call.

Phonebook, speeddial

Allows user to dial a number from phonebook and to define speed dial scenarios (like call mother from certain phone, by one click from orbiter)

How to use it

To add entries in phone book please go to Telecom > PhoneBook, add an entry there. Then on orbiter go to Phone > PhoneBook. Type first letters and select the contact you want to call.

Speed dial can be found in Wizard > Scenarios -> TelecomScenarios. Add an entry there, regen all orbiters. then try to call by pressing the button in main telecom menu, or by selecting it from Phone > SpeedDial datagrid.

Note : A quick reload my be needed after adding entries and actually using them.

Also is a good idea to check Dial As phone number. There is a kind of autocomplete when you are adding a new phonebook entry, but better safe than sorry :)

Technical details

Not to much details, I wrote filling the SpeedDial datagrid and calling CMD_PL_Originate on click with right parameters.

Speed dial from the orbiter is done somewhere else.

Phone Book was already implemented and working.

Voice mail

Asterisk has voicemail recording capability. We store voicemail for each user and also all 'outside' calls sent to voicemail will be stored in mailbox 100 which is default voicebox for the house. The problem usually is not the storage of voicemail, but actually the retrieval of the voicemail.

How to use it

As a LinuxMCE user you have several ways to check your voicemail :

  • from any phone in the house dial "*98" followed by mailbox number (like "301") and access password (initially it's same "301"). Then you are presented to a voice menu which allows you to change password, listen to messages and so on.
  • from webpage go to Telecom > MyVoiceMail. You'll se an interface which allows you to check your voicemail
  • NOT COMPLETED : There should be an indicator about how many voicemails (new/old) a user have, and a datagrid which will alow to listen to voicemail from the orbiter.

Technical details

Voicemail is stored in /var/lib/asterisk/sounds/voicemail/default/XXX/INBOX/, where XXX is mailbox number (same as extension). Old voicemail is moved from that path into .../Old/.

Asterisk sends an event when voicemail count changes. Telecom_Plugin catches it, process a little and sends CMD_Set_Bound_Icon to all orbiters. Datagrid is implemented but I never tested it. It will use same web interface to allow playing messages on any MD.

Need to know : asterisk creates voicemail files with bad permissions (asterisk:asterisk), so asterisk_keep_running.pl will show voicemail once in about a minute to asterisk:www-data. So it's not good idea to check voicemail from web interface immediately after the message was left.

Black list

Asterisk has a convenient blacklist functionality. It can be used to block persistent telemarketers, surveys, etc. The caller gets a short message that the line is not in service. The call is not transferred to any extension, but simply hang up.

How to use it

To enable the blacklist, go to the FreePBX control panel by navigating to advanced -> configuration -> phones setup in the LinuxMCE web admin tool. Once in the FreePBX panel, click on the Tools tab and then Module admin. Click on the link Check for updates online. A list of available modules will appear on the screen. Under the category CID & Number Management you will find a module called Blacklist. Click on the link, check the Download and Install radio button and click Process at the bottom (or top) of the page. Once installation completed, go back to the Setup tab, now you will have the blacklist module to the left. Click on it and add any number to the list. Your changes will take effect immediately.