Recording on Gateway

Recording can be enabled on a gateway instead of the XiVO PBX where the users, queues and other objects are configured. This architecture will allow to off-load the recording process to a gateway server. Note that in this architecture not all the recording features are available - see Recording On Gateway Features section.

../../../../_images/recording_on_gw.png

Important

This page describes the case when recording is activated on the XiVO Gateway. If you want to configure it on the XiVO PBX you MUST follow the Recording guide. Beware that you cannot use both.

Activate Recording on Gateway

To configure recording there are two steps to follow on XiVO Gateway:

  1. Add link towards Recording Server,

  2. and then enable recording via subroutines

2. Enable recording

Note

Steps to be done on XiVO Gateway

You must activate the recording by adding subroutines:

  • Create the subroutines in the file /etc/asterisk/extensions_extra.d/gateway-recording.conf:

    [gateway-recording-outcall]
    exten = s,1,NoOp(=== Recording calls from Gateway to XiVO PBX ===)
    same = n,Set(gateway_name=xivogw1)
    same = n,Set(_recordingid=${gateway_name}-${UNIQUEID})
    same = n,Set(XIVO_CALLOPTIONS=${XIVO_CALLOPTIONS}b(gateway-recording-outcall-add-header^s^1))
    same = n,Set(MONITOR_EXEC=/usr/bin/xivocc-synchronize-file)
    same = n,Monitor(,/var/spool/xivocc-recording/audio/${recordingid},m)
    same = n,Return()
    
    [gateway-recording-incall]
    exten = s,1,NoOp(=== Recording calls from Gateway to Provider ===)
    same = n,GoSub(xivo-generic-sip-get-header,s,1(X-Xivo-Recordingid,recordingid))
    same = n,GotoIf($["${recordingid}" = ""]?norecord:)
    same = n,Set(MONITOR_EXEC=/usr/bin/xivocc-synchronize-file)
    same = n,Monitor(,/var/spool/xivocc-recording/audio/${recordingid},m)
    same = n(norecord),Return()
    
    [gateway-recording-outcall-add-header]
    exten = s,1,NoOp(Adding SIP header on outgoing channel)
    same = n,GoSub(xivo-generic-sip-add-header,s,1(X-Xivo-Recordingid,${recordingid}))
    same = n,Return()
    
  • Activate subroutines:

    • Configure the gateway-recording-outcall on the Outgoing call rule towards the XiVO PBX

    • Configure the gateway-recording-incall on the Outgoing call rule towards the Provider

Activate Recording on XiVO PBX

Note

Step to be done on the XiVO PBX

On the XiVO PBX you need to use specific subroutines instead of the default ones.

  • Create the subroutines in the file /etc/asterisk/extensions_extra.d/xivo-gateway-recording.conf:

    ; This subroutine is to be used only when recording is set up on gateway
    [xivocc-incall-recording-viagw]
    exten = s,1,NoOp(=== Recording incoming calls (XiVO PBX) ===)
    same = n,GoSub(xivo-generic-sip-get-header,s,1(X-Xivo-Recordingid,XIVO_RECORDINGID))
    same = n,Set(DO_RECORD=true)
    same = n,System(test -f /usr/share/asterisk/agi-bin/xivocc-determinate-record-incall)
    same = n,GotoIf($["${SYSTEMSTATUS}" = "SUCCESS"]?:noagi)
    same = n,AGI(xivocc-determinate-record-incall)
    same = n(noagi),GotoIf($["${DO_RECORD}" = "true"]?:norecord)
    same = n,CelGenUserEvent(ATTACHED_DATA,recording=${XIVO_RECORDINGID})
    same = n(norecord),Return()
    
    [xivocc-outcall-recording-viagw]
    exten = s,1,NoOp(=== Outgoing Call Recording (XiVO PBX) ===)
    same = n,Set(DO_RECORD=true)
    same = n,System(test -f /usr/share/asterisk/agi-bin/xivocc-determinate-record-outcall)
    same = n,GotoIf($["${SYSTEMSTATUS}" = "SUCCESS"]?:noagi)
    same = n,AGI(xivocc-determinate-record-outcall)
    same = n(noagi),GotoIf($["${DO_RECORD}" = "true"]?:norecord)
    same = n,Set(ipbx_name=xivo)
    same = n,Set(_XIVO_RECORDINGID=${ipbx_name}-${UNIQUEID})
    same = n,Set(XIVO_CALLOPTIONS=${XIVO_CALLOPTIONS}b(gateway-recording-outcall-add-header^s^1))
    same = n,CelGenUserEvent(ATTACHED_DATA,recording=${XIVO_RECORDINGID})
    same = n(norecord),Return()
    
    [gateway-recording-outcall-add-header]
    exten = s,1,NoOp(Adding SIP header on outgoing channel)
    same = n,GoSub(xivo-generic-sip-add-header,s,1(X-Xivo-Recordingid,${XIVO_RECORDINGID}))
    same = n,Return()
    
  • Activate the subroutines:

    • Configure the xivocc-incall-recording-viagw on the Incoming calls/Queues in your XiVO PBX

    • Configure the xivocc-outcall-recording-viagw on the Outgoing call rule towards the Provider

Recording On Gateway Features

Available Features

When you activate the recording on a XiVO Gateway all features of the recording server are available:

Unavailable Features

When you activate the recording on a XiVO Gateway these features are not available:

Activate the Recording Control on CC Agent

When the recording is activated on the XiVO Gateway you can activate the Recording Control feature by following this specific procedure :

Allow the xucserver to connect to your XiVO Gateways:

  1. Copy the file /etc/asterisk/manager.d/02-xivocc.conf from the XiVO PBX to the same folder on the gateway.

Configure the XiVO Gateway as a Media Server

  1. On your XiVO PBX, add your XiVO Gateway as a Media Server in Configuration ‣ Media servers

    Important

    After this step the xucserver will try to connect to the XiVO Gateway asterisk AMI

  2. On your XiVO PBX, configure the provider trunks: you need to add on your XiVO PBX the same provider trunk that is already created on your XiVO Gateway BUT with selecting, for the field Media Server the XiVO Gateway you added.

Configure the xuc

  1. Disable the feature Stop recording upon external transfer feature: see Stop recording upon external transfer

  2. Disable the Automatic Stop/Start Recording On Queues feature : see Automatic Stop/Start Recording On Queues

  3. Restart the xuc:

    xivocc-dcomp up -d