Recording

Introduction

Introduced in release 2.6.44, it is now possible to use routing scripts to ask for the recording of incoming and/or outgoing call legs.

See example filter script "call_recording" (created by default in Web Portal routing scripts starting with 2.6.44) for an example.

Recording the incoming call leg

To record the incoming call leg, the routing script (in a "after filter" for example) has to set the following parameter:

 bridge[ :record_incoming ]  = ""

Recording the outgoing call leg

To record the outgoing call leg, the routing script (in a "after filter" for example) has to set the following parameter, per route (the decision to record or not, or the file name to record to, can be set per matching route):

 # Need to clone the routes in order to have the right to modify them
 routes = clone_routes params[:routes]
 routes.each do |route|
   route[ :record_outgoing ]  = ""
 end
 # Store modified routes back to the parameters for this outgoing call
 params[:routes] = routes

Record the outgoing call leg within incoming leg's recorded file (mixing)

 [...]
   route[ :record_outgoing ]  = "@{MixWithIncoming}"
 [...]

Choosing the file path to record to

The value assigned to ":record_incoming" or ":record_outgoing" is the path to record the file to.

The paths can be absolute, or relative. When relative, they are relative to the "tbstreamserver" application working directory, for example:

 /lib/tb/toolpack/setup/12358/2.7/apps/tbstreamserver/
  • Empty file name will default to a name that contains various information about the call:

    • LinkId: Id common between all legs of this call bridge

    • LegId: Unique Id for this leg

    • Nap: Current NAP name this call leg is from

    • Direction: "IN" or "OUT" (depends if call leg is incoming or outgoing leg)

    • Calling: The calling number of this call leg

    • Called: The called number of this call leg

    • Protocol: The signaling protocol of this call leg (SS7, ISDN, CAS, SIP)

    • Media info: Codec + IP/Port for SIP calls, Trunk/Timeslot for TDM calls

  • To record outgoing call leg in the same audio file as incoming call leg (mixing), use the following:

    • @{MixWithIncoming}: Record outgoing legs in same file as incoming legs

  • Variables can be used to insert in the recording path information that's not already available from routing scripts:

    • @{CURRENT_PKG}: Version of current package

      • Example: 2.6.45

    • @{DATE format}: Prints the date, where 'format' is expressed as described for the 'strftime' function

      • Example: @{DATE %Y-%m-%d} => 2013-01-28

    • @{DefaultName}: Replaced by the default file name for recording, which contains:

      • LinkId: Id common between all legs of this call bridge

      • LegId: Unique Id for this leg

      • Nap: Current NAP name this call leg is from

      • Direction: "IN" or "OUT" (depends if call leg is incoming or outgoing leg)

      • Calling: Calling number

      • Called: Called number

      • Protocol: Protocol type of this call (SS7, ISDN, CASR2, SIP)

      • Media info: Codec + IP/Port for SIP calls, Trunk/Timeslot for TDM calls

      • Example: "73EBA698-F3D67B4B-NAP_SS7-IN-5550000-5550001-SS7-TRUNK_BELL_11-24.wav"

      • Example: "73EBA698-73EBA698-NAP_SIP-OUT-5550000-5550001-SIP-G723-10.3.10.101-1050.wav"

    • @{DefaultPath}: Default recording folder and file name: "@{RECORD_PATH}/@{DATE %Y-%m-%d}/@{DefaultName}"

      • Example: "/lib/tb/toolpack/setup/12358/recorded_calls/73EBA698-F3D67B4B-NAP_SS7-IN-5550000-5550001-SS7-TRUNK_BELL_11-24.wav"

      • Example: "/lib/tb/toolpack/setup/12358/recorded_calls/73EBA698-73EBA698-NAP_SIP-OUT-5550000-5550001-SIP-G723-10.3.10.101-1050.wav"

    • @{Direction}: Direction of current leg (IN our OUT)

      • Example: IN

    • @{LegId}: Current LegId (Unique Id for this leg)

      • Example: F3D67B4B

    • @{LinkId}: Current LinkId (Id common between all legs of this call bridge)

      • Example: 73EBA698

    • @{PKG_HOME}: Path where packages are stored.

      • Note: It's not recomended to use that path on redundant systems, package file replication may cause confusion in recorded files.

      • Example: /lib/tb/toolpack/pkg

    • @{PROMPT_PATH}: Default path where audio prompts are stored

      • Note: It's not recomended to use that path on redundant systems, package file replication may cause confusion in recorded files.

      • Example: /lib/tb/toolpack/pkg/prompts

    • @{Protocol}: Protocol of current leg

      • Example: SS7

    • @{RECORD_PATH}: Default recording folder: "@{TB_SETUP_HOME}/recorded_calls/"

    • @{TBX_GW_PORT}: Current "System Id" (also called "Gateway Port")

      • Example: 12358

    • And all variables listed here: Building play or record file path

Last updated

Was this helpful?