trunk-to-trunk call recording in Elastix : syntax

Brandon

Well-Known Member
Joined
Feb 18, 2004
Messages
276
Reaction score
54
Location
National Bank of Zuma
For the Asterisk syntax gurus:

Please help!

Scenario: Need to record trunk to trunk calls in Elastix; simply inserting a MixMonitor into the dialplan does record but doesn't show up in the Monitoring List on the web gui.

What is needed is to set the db variable that is checked in the macro-record-enable.

Code:
ExecIf($["${CUT(DB(AMPUSER/${ARG1}/recording),\\\|,1):4}" != "Always"]?MacroExit())

What would the correct Set(DB... syntax be for the above so that the variable returns "Always" when passed through the above ExecIf check??

Any help is greatly appreciated!
 
Last edited:
For anyone interested - got it to work a slightly longer way round, just copied some of the record-enable macro and called it in a custom context:

Code:
[macro-trnk-record]
include => macro-trnk-record-custom
exten => s,1,Noop(Recording enable for ${ARG1})
exten => s,n,Set(CALLFILENAME=OUT${ARG1}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID})
exten => s,n,MixMonitor(${MIXMON_DIR}${CALLFILENAME}.${MIXMON_FORMAT},,${MIXMON_POST})
exten => s,n,Set(CDR(userfield)=audio:${CALLFILENAME}.${MIXMON_FORMAT})
exten => s,n,MacroExit()

Also figured out a way to bypass the pin checking on outgoing calls originating from another trunk:

Code:
Set(DB(AMPUSER/${AMPUSER}/pinless)=NOPASSWD)

**Update**
The above call trunk recording will not work with Elastix 2.5.0, try with the below:
Code:
[macro-trnk-record]
exten => s,1,MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME}.${MIXMON_FORMAT},a,${MIXMON_POST})
exten => s,n,Set(__MON_FMT=${IF($["${MIXMON_FORMAT}"="wav49"]?WAV:${MIXMON_FORMAT})})
exten => s,n,Set(__REC_STATUS=INITIALIZED)
exten => s,n,Set(NOW=${EPOCH})
exten => s,n,Set(__DAY=${STRFTIME(${NOW},,%d)})
exten => s,n,Set(__MONTH=${STRFTIME(${NOW},,%m)})
exten => s,n,Set(__YEAR=${STRFTIME(${NOW},,%Y)})
exten => s,n,Set(__TIMESTR=${YEAR}${MONTH}${DAY}-${STRFTIME(${NOW},,%H%M%S)})
exten => s,n,Set(__FROMEXTEN=${IF($[${LEN(${AMPUSER})}]?${AMPUSER}:${IF($[${LEN(${REALCALLERIDNUM})}]?${REALCALLERIDNUM}:unknown)})})
exten => s,n,Set(__CALLFILENAME=${ARG1}-${ARG2}-${FROMEXTEN}-${TIMESTR}-${UNIQUEID})
exten => s,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => s,n,Set(MONITOR_FILENAME=${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/${CALLFILENAME})
exten => s,n,MixMonitor(${MONITOR_FILENAME}.${MIXMON_FORMAT},${MONITOR_OPTIONS},${MIXMON_POST})
exten => s,n,Set(__REC_STATUS=RECORDING)
exten => s,n,Set(CDR(recordingfile)=${CALLFILENAME}.${MON_FMT})
exten => s,n,MacroExit()

Found this macro quite handy to remove the "+" from some inbound calls:

Code:
[from-trunk-remove-plus]
exten => _[0-9+]./_+X.,1,Set(CALLERID(number)=${CALLERID(number):1})
exten => _[0-9+]./_X.,n,Goto(from-pstn,${EXTEN},1)
exten => _[0-9+].,1,Goto(from-pstn,${EXTEN},1)
exten => s/_+X.,1,Set(CALLERID(number)=${CALLERID(number):1})
exten => s/_X.,n,Goto(from-pstn,${EXTEN},1)
exten => s,1,Goto(from-pstn,${EXTEN},1)
 
Last edited:
Thanks Brandon, but which file did you edit extensions_additional.conf ?
 
Thanks Brandon, but which file did you edit extensions_additional.conf ?

Don't touch extensions_additional.conf or any *_additional.conf file for that matter as it will be overwritten each time you apply changes in FreePBX. You need to make changes to _custom.conf or if it is core dial-plan extensions_override_freepbx.conf.
 
Don't touch extensions_additional.conf or any *_additional.conf file for that matter as it will be overwritten each time you apply changes in FreePBX. You need to make changes to _custom.conf or if it is core dial-plan extensions_override_freepbx.conf.


Hi,


We have 2 Trunks registered in my Elastix.

1) IAX TRUNK from V4VOIP Service Provider
2) IAX Trunk from Gradwell Service Provider

Whenever some one dial to our 1-IAX Trunk .....incoming call routed to Group # 601 or 602 and it shows record in Monitoring of Elastix, but it doesn't play anything.

Whenever someone dial to 2-IAX TRUNK, routes to Ext # 250, it records Fine.

Here I have tested following.

Tried # 1
I have added 2 SIP Ext into Group and tried to Route Incoming call. It shows recording in monitoring, but cannot play from Elastix or Freepbx. No Success !!

Tried # 2
Incoming call Routed to new extension # 4999 and added call forward to Group # 601. It shows recording in monitoring, but cannot play from Elastix or Freepbx. No Success !!


Recording Works on IAX TRUNK, only when we route incoming calls to Extension, surprisingly downloading/playing works only from "Unembedded Freepbx", but not from Elastix-> Monitoring.

When I visit to IAX Setting I see following Settings.

Selected
NAT # YES
IP Configuration # Static IP
External IP # 46......
Local Networks # Nil / 255.255.255.0

Codes # ULAW/GSM/ALAW/G722/g726
Non-Standard g726 # No
T38 Pass-Through # No
Reinvite Behaviour = No

Note Selected Codecs
G723/slin/g726aa2/ipc10/speex/adpcm/ilbc


Looking for valuable response. Thanks in Advance !!

May I know, if any advice or suggestion, will be highly appreciated.

-Thanks,
Sam.
 
Top
Sign up to the MyBroadband newsletter
X