Sun GlassFish Web Space Server 10.0 Call Add-On Guide

Chapter 3 Using the Call Feature

You can use the Call feature after installing and configuring the Call add-on as described in Chapter 2, Installation and Configuration. For a user to access the Call feature, client machines need to have SIP client installed on them and configured for the client user. This chapter provides an example of making a call using the Call feature, along with the instructions to configure SIP client.

The following topics are covered in this chapter:

Configuring SIP Client for a Web Space Server User

For Web Space Server users to see each others online, and to make calls to each other, they need to install SIP client on their respective machines and need to configure it with their user details. Users are recommended to use Windows compatible version of X-Lite as the SIP client. Download and install SIP client on a machine from which you want to access an instance of Web Space Server. In this case, you are recommended to use X-Lite as the SIP client on a Windows machine. Download X-Lite to a preferred location on your machine, and run the executable to install it in a few self instructive steps.

Call functionality works in two modes:

Authentication mode

In authentication mode, the credentials (username, password) entered in X-Lite client are validated against the actual username and password of the user present in the lportal database.

Non-authentication (default) mode

This is the simple authentication mode, in which the password is not validated. Call functionality uses this authentication mode by default.

ProcedureTo Configure X-Lite for a Web Space Server User

This task assumes a scenario in which Web Space Server is installed on a server, and it is accessed by two Windows machines, Machine A and Machine B. Perform this task on each machine to configure the X-Lite client.

  1. Right-click the SIP softphone and select SIP Account Settings.

  2. Click the Add button on the SIP Accounts page.

  3. Add the account details.

    You need to specify the User Details and Domain Proxy details. In the User Details section; you need to specify the Display Name, User Name, Password, and Domain. In the Domain Proxy section; select the proxy button, and specify the proxy address. The proxy address is specified in the format of machine-name:5060, where machine-name is the machine on which SailFin is deployed on call-registrar. In this example, example132.com:5060 is the proxy address.


    Note –

    System port 5060 is the default gateway commonly associated with the Session Initiation Protocol.


    In this example, we have two users; Paul and James with username and email id as paul and paul@example.com, and james and james@example.com respectively, with the domain name example.com.

    Default configuration for X-Lite client do not require password authentication. The following table lists the values you need to specify for user details in the SIP account properties window in case of the default configuration:

    User Details

    Value Required on Machine A

    Value Required on Machine B

    Display Name 

    display name

    display name

    User Name 

    paul@example.com 

    james@example.com 

    Password 

    not required 

    not required 

    Authorization user name 

    not required 

    not required 

    Domain 

    example.com 

    example.com 

    You can make the configuration changes which makes the X-Lite client to work in the authentication mode. For the instruction to make these configuration changes, see To Make Configuration Changes for Authentication Mode. The following table lists the values you need to specify for user details in the SIP account properties window if you are making configuration changes which makes the X-Lite client to require password authentication:

    User Details

    Value Required on Machine A

    Value Required on Machine B

    Display Name 

    display name

    display name

    User Name 

    paul@example.com 

    james@example.com 

    Password 

    password

    password

    Authorization user name 

    paul@example.com 

    james@example.com 

    Domain 

    example.com 

    example.com 

  4. Click Apply and OK buttons.

  5. Close the SIP Accounts window.

    You can see the Registering... message on the SIP softphone display, which turns to Ready after the machine is authenticated.

    Along with that, your SIP account information is displayed on the softphone display in the format Your user name is: SIP user name.

    If any of the user details and the proxy address is not specified

