pause/resume call recording

VitalPBX Community Support General Discussion pause/resume call recording

Up
0
Down
  • Post
    gerrykernan
    Participant

    hi

    i’m trying to add a custom feature to allow users pause/resume call recordings .

     

    ive added these macros to the dialplan

    [macro-recpause]
    exten => s,1,Playback(/var/lib/asterisk/sounds/en/beep)
    exten => s,n,NoOP(Call file name is ${ARG1})
    exten => s,n,Noop(“pause code pressed”)
    exten => s,n,StopMixMonitor()

    [macro-recunpause]
    exten => s,1,Playback(/var/lib/asterisk/sounds/en/beep)
    exten => s,n,Playback(/var/lib/asterisk/sounds/en/beep)
    exten => s,n,NoOp(${ARG1})
    exten => s,n,Noop(“resume code pressed”)
    exten => s,n,MixMonitor(${ARG1},a,${MIXMON_POST})

     

    and these to features__10-application-map.conf

    InPauseMonitor => #2,peer/both,Macro(recpause),${REC_FILENAME}
    InUnpauseMonitor => #3,peer/both,Macro(recunpause),${REC_FILENAME}

    [custom-features]
    one_touch_rec =>
    InUnpauseMonitor =>
    InPauseMonitor =>

     

    but when i press #2 during a call the variable ${REC_FILENAME} is not passed to the marco , is what im trying to do feasible?

    shoud i be doing this another way.

    Best Regards

    gerry

    0
