How to resume playing audio on same stage/moment

Hi,
Please tell me how to manage running state of playing audio,
during the ongoing playing audio, length 5-6 minutes , If user press dtmf for any specific task during playing audio , it should resume back to last point of audio state after finish task,
at present I am restarting audio again. Hope you understand my question.

exten => 4,n,Background(quizivr/2023/${LSelect}Lecture-244E)
exten => 4,n(LecturePlay),Background(${${SelectedBook}L${digitp2}})
exten => 4,n,Goto(6,1)

exten => 5,1,Playback(Hindiivr/suggestion/${LSelect}SuggestioncontactnoE)
exten => 5,n,Wait(1)
exten => 5,n,Playback(Hindiivr/${LSelect}AskQns2E)
exten => 5,n,Record(/root/tempfiles/LectureQns/${CALLER_ID}-${SelectedBook}-${Class${digitCL}BN${digitp}}-ChapterNo-${digitp2}-${EPOCH}:wav)
exten => 5,n,Goto(4,LecturePlay)

  1. Can you suggest how to announcement/file play after few seconds of playing audio. I mean existing main audio file will pause after 10 seconds and play announcement file , will resume main audio file.

The ‘controlplayback’ dialplan application can be used. It returns ${CPLAYBACKOFFSET} that can be passed on subsequent executions.

If you’re an AGI kind of guy, the AGI ‘stream file’ command returns the sample offset. You can pass the offset on a subsequent command.

File played to completion (note result=0):

<PJSIP/anonymous-00000000>AGI Rx << stream file "//tts-cache//watson//en//en-US_AllisonV3Voice//d15e1f4dac141055f0d92f74664a7eca" "#*0123456789"
    -- <PJSIP/anonymous-00000000> Playing '//tts-cache//watson//en//en-US_AllisonV3Voiccontye//d15e1f4dac141055f0d92f74664a7eca.slin' (escape_digits=#*0123456789) (sample_offset 0) (language 'en')
<PJSIP/anonymous-00000000>AGI Tx >> 200 result=0 endpos=23059

File interrupted by pressing ‘*’ (note result=42):

<PJSIP/anonymous-00000000>AGI Rx << stream file "//tts-cache//watson//en//en-US_AllisonV3Voice//d15e1f4dac141055f0d92f74664a7eca" "#*0123456789"
    -- <PJSIP/anonymous-00000000> Playing '//tts-cache//watson//en//en-US_AllisonV3Voice//d15e1f4dac141055f0d92f74664a7eca.slin' (escape_digits=#*0123456789) (sample_offset 0) (language 'en')
<PJSIP/anonymous-00000000>AGI Tx >> 200 result=42 endpos=12800

Thanks for reply.
Here I need to use Background type application because user can select different dfmf options during audio listening.

Please define ‘different DTMF options’ and explain why controlplayback and stream file won’t work.

Here I mean that user input through dtmf.
I will try soon controlplayback and share feedback.

yes, it is working with forward, reverse & pause. thanks.

Can you help with some dialplan code example without agi for our scenario to replay audio after pressing 5 from user using controlplayback.

@sedwards

controlplayback is working only with its digit not other dtmf keys, just checked.

Does anyone have an idea about a calling bot or a data filter bot? I need the code for a dialer that sends only filtered calls like inbound

Does anyone have an idea about a calling bot or a data filter bot?

Please define what you mean by these things.

I need the code for a dialer that sends only filtered calls like inbound

I have no idea what that means.

What are you trying to achieve?

Antony.

Please don’t hijack existing topics.

Please create a new topic for unrelated questions.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.