ProcedureTo Make Configuration Changes for Authentication Mode

  1. Navigate to glassfish-dir\domains\domain1\applications\j2ee-modules\webspace\WEB-INF\classes folder on the machine on which Web Space Server is installed, and open the portal-ext.properties file using any text editor. The portal-ext.properties file contains the following lines:


    login.events.post=com.liferay.portal.events.LoginPostAction,com.liferay.portal.events.DefaultLandingPageAction
    #login.events.post=com.liferay.portal.events.LoginPostAction,com.liferay.portal.events.DefaultLandingPageAction,
    com.sun.portal.events.CallUserLoginAction

    Comment the first line, and uncomment the second line. The changed contents of the portal-ext.properties file look as follows:


    #login.events.post=com.liferay.portal.events.LoginPostAction,com.liferay.portal.events.DefaultLandingPageAction
    login.events.post=com.liferay.portal.events.LoginPostAction,com.liferay.portal.events.DefaultLandingPageAction,
    com.sun.portal.events.CallUserLoginAction

    Save the portal-ext.properties file.

  2. Restart GlassFish.

  3. On the machine on which call-registrar is deployed on SailFin, navigate to webspace-dir/webspace/call-registrar/distribution/deploy/call-registrar/WEB-INF folder. Open the sip.xml file, and uncomment the following lines:


    <!--  <security-constraint>
    
            <display-name>UserConstraint</display-name>
            <resource-collection>
                <servlet-name>RegistrarServlet</servlet-name>
                <sip-method>REGISTER</sip-method>
            </resource-collection>
            <auth-constraint>
                <description>authentication-configuration</description>
                <role-name>1234</role-name>
            </auth-constraint>
        </security-constraint>
        <login-config>
            <auth-method>DIGEST</auth-method>
            <realm-name>PortalRealm</realm-name>
        </login-config>
        <security-role>
            <description/>
            <role-name>1234</role-name>
        </security-role> -->
  4. Open the sun-sip.xml file, and uncomment the following lines.


    <!-- <security-role-mapping>
            <role-name>1234</role-name>       
            <group-name>1234</group-name>
        </security-role-mapping>  -->
  5. Login to Sailfin admin console.

  6. Navigate to Configuration -> Security -> Realms, and create PortalRealm.

    Figure 3–1 Creating PortalRealm

    Creating PortalRealm

    You need to select com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm as the Class Name. In the Properties specific to this Class, Encoding need to be set to HASHED.

  7. Save the changes.

  8. Create a JDBC connection pool. To create the JDBC connection pool, navigate to Resources -> JDBC -> Connection Pools, and click New.

    You are prompted to create a new JDBC connection pool.

  9. Select Javax.sql.DataSource as the Resource Type, and MySQL as the Database Vendor. Specify a name for the connection pool, and click Next.

    For example, we are creating a connection pool named webspace.

  10. Click Finish to complete creating the new JDBC connection pool.

  11. Select the JDBC connection pool, and navigate to the Additional Properties tab.

    Add properties with the following values, and remove all the remaining properties:

    Property Name

    Vaule

    Description

    User 

    root 

    Database username 

    Port 

    3306 

    MySQL port 

    Url 

    jdbc:mysql://machine ip address/lportal

    IP address of the machine on which the portal is running 

    Password 

    abc123 

    Database password 

  12. Save the changes.

  13. Navigate to the General tab, and click the Ping button to test the connection.

  14. Navigate to Resources -> JDBC -> JDBC Resources, and click New to create a new jdbc resource.

    Figure 3–2 Creating a JDBC Resource

    Creating a JDBC Resource

  15. Specify a JNDI Name, and select a Pool Name.

    In the earlier example, a connection pool named webspace is created. You can select that connection pool.

  16. Click OK to create the JDBC resource.

  17. Navigate to the General tab, and click the Ping button to test the connection.

  18. Login to MySQL, and type grant all privileges on *.* to root@machine-name identified 'abc123'; in the command prompt, where root is the database username, and abc123 is the password.

  19. Restart GlassFish and Sailfin. Now the X-Lite client requires password authentication.

  20. Configure the X-Lite client using the steps in To Configure X-Lite for a Web Space Server User.

Making Calls Using the Call Feature

Web Space Server users who have configured a SIP client for their account can make calls to other users using the softphone interface of the SIP client.

Web Space Server users can use the Call feature through some of the collaboration portlets available on Web Space Server. For example, users can post a bolg using the Blogs portlet, or can make a posting using the Message Boards portlet. Users who belong to the same Community can see the other users who are online on a blog or a message board, and a Call link appears next to their profile. On clicking the call link, the softphone associated with the SIP client displays, and users can make calls using the softphone.

This section provides an example that illustrates the use of Call feature.

ProcedureTo Setup and Use the Call Feature

This task provides a simple scenario for making a call using the Message Boards portlet. Similarly, Web Space Server users can use the Blogs and Recent Bloggers portlets for making calls.

This scenario first creates two new users, and assigns them to a Community with Community Member and Community Administrator roles. In this setup, login and access instances of Web Space Server on two separate machines on which the SIP client is installed and configured for the respective Web Space Server user. The two users will be able to see each other online, and can click the Call link to make a call to each other.

  1. Login to Web Space Server as the admin user.

  2. From the Welcome menu, navigate to Control Panel -> Users under Portal category.

  3. Add two new users.

    1. Click Add to add a user.

    2. Provide Paul as the username and paul@example.com as the email ID. Set password for the user.

    3. Repeat steps a and b adding James as the username and james@example.com as the email ID.

  4. In the Control Panel, navigate to Communities under Portal, and add users to a Community.

    In this example, add the users Paul and James to Guest Community, which is the default community.

    1. Choose Actions -> Assign Members.

    2. Select the Available tab.

      All users are listed.

    3. Select the check boxes for Paul and James, and click the Update Associations button.

  5. Navigate back to the Guest Community, and choose Assign User Roles from the Actions menu.

  6. Select the Community Administrator role.

  7. Select Available under Users.

  8. Select the check boxes for Paul and James, and click the Update Associations button.

  9. Configure new users for SIP client on two separate machines, say Machine A and Machine B. X-Lite (for Windows) is the recommended SIP client. For the instructions to configure X-Lite client, see Configuring SIP Client for a Web Space Server User.

  10. Login as Paul on Machine A, and as James on Machine B.

    1. As Paul, add the Message Boards portlet to a public page.

    2. Select Add Category, provide the name, add details for it, and click Save.

    3. Click the category link, and click Post New Thread.

    4. Add a message and click Save.

  11. Reply to the thread as James from Machine B.

  12. Now Paul can see a Call link on his page for the reply from James.

  13. Click the Call link to start a conference with James.