IP Telephony Cookbook by Saverio Niccolini, Jorg Ott, et al - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

200 OK

Figure 6.1 REFER-based click-to-dial

|- 6.2.2 Presence

It is also possible to display the presence of SIP users in a Webpage (for example, in a phonebook). Displaying the on-line status of subscribers allows calling parties to determine availability and willingness to have a conversation conveniently.The status may be shown, for example, in the calling party’s phonebook or on the called party’s homepage. Linking on-line users to click-to-dial applications greatly integrates telephony with the Web and introduces convenience to users.

When a SIP phone registers, the SIP server records this information into a database.The Web server can then access the database to see if a user is online or offline.

Go to iptel.org, create a new account, and insert some entries into your phone-book to see how it works.

P.176

[IP Telephony Cookbook] / Setting up Value-added Services

|- 6.2.3 Missed calls

‘Missed calls’ is a feature that allows a user to display the list of call attempts that were made during the period when he was not online (registered in SIP).The list can be presented on a Web page.

Recording missed calls has a lot in common with accounting. Servers doing accounting log some information when a call is successfully established and torn down.When a calling party gets a negative final response to his call, or does not receive any reply at all (timeout), then the server also records this event with a flag, indicating that it was a missed call.This information can be later used to compile the list of missed calls.

|- 6.2.4 Serweb

Serweb is a Web front-end for a SIP Express Router (see Section 4.6.2 for more details). Serweb creates a user interface for users of the proxy server, where they can manage their account, change their configuration and do many advanced things.

|- 6.2.4.1 Installation

Serweb is a set of php scripts.To run it, you will need Apache Web server with php and mysql support. Because a SIP Express Router and serweb talk together using a FIFO interface, the SIP

Proxy and the Web server must be running on the same machine.

Get serweb from http://developer.berlios.de/projects/serweb and untar the archive. It is recommended not to untar it to the document root of your Web server. Alternatively you can get serweb using CVS:

lexport CVSROOT=:pserver:anonymous:@cvs.berlios.de:/cvsroot/serweb cvs login

cvs co iptel

|- 6.2.4.2 Configuration

The entire configuration of serweb is in config.php file in html subdirectory.You will need to configure the following:

- Host on which MySQL server is running: $this->db_host="localhost";

- Path of the user interface on the Web server: $this->root_path="/";

- Root URI of the Web server: $this->root_uri="http://www.foobar..."

- Path of serweb images on the Web server: $this->img_src_path = $this-

>root_path."iptel_img/";

- Path of java script files of serweb: $this->js_src_path = $this-

>root_path."iptel_js/";

- Path of ccs files of serweb: $this->style_src_path = $this-

>root_path."iptel_styles/";

P.177

index-178_1.png

[IP Telephony Cookbook] / Setting up Value-added Services

It is necessary to create some aliases in the configuration file of Apache Web server: Alias /iptel_img "/var/www/iptel/html/img"

Alias /iptel_styles "/var/www/iptel/html/styles"

Alias /user "/var/www/iptel/html/user_interface"

Alias /admin "/var/www/iptel/html/admin"

Do not forget to update the directory path according to your real settings and make sure that you have register_globals and short_open_tag set to On in your php.ini file.

|- 6.2.4.3 Operation

To login into serweb open: http://<your_server>/user in your Web browser.

You will be prompted for username and password.The username and password is same as the one you are using in your SIP user agent to register at the server.

Figure 6.2 Serweb - My Account

P.178

index-179_1.png

[IP Telephony Cookbook] / Setting up Value-added Services

The My Account tab (see Figure 6.2) allows users to change their preferences and modified registered contacts.They can also see aliases they created and permissions for calling to the PSTN.

Users can also create their own phone book (see Figure 6.3). In the phonebook, you can see the presence status of each user. If the user is currently registered, then you will see online in the status column. If he is not registered then you will see offline and if the user does not belong to administrative domain of the server, then you will see non-local.

Figure 6.3 Serweb - Phonebook

Clicking on the address of a user will establish a phone call between your and his phone, provided that your phone supports REFER, as described in Section 6.2.1.

The missed calls plane (see Figure 6.4), allows users' to see their missed calls. Again, clicking on an entry will connect you with that user and status describes presence of the user as described in the previous section.

P.179

index-180_1.png

[IP Telephony Cookbook] / Setting up Value-added Services

Figure 6.4 Serweb - Missed calls

When anyone sends a SIMPLE message to a user that is currently not online, the server will store the message and send it later when the recipient comes online. In the plane message store (see Figure 6.5), you can see all messages that are stored for you.

|- 6.2.5 SIP Express Router message store

Message store has been implemented as a separate module for a SIP Express Router.To use the module, you will need to load the module:

loadmodule "/usr/local/lib/ser/modules/msilo.so"

Configure the address of the server (it will be used when sending stored messages) and the URL

of the database:

modparam("msilo", "registrar", "sip:registrar@<your_domain>") modparam("msilo", "db_url", "sql://ser:passwd@dbhost/ser") P.180

index-181_1.png

[IP Telephony Cookbook] / Setting up Value-added Services

Figure 6.5 Serweb - Message store

Then, when the server receives a MESSAGE request and it cannot deliver it because the recipient is offline, it will save the message:

if (!lookup("location")) {

if (method == "MESSAGE") {

if (!t_newtran()) {

sl_reply_error();

break;

};

if (m_store("0")) {

t_reply("202", "Accepted for Later Delivery"); break;

};

t_reply("503", "Service Unavailable");

break;

};

};

When the lookup of recipient's location fails (the recipient is not registered), a new transaction is created (needed for msilo module). Save the message using the m_store command, and reply with 202 accepted .

P.181

[IP Telephony Cookbook] / Setting up Value-added Services

Each time we call save (location), we have to check if the previously available user is registered again and if so, then send the stored messages.The following example shows how to do that: if (!save("location")) {

sl_reply_error();

};

m_dump();

Command m_dump checks if the registering user has any stored messages and if so, sends them.

|- 6.3 Voicemail

Another Internet application which lends itself for integration with telephony is e-mail. A traditional PSTN application, which can be replaced with VoIP and e-mail, is voicemail.

Traditional PSTN voicemail systems feature fairly inconvenient user interface for message retrieval: IVR (Interactive Voice Responder). Calling parties have to navigate through an automated voice menu, listen to lengthy announcements, type digits as prompted and be very patient to achieve very simple tasks. It is undoubtedly more convenient to deliver recorded messages to the called to party by e-mail.The called party can then listen, store and process the received messages at his convenience.The following picture shows the data flow in a voicemail-to-e-mail scenario. An open-source voicemail-to-e-mail application, SEMS, is available from iptel.org.

SEMS stands for SIP Express Media Server. It is an application framework that offers easily-built applications dealing with media streams.The framework itself provides only minimal functionality for accessing and manipulation of media streams and signalling. High-level logic is stored in additional modules that can be dynamically loaded.

Examples of such modules are voicemail, announcement server and ISDN gateway.

Some other voicemail systems exist including OpenAM, which is available from the OpenH323

Website and a voicemail system built-in inside the VOCAL system.

Unfortunately, they are not easy to set up and they are not yet ready to be used in a production environment if you need a completely integrated product.They do not work without bugsand they can easily be customised for small environment scenarios.

P.182

index-183_1.png

[IP Telephony Cookbook] / Setting up Value-added Services

Figure 6.6 Voicemail

P.183

[IP Telephony Cookbook] / Integration of Global Telephony

Integration of Global Telephony -}