NetSapiens configuration
This article explains how to configure the NetSapiens platform to send SIPREC recordings to MiaRec, and how to choose which calls are recorded.
The work happens in two parts:
- Platform setup, once per core. Enable SIPREC, add connections to the MiaRec recorders, route SIPREC to them, and add the MiaRec LEA. This requires NetSapiens system administrator access.
- Enablement, once per customer. Add LIC entries for one or more of the following:
- The entire domain
- Users
- Specific devices
- Call queues
Before you begin
- The NetSapiens platform must run SNAPsolution v45 or higher. Earlier versions lack SIPREC for service providers, and TLS and SRTP for SIPREC.
- Plan a maintenance window. Applying the SIPREC feature to a core (Step 8) drops all active calls on that core.
SIPREC uses extra sessions
Each recorded call uses its own SIPREC session in addition to the voice session. A recorded voice call uses 2 sessions. See the NetSapiens article "NetSapiens Session Usage Calculation, Overage Utilization, and Pricing Policy".
Local call recording is unaffected
If a device, user, or domain already uses NetSapiens local call recording, both local recording and SIPREC run on its calls. Disable local recording where you don't need both. This matters most for Domain-Wide Call Recording, which forces local recording for every user in a domain.
Platform setup
Repeat these steps on each core that handles calls to be recorded.
Step 1. Enable SIPREC
- In the NetSapiens Admin UI, navigate to System > Settings > Advanced > Properties.
- Add the following two parameters. Set Geo to Yes so that they replicate to every server in the
cluster.
- SiprecEnable: set to
yes - SipRecMetaDataCrLf: set to
yes. This formats the SIPREC metadata with line breaks, which makes call traces easier to read.
- SiprecEnable: set to
Step 2. Show SIPREC in the Admin UI
- Navigate to System > Settings > Advanced > UI Config.
- Add a parameter with these values:
- Account Type, Hostname, Reseller, Domain, Role, User: set to
* - Parameter:
UI_LIDF_SHOW_SIPREC - Value:
yes
- Account Type, Hostname, Reseller, Domain, Role, User: set to
Step 3. Add connections to the MiaRec recorders
Add one connection for each MiaRec recorder. MiaRec provides the host names of the recorders for your region.
This guide uses recorder1.example.net (primary) and recorder2.example.net (secondary) as examples. The
recorders accept SIPREC on port 5060.
- Navigate to Connections > Connections and click Add.
- Fill in the fields for the primary recorder as follows. Leave other fields at their defaults.
- Destination Host:
siprec.miarec - Orig Match: set to From-URI
- Domain:
* - Type: set to Vendor
- IP Address: the host name of the primary MiaRec recorder, for example
recorder1.example.net - Check IP: set to Yes
- Show Server: set to Yes
- Description: a name that identifies the recorder, for example
SIPREC - MIAREC
- Destination Host:
- Click Add Server.
- Repeat for the secondary recorder, with these differences:
- Destination Host:
siprec2.miarec - IP Address: the host name of the secondary MiaRec recorder, for example
recorder2.example.net - Description: for example,
SIPREC2 - MIAREC
- Destination Host:
Add the connections in failover order
NetSapiens tries the recorders in the order their connections were added. Add the primary recorder first. NetSapiens accepts a DNS SRV record for the recorders, but it does not honor SRV weights or priorities.
Step 4. Set the connection rules
- Open each MiaRec connection for editing.
-
Set Rules to:
CheckIP ShowServer WanGW TcpRules are case-sensitive.
Optional: include
Tlsif SIPREC over TLS (mutual TLS) is preferred. -
Click Modify.
Step 5. Add the dial translation rule
- Navigate to Dial Planning > Dial Translation.
- Click Select in the Cloud PBX Features row, then click New Rule.
-
Fill in the fields as follows. Leave other fields at their defaults.
- Source:
* - Destination:
sip:srs@* - Enable: set to Yes
- Application: set to To Connection
- Description: for example,
To SIPREC Server
- Source:
-
Click Create.
Step 6. Add the static route
- Navigate to Dial Planning > Call Routing and click Add Static Route.
-
Fill in the fields as follows:
- Source:
* - Destination:
sip:srs@siprec.miarec - Class:
* - Host:
* - Status: set to Yes
- Route Name: for example,
SIPREC - MIAREC - Route Option: set to Fixed
- Source:
-
Click Create.
- In the route list, click the connection count (
0) in thesip:srs@siprec.miarecrow, and add the MiaRec connections from Step 3, primary first.
Step 7. Add the MiaRec LEA
- Navigate to Connections > Legal Intercept and click Add LEA.
-
Fill in the fields as follows:
- LEA ID, Name, Address, Contact, Phone, E-Mail:
SIPREC-MIAREC - CCC IP: the IP address of this core
- CCC Port:
1040 - CDC URL:
sip:srs@siprec.miarec - Enable: set to SIPREC
- LEA ID, Name, Address, Contact, Phone, E-Mail:
-
Click Create.
The CDC URL is an internal route on the core. It matches the static route from Step 6, which delivers the SIPREC session to the MiaRec connections.
Step 8. Apply the SIPREC feature to the core
Update the NetSapiens server to apply the SIPREC feature (and the TLS feature, if used) from the license token.
Danger
Applying the feature drops all active calls on the server. Do it in a maintenance window.
Customer enablement
Preflight: Choosing a recording scope
Before enabling MiaRec recording for users in a domain, choose the recording scope. An LIC entry decides which calls are recorded. Use the widest scope that matches what the customer wants.
| Scope | LIC Case ID | Records |
|---|---|---|
| Domain | *@<domain> |
Every call that a device in the domain places or answers. Recommended for most customers. |
| User | <extension>@<domain> |
Calls the user places or answers, on any of the user's devices. |
| Device | sip:<device>@<domain> |
Calls on one phone or webphone only. |
| Call queue | <queue>@<domain> |
Calls that an agent answers from the queue. |
NetSapiens checks the LIC entries once, when a call is answered. A call is recorded only if one of its parties at that moment is covered by an LIC entry: the caller, the answering device and its user, the call queue, or the domain of any of these. A device or user that the call passed through earlier, but that is no longer connected when the call is answered, is not a party, so its LIC entry doesn't apply.
For example, if the LIC entry is the user 1101@acme, and user 1101 forwards their calls to user 1102 in the
NetSapiens portal, a call to 1101 that 1102 answers is not recorded. User 1101 is not a party when the call
is answered. A domain entry (*@acme) records the call.
Keep the following in mind when choosing a scope:
- Device entries: a call the phone itself forwards (SIP
302) before answering is not recorded. - User entries: a call forwarded from the portal to another user, or picked up by another user, is not recorded. Forwarding to a device or an off-net number is recorded.
- Auto attendant entries: an LIC entry for an auto attendant never matches. Cover the attendant's calls with a domain entry, or with entries for the users and queues it routes to.
- Domain entries: an auto attendant call that ends in voicemail or a played message is not recorded, because no device answers it.
- Attended transfers: the consultation call is recorded separately, wherever the transferring user's device, user, or domain entry applies.
- Recording announcement: NetSapiens does not play one for SIPREC. To announce recording on inbound calls, play a message from an auto attendant or a queue announcement.
Step 1. Prepare the customer's MiaRec tenant
Create the customer's tenant in MiaRec before you enable recording, so that the first recordings land in the right place. See MiaRec configuration.
Step 2. Add LIC entries for the customer
- Log in to the NetSapiens Admin UI.
- Navigate to Connections > Legal Intercept.
- Click Select in the
SIPREC-MIARECrow. - Click Add LIC at the bottom of the table.
- Fill in the fields as follows:
- Case ID: who to record, in one of these formats:
- Domain:
*@<domain>, for example*@acme - User:
<extension>@<domain>, without asip:prefix, for example1101@acme - Device:
sip:<extension><postfix>@<domain>, for examplesip:1101wp@acme - Call queue:
<queue>@<domain>, for example3001@acme
- Domain:
- Device AOR: select << Same as Case ID >> (at the bottom of the list; press Shift + < to jump there)
- Valid From, Valid To: leave at
0000(no limit) - Intercept CCC: set to Yes
- Intercept CDC: set to Yes
- Case ID: who to record, in one of these formats:
- Click Create. Repeat on each core.
Step 3. Make a test call
- Place a call to or from a user covered by the new LIC entry, and talk for at least 10 seconds.
- In the MiaRec web portal, open Recordings and find the call. It should show the user's extension and be assigned to the customer's tenant.
If the recording is missing:
- Open the call in Call History on the NetSapiens core and view its trace. The call flow should show an
INVITE to
sip:srs@siprec.miarec. - Check that the LIC entry exists on the core that handled the call, and that its Case ID uses the format in
Step 2 (the user scope has no
sip:prefix). - Check that the call was answered. LIC entries are checked only when a call is answered.
- Check the call's codecs. See Codecs.
Deployment notes
Codecs
Codec mismatch can result in no audio
NetSapiens does not transcode audio for SIPREC. MiaRec receives each call leg in the codec that the leg negotiated. Every leg of a call must use a codec that MiaRec supports for the call to be recorded. Configure devices, apps, and trunks so that recorded calls don't negotiate OPUS, for example by preferring G.711 (PCMU/PCMA).
How SIPREC failures affect calls
- A SIPREC failure never blocks the call. If the MiaRec recorder doesn't answer, the call still connects but is not recorded.
- NetSapiens doesn't hold the call's audio while it waits for the recorder. If the recorder answers slowly, the first moments of audio are not recorded.