JavaScript Code Snippets

To use the Cisco Unified CM WebDialer HTML interface, you can implement either of the scripts below depending on how many nodes are in your cluster. If you have one node in the cluster, go to Single Cluster. If you have more than one node in your cluster, go to Multiple Cluster. The scripts will pop up a new window allowing the end user to dial a number directly from a web page.

Single Cluster

JavaScript:

1
2
3
4
5
6
7
8
9
10
function launchWebDialerWindow( url ) {
webdialer=window.open( url, "webdialer", "status=no, width=420, height=300,
scrollbars=no, resizable=yes, toolbar=no" );
}
function launchWebDialerServlet( destination ) {
url = 'http://<%=server_name%>/webdialer/Webdialer?destination=' +
escape(destination);
launchWebDialerWindow( url );
}

HTML:

1
2
3
<A href="javascript:launchWebDialerServlet( <%= userInfo.TelephoneNumber %> )"><%=
userInfo.TelephoneNumber %></A>

Multiple Cluster

JavaScript:

1
2
3
4
5
6
7
8
9
function launchWebDialerWindow( url ) {
webdialer=window.open( url, "webdialer", "status=no, width=420, height=300,
scrollbars=no, resizable=yes, toolbar=no" );
}
function launchWebDialerServlet( destination ) {
url= 'http://<%=server_name%%gt;/webdialer/Redirector?destination='+escape(destination);
launchWebDialerWindow( url );
}

HTML:

1
2
<A href="javascript:launchWebDialerServlet( <%= userInfo.TelephoneNumber %> )"><%=
userInfo.TelephoneNumber %></A>