openhab-docs/_addons_bindings/freeswitch1
Thomas Dietrich 826ef4abb4 Distinguish collections, improve update process (#514)
* Rename collection folders

Signed-off-by: Thomas Dietrich <Thomas.Dietrich@tu-ilmenau.de>

* Change all occurences of addons and repos

Signed-off-by: Thomas Dietrich <Thomas.Dietrich@tu-ilmenau.de>

* Add further corrections

Signed-off-by: Thomas Dietrich <Thomas.Dietrich@tu-ilmenau.de>

* Remove temporary directories after processing

Signed-off-by: Thomas Dietrich <Thomas.Dietrich@tu-ilmenau.de>

* Reduce addons menus, show current uncond.

Signed-off-by: Thomas Dietrich <Thomas.Dietrich@tu-ilmenau.de>

* Fix typo

Signed-off-by: Thomas Dietrich <Thomas.Dietrich@tu-ilmenau.de>

* Remove redundant addons from permalinks

Signed-off-by: Thomas Dietrich <Thomas.Dietrich@tu-ilmenau.de>

* Sort UI menu entries correctly

Signed-off-by: Thomas Dietrich <Thomas.Dietrich@tu-ilmenau.de>

* Split maven command

Signed-off-by: Thomas Dietrich <Thomas.Dietrich@tu-ilmenau.de>
2017-09-22 21:05:09 +02:00
..
readme.md Distinguish collections, improve update process (#514) 2017-09-22 21:05:09 +02:00

readme.md

id label title type description source since logo install
freeswitch FreeSWITCH FreeSWITCH - Bindings binding The FreeSWITCH Binding connects to a FreeSWITCH instance and can report on current active calls as well as show unread voicemails and if a MWI is on. https://github.com/openhab/openhab1-addons/blob/master/bundles/binding/org.openhab.binding.freeswitch/README.md 1x images/addons/freeswitch.png auto

{% include base.html %}

FreeSWITCH Binding

The FreeSWITCH Binding connects to a FreeSWITCH instance and can report on current active calls as well as show unread voicemails and if a MWI is on.

You can also send any command to FreeSWITCH, see Freeswitch Commands for more info.

Prerequisites

Make sure you have the FreeSWITCH ESL module listing on a public port, your event_socket.conf.xml in FreeSWITCH should look something like:

<configuration name="event_socket.conf" description="Socket Client">
  <settings>
    <param name="nat-map" value="false"/>
    <param name="listen-ip" value="0.0.0.0"/>
    <param name="listen-port" value="8021"/>
    <param name="password" value="ClueCon"/>
    <!--<param name="apply-inbound-acl" value="lan"/>-->
  </settings>
</configuration>

Binding Configuration

This binding can be configured in the file services/freeswitch.cfg.

Property Default Required Description
host Yes host name or IP address of FreeSWITCH host
port Yes port number as specified in listen-port from event_socket.conf.xml described earlier
password Yes password as specified in password from event_socket.conf.xml described earlier

Item Configuration

This is a sample item entry for non filtered calls, any inbound call will be considered active, this is sufficient for most uses:

Switch Incoming_Call  "Home Phone"                    (Phone) { freeswitch="active" }
Call Active_Call      "Connected [to %1$s from %2$s]" (Phone) { freeswitch="active" }
String Active_Call_ID "Caller ID [%s]"                (Phone) { freeswitch="active" }

This item is for a filtered call, only calls with an inbound direction and a destination number of 5555551212 will be matched:

Switch Incoming_Call  "Home Phone"                    (Phone) { freeswitch="active:Call-Direction:inbound,Caller-Destination-Number:5555551212" }
Call Active_Call      "Connected [to %1$s from %2$s]" (Phone) { freeswitch="active:Call-Direction:inbound,Caller-Destination-Number:5555551212" }
String Active_Call_ID "Caller ID [%s]"                (Phone) { freeswitch="active:Call-Direction:inbound,Caller-Destination-Number:5555551212" }

For messages and message waiting indicator (MWI) the voice mail account is specified:

Number Voice_Messages "Unread Messages [%d]" (Phone) {freeswitch="message_waiting:1000@pbx.mydomain.com"}

To send API commands to FreeSWITCH add a simple api item:

String FS_API  "FS API [%s]" (phone) {freeswitch="api"}

There are three supported protocol types, "active", "message_waiting" and "api"

  • Active types:
    • Filtered
      • calls can be filtered on freeswitch event headers, multiple headers can be used, all must match.
      • filters format is "Key:Value,Key:Value,...."
      • Ex: Switch Incoming_Call "Home Phone" (Phone) {freeswitch="active:Call-Direction:inbound,Caller-Destination-Number:5555551212"}
      • see Freesiwtch Events for more info on event headers
    • Non Filtered
      • if no filter is given any inbound call will be used
      • for multiple active calls the most recent active call's callerid will be displayed Ex: Incoming_Call "Home Phone" (Phone) {freeswitch="active}
    • Item Types
      • Switch will be on for an active call, off if no active calls
      • Call, this shows the destination and origination numbers
      • Text, this shows the Caller-ID fields (name : number) if sent by caller (regional specific I would imagine)
  • Message_Waiting types:
    • Number, this shows the number of unread voice mails
    • Switch, on if MWI (message indicator) is yes.
  • API types
    • String , sending a string to this will send a command to FS, the result will be sent back to this item as a comma seperated list
    • API types are really meant to be used in rules, an example might be:
      • sendCommand(FS_API,"conference test-conf dial sofia/gateway/myvoipprovider/5555551212 5551212 5551212")
      • This would tell freeswitch to dial 5555551212 into a conference named "test-conf"
      • the conference info would be returned as a update to the item.
    • see Freeswitch Commands for more info.

message_waiting takes an extra argument which is the mailbox we want to check against. This is usually the extention@domain