Namespace $.fn.cwic
Defined in: cwic.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
CWIC is a jQuery plugin to access the Cisco Web Communicator
Audio and Video media require the CWC browser plugin to be installed Fields overviewMethods overviewAll cwic methods are called in the following manner$('#selector').cwic('method',parameters)Events overviewAll events are part of the cwic namespace. |
| Method Attributes | Method Name and Description |
|---|---|
| <inner> |
about()
Versions, states and capabilities
|
| <inner> |
addPreviewWindow(args)
Assign a video window object to preview (self view)
|
| <inner> |
createVideoWindow(settings, onload)
Creates an object that can be passed to startConversation, addPreviewWindow or updateConversation('addRemoteVideoWindow').
|
| <inner> |
Ends a conversation.
|
| <inner> |
init(options)
Wait for the document to be ready, and try to load the plugin object.
|
| <inner> |
registerPhone(args)
Register phone to CUCM (SIP register)
|
| <inner> |
removePreviewWindow(args)
Remove a video window object from preview (self view)
|
| <inner> |
sendDTMF(digit, id)
Sends digit (String) as Dual-Tone Multi-Frequency (DTMF)
|
| <inner> |
shutdown()
Shuts down the API
|
| <inner> |
startConversation(conversation)
Start a conversation with a participant.
|
| <inner> |
switchPhoneMode(options)
Switch mode on a session that's already authorised
|
| <inner> |
unregisterPhone(args)
Unregisters a phone from CUCM:
|
| <inner> |
updateConversation(update, id)
Updates an existing conversation.
|
| Event Attributes | Event Name and Description |
|---|---|
|
conversationEnd(event, conversation)
A conversation has ended.
|
|
|
conversationIncoming(event, conversation, container)
A new conversation is being received, but is not started yet.
|
|
|
conversationStart(event, conversation, container)
A conversation has just started.Note the conversation may not be connected yet, for example it is in the Alerting state.The conversation container is passed as an extra event data.
|
|
|
conversationUpdate(event, conversation, container)
One or more properties of a conversation have changed, e.g.
|
|
|
error(event)
|
|
|
system(event)
Called when the phone changes state.
|
Namespace Detail
$.fn.cwic
CWIC is a jQuery plugin to access the Cisco Web Communicator
Audio and Video media require the CWC browser plugin to be installed
The event handlers are passed the conversation properties as a single object. For example:
Audio and Video media require the CWC browser plugin to be installed
Fields overview
Methods overview
All cwic methods are called in the following manner$('#selector').cwic('method',parameters)Events overview
All events are part of the cwic namespace. For example:- conversationStart.cwic
- system.cwic
- error.cwic
Example conversation events:
These are conversation-related events that can be triggered by the SDK.The event handlers are passed the conversation properties as a single object. For example:
- Parameters:
- {String} method
- The name of the method to call
- {Variable} arguments
- trailing arguments are passed to the specific call see methods below
Method Detail
<inner>
{aboutObject}
about()
Versions, states and capabilities
- Returns:
- {aboutObject}
<inner>
addPreviewWindow(args)
Assign a video window object to preview (self view)
- Parameters:
- {Object} args
- arguments object
- {DOMWindow} args.window Optional
- DOM Window that contains the plugin Object defaults to current window
- {String|PluginObject} args.previewWindow
- id or DOM element of preview window
<inner>
createVideoWindow(settings, onload)
Creates an object that can be passed to startConversation, addPreviewWindow or updateConversation('addRemoteVideoWindow').
The object is inserted into the element defined by the jQuery context - e.g. jQuery('#placeholder').cwic('createVideoWindow') inserts the videowindow under jQuery('#placeholder')
- Parameters:
- {Object} settings Optional
- Settings to use when creating the video render object
- {String} settings.id Optional, Default: generated
- The DOM id of the element to be created
- {Function} settings.success Optional
- Called when the object is loaded and ready for use plugin id is passed as a parameter
- {Function} onload Optional
- Optional, not recommended for video windows created in the same window as the main phone plugin.
Mandatory in popup windows or iframes, must call parent or opener window._cwic_onPopupVideoPluginLoaded in the onLoad handler.
Single parameter is the videoplugin object that must be passed to the parent handler.
NOTE: If video isn't supported on the platform, this function will just 'do nothing' and the success() callback will never be called.
<inner>
endConversation()
Ends a conversation.
<inner>
init(options)
Wait for the document to be ready, and try to load the plugin object.
If cwic was successfully initialized, call the options.ready handler,
passing some stored properties (possibly empty),
otherwise call the options.error handler
If cwic was successfully initialized, call the options.ready handler,
passing some stored properties (possibly empty),
otherwise call the options.error handler
- Parameters:
- {Object} options
- Is a set of key/value pairs to configure the phone registration. See $.fn.cwic-settings for options.
<inner>
registerPhone(args)
Register phone to CUCM (SIP register)
- Parameters:
- args
- A map with:
- {String} args.user
- The CUCM end user name (required)
- {String|Object} args.password
- String - clear password. Object - {encrypted: encoded password, cipher:"cucm"}
- {boolean} args.authenticate Optional
- A flag to specify if user should be authenticated against CUCM (optional). If the user is already authenticated then the application has the option to bypass this additional authentication against Cisco Unified Communications Manager. Authentication can be made against the CCMCIP interface of CUCM (HTTP Basic). This additional authentication requires a server-side component to be deployed (see the node parameters of the init function).
- {String|Object|Array} args.cucm
- The list of CUCM(s) to attempt to register with (required).
If String, it will be used as both the CCMCIP and TFTP address.
If Array, a list of String or Object as described above. - {String[]} args.cucm.tftp
- TFTP addresses
- {String[]} args.cucm.ccmcip Optional
- CCMCIP address (will use tftp values if not present).
- {String} args.mode Optional
- Register the phone in this mode. Available modes are "SoftPhone" or "DeskPhone".Default of intelligent guess is applied after a device is selected.
- {Function} args.devicesAvailable(devices) Optional
- Callback called after successful authentication.
If this callback is not specified, cwic applies the default device selection algorithm. An array of device objects is passed so the application can select the device.
Return one of:- device object to register with that device
- null to fall back to default selection algorithm
- false to stop registration (raises an error).
- {Function} args.error(err) Optional
- Callback called if the registration fails.
- {Boolean} args.useCcmcip
- Authenticate using ccmcip (overrides settings if present).
- {Boolean} args.forceRegistration
- Specifies whether to forcibly unregister other softphone instances with CUCM. Default is false. If you use false and your CUCM device is already in use by another client, the error callback will be invoked with an eDeviceAlreadyRegistered error. Please note that this feature requires CUCM 9.0 and currently is only supported on Windows. See GracefulRegistration doc for more info.
- {Function} args.success(registration) Optional
- Callback called when registration succeeds. A registration object is passed to the callback:
registerPhone examples
<inner>
removePreviewWindow(args)
Remove a video window object from preview (self view)
- Parameters:
- {Object} args
- arguments object
- {DOMWindow} args.window Optional
- DOM Window that contains the plugin Object defaults to current window
- {String|Object} args.previewWindow
- id or DOM element of preview window
<inner>
sendDTMF(digit, id)
Sends digit (String) as Dual-Tone Multi-Frequency (DTMF)
- Parameters:
- {String} digit
- Dual-Tone Multi-Frequency (DTMF) digit to send. Does not trigger any event.
- {String|Object} id Optional
- a {String} conversation identifier or an {Object} containing an id property
<inner>
shutdown()
Shuts down the API
- Unregisters the phone
- Unbinds all cwic events handlers
- Clears all cwic data
- Releases the CWC browser plugin instance
<inner>
startConversation(conversation)
Start a conversation with a participant.
If conversation contain both an id and a state property, cwic assumes you want to answer that incoming conversation, in this case starting the passed conversation means accepting(answering) it.
If conversation contain both an id and a state property, cwic assumes you want to answer that incoming conversation, in this case starting the passed conversation means accepting(answering) it.
- Parameters:
- {Object} conversation Optional
- Can be a new object to start a new conversation or an existing conversation which you wish to answer
- {String} conversation.id Optional
- Unique identifier of the conversation.
- {Object|Array} conversation.participant
- Conversation participants, does not include the local user. May be asingle participant Object or an array of participant Objects.
- {String} conversation.participant.recipient
- The phone number or jabber id of the participant.
- {String} conversation.participant.name Optional
- The participant name.
- {String} conversation.participant.photosrc Optional
- A suitable value for the src attribute of an
element.
- {String} conversation.media Optional
- Media used to start the conversation.Contains the media used to join participants: audio, video or chat.
If not specified, depends on all participant's recipients: if phone number, default media is "audio", if jabber id, default media is "chat". - {String} conversation.state Optional
- Current state of the conversation. Can be OffHook, Ringing, Connected, OnHook, Reorder.
- {Date} conversation.start Optional
- Start time. Defined on resolution update only.
- {Date} conversation.connect Optional
- Media connection time. Defined on resolution update only.
- {Object} conversation.videoResolution Optional
- Resolution of the video conversation, contains width and height properties. Defined on resolution update only.
- {String|Object} conversation.container Optional
- The HTML element which contains the conversation (optional). Conversation events are triggered on this element. If String, specifies a jQuery selector If Object, specifies a jQuery wrapper of matched elements(s). By default container is $(this), that is the first element of the matched set startConversation is called on.
- {String} conversation.subject Optional
- The subject of the conversation to start.
- {Function} conversation.error(status) Optional
- A function to be called if the conversation cannot be started (optional). An error status (String) is passed.
- {String} conversation.videoDirection Optional
- The video media direction: 'Inactive' or undefined (audio only by default), 'SendOnly', 'RecvOnly' or 'SendRecv'.
- {Object} conversation.remoteVideoWindow Optional
- The video object (must be of mime type application/x-cisco-cwc-videocall).
- {DOMWindow} conversation.window Optional
- DOM window that contains the remoteVideoWindow (default to this DOM window) required if specifying a video object on another window (popup/iframe).
<inner>
switchPhoneMode(options)
Switch mode on a session that's already authorised
- Parameters:
- options
- {Function} options.progress Optional
- A handler called when the mode switch has passed pre-conditions.
If specified, the handler is called when the switchMode operation starts. - {Function} options.success Optional
- A handler called when mode switch complete with registration as a parameter
- {Function} options.error Optional
- A handler called when the mode switch fails on pre-conditions.
- {Function} options.mode Optional
- The new mode 'SoftPhone'/'DeskPhone'. defaults to SoftPhone
- {Function} options.device Optional
- Name of the device (e.g. SEP012345678, CSFUSER) to control. defaults to picking first available
- {Function} options.line Optional
- Phone number of a line valid for the specified device (e.g. '0000'). defaults to picking first available
- {Boolean} options.forceRegistration Optional
- Specifies whether to forcibly unregister other softphone instances with CUCM. Default is false. If you use false and your CUCM device is already in use by another client, the error callback will be invoked with an eDeviceAlreadyRegistered error. Note that this feature requires CUCM 9.0 and currently is only supported on Windows. See GracefulRegistration doc for more info.
<inner>
unregisterPhone(args)
Unregisters a phone from CUCM:
- Ends any active call if this is the last instance or forceLogout is set to true.
- Unbinds all cwic event handlers
- In softphone mode, SIP unregisters, in deskphone mode, closes the CTI connection.
- Calls the optional complete handler (always called)
- Parameters:
- args
- Is a set of key/value pairs to configure the phone unregistration.
- {function} args.complete Optional
- Callback called when unregistration is complete.
If specified, the handler is always called, even if the phone was not registered first, or if the unregistrations caused errors. - {boolean} args.forceLogout:
- If true, end the phone session even if registered in other instances. unregisterPhone examples
<inner>
updateConversation(update, id)
Updates an existing conversation.
This function controls the call allowing the following operations
This function controls the call allowing the following operations
- hold call
- resume call
- mute call
- unmute call
- mute audio only
- mute video only
- unmute audio only
- unmute video only
- add video window for remote sender
- remove video window for remote sender
- update video preference on a call video escalate/de-escalate
- conference two calls together
- transfer a call
- Parameters:
- {String|Object} update
- Update a started conversation. update can be:
A String: hold, resume, mute, unmute, muteAudio, muteVideo, unmuteAudio, unmuteVideo.
An Object: contains one or more writable conversation properties to update e.g. videoDirection.
Triggers a conversationUpdate event. - {String|Object} id
- A conversation identifier (String) or Object containing an id property
Event Detail
conversationEnd(event, conversation)
A conversation has ended. The conversation was terminated by the local user, all participants left the conversation, or an error occurred (media failure for example).
Defined in: supplementaldocs.js.
Defined in: supplementaldocs.js.
- Parameters:
- event
- {call} conversation
conversationIncoming(event, conversation, container)
A new conversation is being received, but is not started yet. The newly created conversation container is passed as an extra event data.
The application is responsible for attaching the container to the DOM, and managing the container lifetime.
In the case the new conversation is accepted by calling startConversation, a conversationStart event is triggered afterwards.
Defined in: supplementaldocs.js.
The application is responsible for attaching the container to the DOM, and managing the container lifetime.
In the case the new conversation is accepted by calling startConversation, a conversationStart event is triggered afterwards.
Defined in: supplementaldocs.js.
- Parameters:
- event
- {call} conversation
- {jQueryNodeArray} container
conversationStart(event, conversation, container)
A conversation has just started.Note the conversation may not be connected yet, for example it is in the Alerting state.The conversation container is passed as an extra event data.
Defined in: supplementaldocs.js.
Defined in: supplementaldocs.js.
- Parameters:
- event
- {call} conversation
- {DomNode} container
conversationUpdate(event, conversation, container)
One or more properties of a conversation have changed, e.g. state, participant.
Defined in: supplementaldocs.js.
Defined in: supplementaldocs.js.
- Parameters:
- event
- {call} conversation
- {jQueryNodeArray} container
error(event)
Defined in: supplementaldocs.js.
- Parameters:
- event
system(event)
Called when the phone changes state.
Defined in: supplementaldocs.js.
Defined in: supplementaldocs.js.
- Parameters:
- {Object} event
- {Object} event.phone
- {String} event.phone.status
- One of
- "eIdle"
- "eFetchingDeviceConfig"
- "eRegistering"
- "eReady"
- "eRecoveryPending"
- "eAwaitingIpAddress"
- "eConnectedButNoDeviceReady"
- "eConnectionTerminated*"
- {Boolean} event.phone.ready
- true if phone is ready (status "eReady"), false if it is logged out or in the process of registering or recovering
- {registration} event.phone.registration
- An updated copy of the registration object passed to $.fn.cwic-registerPhone
*eConnectionTerminated is received when a client elsewhere has logged in using the forceRgistration parameter. When this message is received the client should log the user out of the phone using unregisterPhone.
