Recording calls in CCXML Using SIPREC
Call recordings can be triggered within CCXML by doing a <send> with a name of 'bvr.record' to the connection that you want to record. The namelist parameter for the send requires 4 parameters:
Note that you may either omit one of inbound and outbound, or set them to "nochange" The existing recording state will be used for that direction of audio - e.g. if there is an active outbound recording set it will not be touched.
To update an existing recording session, use the same method as above. The URI parameter should match the existing URI parameter from the previous <send>, and the inbound and outbound parameters should be set to the mode to transition to. Note that if this is called again with a different URI, the existing SIPREC session will end and a new one will be created to the newly defined SIP URI.
Example CCXML:
The following CCXML will create a SIPREC recording session of both the inbound and outbound channels. Note that variables declared within a transition are only accessible within that transition, define them before the eventprocessor for them to persist and be accessible in other transitions.
<var name="type" expr="'siprec'"/> <var name="uri" expr="'sip:siprec@my.siprec.server.com:5060'"/> <var name="inbound" expr="'active'"/> <var name="outbound" expr="'active'"/> <send name="'bvr.record'" target="event$.connectionid" targettype="'connection'" namelist="type uri inbound outbound"/>
The following CCXML shows how to modify an existing SIPREC session so that the inbound channel is muted (note that this assumes the type, uri, inbound and outbound parameters have already been created with the var tag and are accessible within the scope of the current transition):
<assign name="inbound" expr="'inactive'"/> <send name="'bvr.record'" target="event$.connectionid" targettype="'connection'" namelist="type uri inbound outbound"/>
The following CCXML shows how to close down an existing SIPREC session (note that this assumes the type, uri, inbound and outbound parameters have already been created with the var tag and are accessible within the scope of the current transition):
<assign name="inbound" expr="'none'"/> <assign name="outbound" expr="'none'"/> <send name="'bvr.record'" target="event$.connectionid" targettype="'connection'" namelist="type uri inbound outbound"/>
Handling events generated by bvr.record messages
Whenever an issue occurs that prevents BVR from reaching the requested record state (e.g. inbound being active and outbound set to none, from a starting state of inbound and outbound set to none), your CCXML document will receive an error.bvr.record event with the following attributes:
As with any other CCXML error, if no transition in your document handles the error BVR may terminate the CCXML session.
If a state change succeeds, a bvr.record.update event will be generated with all the above attributes except for reason. Note that if a second bvr.record message is handled before the first has resolved then the CCXML document will receive only one bvr.record.update