One touch recording error


I am trying to enable recording automatically and have created the below custom destination

exten => 572,1,NoOp(Welcome to the customer application)
exten => 572,n,Macro(one-touch-record)
exten => 572,n,Dial(SIP/300,15,trwWbxX)

But i’m getting the below error:

– Executing [572@custom-app:1] NoOp(“SIP/pureip-00000000”, “Welcome to the customer application”) in new stack
– Executing [572@custom-app:2] Macro(“SIP/pureip-00000000”, “one-touch-record”) in new stack
– Executing [s@macro-one-touch-record:1] ExecIf(“SIP/pureip-00000000”, “0?Set(THISEXTEN=)”) in new stack
– Executing [s@macro-one-touch-record:2] ExecIf(“SIP/pureip-00000000”, “1?Set(THISEXTEN=)”) in new stack
[2013-09-17 10:38:09] WARNING[20428]: ast_expr2.fl:468 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected ‘’, expecting $end; Input:
""""=“exten” & “”!=“enabled”
[2013-09-17 10:38:09] WARNING[20428]: ast_expr2.fl:472 ast_yyerror: If you have questions, please refer to … +Variables
– Executing [s@macro-one-touch-record:3] ExecIf(“SIP/pureip-00000000”, “”"?MacroExit()") in new stack
– Executing [572@custom-app:3] Dial(“SIP/pureip-00000000”, “SIP/300,15,trwWbxX”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called SIP/300
– SIP/300-00000001 is ringing

Any ideas please? When i use one-touch-recording without this custom-app it works fine.

You have a syntax error in the Macro one-touch-record. Please copy/paste the content of the Macro also.

This the macro:

include => macro-one-touch-record-custom
exten => s,1,ExecIf($["${PICKUP_EXTEN}"!=""]?Set(THISEXTEN=${CUT(CALLFILENAME,-,2)}))
exten => s,n,ExecIf($["${THISEXTEN}"=""]?Set(THISEXTEN=${IF($["${REALCALLERIDNUM}"=""]?${CUT(CALLFILENAME,-,2)}:${FROMEXTEN})}))
exten => s,n,ExecIf($["${CUT(CALLFILENAME,-,1)}"=“exten” & “${DB(AMPUSER/${THISEXTEN}/recording/ondemand)}”!=“enabled”]?MacroExit())
exten => s,n,GotoIf($["${MASTER_CHANNEL(ONETOUCH_REC)}"=“RECORDING”]?stoprec)
exten => s,n,GotoIf($["${MASTER_CHANNEL(REC_POLICY_MODE)}"=“never”]?stopped)
exten => s,n,GotoIf($["${MASTER_CHANNEL(ONETOUCH_REC)}"="" & “${MASTER_CHANNEL(REC_STATUS)}”=“RECORDING”]?recording)
exten => s,n(mixmon),Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => s,n,Set(MON_FMT=${IF($[${LEN(${MIXMON_FORMAT})}]?${MIXMON_FORMAT}:wav)})
exten => s,n,Set(MASTER_CHANNEL(CDR(recordingfile))=${CALLFILENAME}.${MON_FMT})
exten => s,n(recording),Playback(beep)
exten => s,n,MacroExit()
exten => s,n(stoprec),StopMixMonitor()
exten => s,n(stopped),Playback(beep&beep)
exten => s,n,MacroExit()

;–== end of [macro-one-touch-record] ==–;

I dont think its the macro that has the error because when i use this macro by dialling *1 from an extension it works.

I beleive the problem is i’m calling the macro from the custom-app & so the ‘EXTEN’ is empty, it should have an EXTEN for example:
Executing [s@macro-one-touch-record:1] ExecIf(“SIP/300-00000007”, “0?Set(THISEXTEN=300)”) in new stack

but i’m getting:
[s@macro-one-touch-record:1] ExecIf(“SIP/pureip-00000000”, “0?Set(THISEXTEN=)”

Do you know where i can put the macro so it is called everytime an extension is answered - rather than creating a custom-app for this?