I don’t understand how to achieve what you’ve explained which is probably why I’m struggling myself.
The MixMonitor app is run as the channel is being created, so therefore there is no way to get the answer time from the channel as it has not happened yet.
I tried using ${ANSWEREDTIME} variable but this is substituted at the point the app is run and not when the execution script is ran.
The MixMonitor app is triggered using the b and B options on the Dial app, like this:
[context]
same = n,Dial(PJSIP/${EXTEN}@${SIPDOMAIN},30,THB(recording,s,1(outbound,${ARG1},${ARG2},${ARG3})))
[recording]
exten s,1,Set(MIXMONITOR_FILENAME=/recordings/${BASE64_ENCODE(${UNIQUEID}_${EPOCH}_${ARG1}_${ARG2}@${SIPDOMAIN}_${ARG3}_${ARG4})}.wav)
same = n,MixMonitor(${MIXMONITOR_FILENAME},abi(MIXMONID),/usr/scripts/asterisk/recording.py "${MIXMONITOR_FILENAME}")
same = n,Return()
How would I dial and carry on a dialplan after its answered? I thought I had to wait for hangup to come out of the Dial app?
I think there’re a couple of options but you’ll have to change your dialplan a little bit #1 : MixMonitor using option U of Dial application. Note: This will start recording only when a call gets answered and not when the channel is created. #2 : Mixmonitor before you dial without using script and then use h extension or hangup handler to execute your script.
The issue I have, which highlights I should really supply more information when asking questions! Is that I may be running MixMonitor on each channel using B and b Dial option, like this:
same = n,Dial(PJSIP/${EXTEN}@${SIPDOMAIN},30,THB(recording,s,1(outbound,${ARG1},${ARG2},${ARG3}))b(recording,s,1(outbound,${ARG4},${ARG2},${ARG3})))
This is because I’m wanting stop/start to be channel specific, and the U only runs on the called channel.
I like the idea of using the ‘h’ extension, is it possible to specify a ‘h’ dialplan for hangup on the called channel?