fs_uacsta

FreeSWITCH uaCSTA for Siemens OpenStage Phones

4 years after

fs_uacsta

FreeSWITCH uaCSTA via mod_erlang_event module for Siemens OpenStage SIP phones.

Limitations

  • Works only with Siemens OpenStage SIP phones, because it's not standard uaCSTA.
  • No response of the NOTIFY request with the uaCSTA is processed, so this is fire and forget. This is a limitation of FreeSWITCH.
  • When the connection to the FreeSWITCH goes down, the gen_server process will automatically stop, but will not automatically reconnect, once the FreeSWICTH is up again.
  • Only a few uaCSTA requests are implemented, which made sense with the limitations described above.
  • No uaCSTA events are processed, because OpenStage phones do not send any events.

Implemented uaCSTA Requests

  • AnswerCall
  • MakeCall
  • SetForwarding

Usage

Before you can use fs_uacsta, you need to to the following.

FreeSWITCH Configuration

You need to edit /etc/freeswitch/autoload_configs/modules.conf and add the following:

<!--
    !!!!!!!!!!!!!!!
    !!! WARNING !!!
    !!!!!!!!!!!!!!!

    Only the necessary parts of the xml to run mod_erlang_event is shown here.
    You probably want more modules loaded, like mod_sofia, or this will not
    make a whole lot of sense. Please consult the FreeSWITCH wiki at
    http://wiki.freeswitch.org on how to accomplish this.
-->
<configuration name="modules.conf">
    <modules>
        <load module="mod_erlang_event"/>
    </modules>
</configuration>

You can copy and paste this to /etc/freeswitch/autoload_configs/erlang_event.conf:

<configuration name="erlang_event.conf">
    <settings>
        <param name="listen-ip" value="0.0.0.0"/>
        <param name="listen-port" value="8031"/>
        <param name="nodename" value="[email protected]$${local_ip_v4}"/>
        <param name="cookie" value="pantech"/>
        <param name="encoding" value="binary"/>
    </settings>
</configuration>

Erlang

Get it from GitHub:

$ git clone https://github.com/matthias-endler/fs_uacsta.git

Compile it:

$ cd fs_uacsta
$ make

Then in the start an Erlang shell:

$ erl -pa ebin -name [email protected] -setcookie pantech

Make sure you use your local ip address instead of 2.2.2.2.

Start fs_uacsta:

1> application:start(fs_uacsta).
ok

Connect to FreeSWITCH mod_sofia SIP profile (assuming the ip address of FreeSWITCH is 1.1.1.1 and the profile name is internal):

2> {ok, Ref} fs_uacsta:connect('[email protected]', <<"internal">>).
{ok, <0.114.0>}

Make a call from a phone which is registered to sip:[email protected] to extension 1001:

3> fs_uacsta:make_call(Ref, <<"1000">>, <<"1.1.1.1">>, <<"1001">>).
ok

Call the phone registered at sip:[email protected] and answer it:

4> fs_uacsta:answer_call(Ref, <<"1000">>, <<"1.1.1.1">>).
ok

Supported forward types are:

  • forwardImmediate
  • forwardBusy
  • forwardNoAns

Set the immediate forwarding on a phone registered at sip:[email protected] to extension 1001:

5> fs_uacsta:set_forwarding(Ref, <<"1000">>, <<"1.1.1.1">>, forwardImmediate, <<"1001">>, true).
ok

And cancel the forwarding again:

6> fs_uacsta:set_forwarding(Ref, <<"1000">>, <<"1.1.1.1">>, forwardImmediate, <<"1001">>, false).
ok

Other Documentation

Contributors

License

This project is licensed under the ISC License. See LICENSE for details.


Copyright © 2013, Matthias Endler. All rights reserved.