Adding Users to the Fusion Web Gateway Sample App

Introduction

There is, as part of, the standard Fusion Web Gateway (FCSDK) packaging, a sample app called csk-sample.war. This app provides a voice, video and presence web client, and a server component that authenticates the user. The credentials and capabilities of the users are defined in the file csdksample-db.xml. If you wish to use the sample app, you should deploy both of these files to the Fusion Application Server (FAS), as described below.

Note: The files are automatically deployed to the CafeX Trials Environment by the Trials Kit installer.

 

Defining Users

A user is defined by a stanza in csdksample-db.xml as follows:

    <user>
        <name>user1</name>
        <password>123</password>
        <inboundCallingEnabled>true</inboundCallingEnabled>
        <outboundDestinationPattern>all</outboundDestinationPattern>
        <sipUser>1001</sipUser>
        <sipDomain>192.168.1.99</sipDomain>
        <authUser>1001</authUser>
        <authRealm>cafex.com</authRealm>
        <authPass>123456</authPass>
        <sipPresenceUser>user1</sipPresenceUser>
        <sipPresenceDomain>presence.example.com</sipPresenceDomain>
        <aedMaxMessageAndUpload>1024</aedMaxMessageAndUpload>
        <aedMaxData>65536</aedMaxData>
        <aedSessionIdRegex>.*</aedSessionIdRegex>
    </user>

The XML tags (apart from <name> and <password>) correspond to the requested client capabilities passed to the Web Gateway in JSON using the Web Gateway’s REST API, which are described in Chapter 1 of the technical publication Developing with Fusion Client SDK.

Briefly, these tags define the user’s capabilities as follows:

 

<username>, <password> Used for local authentication only
<sipUser>, <sipDomain> Corresponding SIP user and domain
<authUser>, <authRealm>, <authPass> Used by SIP digest authentication
<sipPresenceUser>, <sipPresenceDomain> Used for instant messaging and presence
<inboundCallingEnabled> If true, generates a SIP REGISTER
<outboundDestinationPattern> Either all or a permitted SIP URI
<aed*> Used for Application Event Distribution

 

Once you have set your users’ credentials and capabilities by editing csdksample-db.xml, you should upload the file to FAS, as described in the following section.

 

Uploading the Users’ Credentials to FAS (note the below diagrams refer to the older fusionwebapp-db.xml instead of the modern csdksample-db.xml).


Deploying the sample app and the users’ credentials are described towards the end of Chapter 3 of the technical publication Installing Fusion Client SDK.  If you need to update the users’ credentials, you should login to the FAS console, and replace the csdksample-db.xml file with your edited version.


Login to the FAS console at https://ip:9990/console using your administrator credentials (admin/admin for the Trials Kit), and click on ‘Manage Deployments’:

 

 

Select fusionwebapp-db.xml, and click on ‘Update’.  Choose your local copy of the file and click on ‘Next’, and then click on ‘Save’ to upload the file:

 

 

You should now be able to use the updated credentials.

 

Finding the Deployed Credentials
It may be that you do not have a local copy of csdksample-db.xml, in which case you will have to retrieve the copy on the server.  This is not entirely straightforward, as FAS deploys it to a randomly-named, obscure directory. There are a number of ways to do this and the below describes one of them.

First you need to obtain the Sample Application's Web Application ID, you will have added this to the Gateway Configuration during deployment of the Sample Application (or in the case of Trials it will have been added automatically) and can be found in the Gateway UI (https://IP:8443/web_plugin_framework/webcontroller/) under Gateway -> general Administration -> Web Application IDs.

Once you have the Sample Application's Web Application ID, SSH to the FAS server using the appropriate Linux credentials, and navigate to the directory in which you installed FAS (this is not necessary but will remove possibility of finding files in other FCSDK/Trials installations on the same machine), then run the find command substituting <Application ID> for the ID you found earlier:

[root@fas FAS]# find . | xargs grep -l <Application ID>

If you did not navigate to the FAS directory you need to substitute "." for "/" in the above command. An example output is shown below:

[root@fas FAS]# find . | xargs grep -l FUSIONCSDK-A8C1D
./domain/servers/appserver-server1/tmp/vfs/temp4238ce7f14d28f4c/content-de6fd3f9691f31d2/WEB-INF/classes/fusionwebapp-db.xml
./domain/servers/appserver-server1/log/server.log.1
./domain/servers/appserver-server1/log/server.log
./domain/servers/appserver-server1/data/content/a9/e8f411ad6162ed9941aaed9cc06c311f03c766/content
./domain/data/content/a9/e8f411ad6162ed9941aaed9cc06c311f03c766/content

You will want to copy one of the content files, once copied you can update the copy and redeploy using the steps in the previous section.

Alternative XML configuration step:

. /etc/fas.conf && vi $JBOSS_HOME/domain/data/content/`grep -o "csdksample-db.xml[^_]*_[^_]*content sha1=\"[0-9a-zA-Z]*\"" <(paste -sd_ $JBOSS_HOME/domain/configuration/domain.xml) | tr -d '_' | sed "s/.*sha1=\"\([0-9a-zA-Z]\{2\}\)\([a-zA-Z0-9]*\)\"/\1\/\2/g"`/content

 

Comments are disabled on these articles if you require help contact support@cafex.com.

Have more questions? Submit a request

Comments

Powered by Zendesk