Viewing 7 replies - 1 through 7 (of 7 total)
  • Replies
    gerrykernan
    Participant

    hi

    i got little futher on this , using macros below

     

    [macro-recpause]
    exten => s,1,Playback(/var/lib/asterisk/sounds/en/beep)
    exten => s,n,Noop(“pause code pressed”)
    exten => s,n,StopMixMonitor()

    [macro-recunpause]
    exten => s,1,Playback(/var/lib/asterisk/sounds/en/beep)
    exten => s,n,Playback(/var/lib/asterisk/sounds/en/beep)exten => s,n,Noop(“resume code pressed”)
    exten => s,n,NoOP(Call file name is ${UNIQUEID} )
    exten => s,n,Set(AUDIO_FILE=${UNIQUEID})
    exten => s,n,NoOP(AUDIO_FILE name is ${UNIQUEID} )
    exten => s,n,Set(RECORDING_FORMAT=${IF($[“${RECORDING_FORMAT}”=”wav49”]?WAV:${RECORDING_FORMAT})})
    exten => s,n,Set(REC_FILENAME=${ASTSPOOLDIR}/monitor/${STRFTIME(${EPOCH},,%Y/%m/%d)}/${AUDIO_FILE}.${RECORDING_FORMAT})
    exten => s,n,Noop(rec file = ${REC_FILENAME})
    exten => s,n,MixMonitor(${REC_FILENAME},a,${MIXMON_POST})

     

    but the ${UNIQUEID} i get when the callee presses #3 to resume call recording is differnet than the ${UNIQUEID} created when the call is first answered

    Call answered

    – Executing [s@sub-perform-recording:1] NoOp(“PJSIP/13_4-00000130”, “Perform Call Recording”) in new stack
    — Executing [s@sub-perform-recording:2] Set(“PJSIP/13_4-00000130”, “AUDIO_FILE=1542299030.15220“) in new stack
    — Executing [s@sub-perform-recording:3] Set(“PJSIP/13_4-00000130”, “RECORDING_FORMAT=wav”) in new stack
    — Executing [s@sub-perform-recording:4] Set(“PJSIP/13_4-00000130”, “REC_FILENAME=/var/spool/asterisk/monitor/2018/11/15/1542299030.15220.wav”) in new stack
    — Executing [s@sub-perform-recording:5] Set(“PJSIP/13_4-00000130”, “CDR(recfile)=/var/spool/asterisk/monitor/2018/11/15/1542299030.15220.wav”) in new stack
    — Executing [s@sub-perform-recording:6] MixMonitor(“PJSIP/13_4-00000130”, “/var/spool/asterisk/monitor/2018/11/15/1542299030.15220.wav,b,”) in new stack
    — Executing [s@sub-perform-recording:7] Set(“PJSIP/13_4-00000130”, “_RECORDING_IN_PROGRESS=yes”) in new stack

     

    callee presses #3 to resume recording

    Executing [s@macro-recunpause:3] NoOp(“SIP/infinityit-00002668”, “”resume code pressed””) in new stack
    — Executing [s@macro-recunpause:4] NoOp(“SIP/infinityit-00002668”, “Call file name is 1542299030.15219 “) in new stack
    — Executing [s@macro-recunpause:5] Set(“SIP/infinityit-00002668”, “AUDIO_FILE=1542299030.15219”) in new stack
    — Executing [s@macro-recunpause:6] NoOp(“SIP/infinityit-00002668”, “AUDIO_FILE name is 1542299030.15219 “) in new stack
    — Executing [s@macro-recunpause:7] Set(“SIP/infinityit-00002668”, “RECORDING_FORMAT=wav”) in new stack
    — Executing [s@macro-recunpause:8] Set(“SIP/infinityit-00002668”, “REC_FILENAME=/var/spool/asterisk/monitor/2018/11/15/1542299030.15219.wav”) in new stack
    — Executing [s@macro-recunpause:9] NoOp(“SIP/infinityit-00002668”, “rec file = /var/spool/asterisk/monitor/2018/11/15/1542299030.15219.wav”) in new stack
    — Executing [s@macro-recunpause:10] MixMonitor(“SIP/infinityit-00002668”, “/var/spool/asterisk/monitor/2018/11/15/1542299030.15219.wav,a,”) in new stack
    == Begin MixMonitor Recording SIP/infinityit-00002668

     

    im assuming this is a ${UNIQUEID} for each leg of the call.  is it possible to acces the UNIQUEID variable for the other leg?

     

    gerry

    0
    gerrykernan
    Participant

    hi

    if i create a gbolal variable such as 

    same=>n,Set(GLOBAL(MYUNIQUEID)=${UNIQUEID})

     

    in context [sub-perform-recording] in file /etc/asterisk/ombutel/extensions__20-baseplan.conf 

    will this get over written when i do a conf reload ?

     

    gerry

    0
    gerrykernan
    Participant

    hi ,

    i’m not getting anywere with this as when opertor presses #2 to stop call and #3 to resume the  variable ${UNIQUEID} is the opposite id of the other channel that variable REC_FILE uses to name teh file. found that  using same=>n,Set(GLOBAL(MYUNIQUEID)=${UNIQUEID}) only works if there is olnt i call active , when multiple calls this variable has UNIQUEID of most recent call.

    according to this page https://wiki.asterisk.org/wiki/display/AST/Custom+Dynamic+Features

    if i, reading it correctly the ActivateBy parameter is nolonger used

    “ActivatedBy is no longer honored. The feature is activated by which channel DYNAMIC_FEATURES includes the feature is on. Use a pre-dial handler to set different values for DYNAMIC_FEATURES on the channels. Historic values are: “caller”, “callee”, and “both”.”

    where would i get this in a pre-dial handler ?

     

    gerry

    but futher in teh wiki

    0

    We will check it

    0
    gerrykernan
    Participant

    hi

     

    think i found the answer , im found a channel varuiable called ${MIXMONITOR_FILENAME} that contains the filename that i can use inte resume macro , testing now

     

    gerry

    0
    gerrykernan
    Participant

    hi mrivera

     

    think i have it working

    had to change  entries in features__10-application-map.conf from “both” to “self” , then dumpchan shows the mixmonitor_filename variable and i can use in the pause/resume macros.

     

    InPauseMonitor => #2,self/both,Macro(recpause),recording-disabled
    InUnpauseMonitor => #3,self/both,Macro(recunpause),recording-disabled

    [macro-recpause]
    exten => s,1,Playback(/var/lib/asterisk/sounds/en/beep)
    exten => s,n,dumpchan()
    exten => s,n,NoOP(Call file name MIXMon file ${MIXMONITOR_FILENAME})
    exten => s,n,Noop(“pause code pressed”)
    exten => s,n,StopMixMonitor()

    [macro-recunpause]
    exten => s,1,Playback(/var/lib/asterisk/sounds/en/beep)
    exten => s,n,Playback(/var/lib/asterisk/sounds/en/beep)
    exten => s,n,dumpchan()
    exten => s,n,Noop(“resume code pressed”)
    exten => s,n,Noop(rec file = ${MIXMONITOR_FILENAME})
    exten => s,n,MixMonitor(${MIXMONITOR_FILENAME},a,${MIXMON_POST})

    0
    gerrykernan
    Participant

    hi

     

    this worked, you can mark this as closed

     

    thanks

     

    gerry

    0
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.