Thanks for the pointer jcolp. It seems, the way I have it implemented, that your pointer is halve of the answer. This is what my dial plan looks like now. Option one in the menu is the routine to listen to a page of a book. After choosen option one one has to enter a page number and the # key. After that there is a check if the page is already recorded and then ControlPlayBack is doing its job. The control keys of ControlPlayBack are working all the time. 99 is not working at first but if I let the routine play all the pages and return to hoofdmenu,s,1 and start listening again then the 99 combination is working as planned while the recording of the page is played. When it is working it keeps on working. What is wrong with this solution and what causes it to work after returning to hoofdmenu,s,1 (main menu) after listening to the last page recorded. Thanks for any advice, examples and/or suggestions
[local-channel-bellen]
exten => 100,1,NoOp()
exten => 100,n,Goto(hoofdmenu,s,verder-met-hoofdmenu)
[hoofdmenu]
exten => s,1, Answer()
exten => s,n, Dial(local/100@local-channel-bellen/nj,30,r)
;exten => s,n,SET(__DYNAMIC_FEATURES=testfeature#pitch_up_them#pitch_lower_them#pitch_reset_them#raise-value-variable#show-value-variable)
exten => s,n(verder-met-hoofdmenu), Set(BOEK=nooitaf) ; bij meer boeken menu toevoegen
exten => s,n, Wait(1)
exten => s,n(start_hoofdmenu), Read(KEUS,luisterboek/hoofdmenu,1)
exten => s,n, GotoIf($[ “${KEUS}” : “1”]?luisteren,1,1) ; luisteren
exten => s,n, GotoIf($[ “${KEUS}” : “2”]?opnemen,2,1) ; inspreken
exten => s,n, GotoIf($[ “${KEUS}” : “3”]?eerstvolgende-bladzijde,3,1) ; eerste in te lezen pagina
exten => s,n, GotoIf($[ “${KEUS}” : “4”]?instructie,4,1) ; instructie
exten => s,n, GotoIf($[ “${KEUS}” : “5”]?ophangen,5,1) ; ophangen/verbreken verbinding
exten => s,n, Playback(luisterboek/ongeldige-menu-invoer)
exten => s,n, Goto(start_hoofdmenu)
[luisteren]
exten => 1,1, NoOp("De hoofdmenekeus is "${KEUS})
exten => 1,n, Read(BLADZIJDE,luisterboek/startpagina_luisteren)
exten => 1,n(luisteren), Set(PAD=/var/lib/asterisk/sounds/luisterboek/${BOEK}/${BLADZIJDE}/${BLADZIJDE}.gsm)
exten => 1,n, Set(FILE_EXISTS=${STAT(e,${PAD})})
exten => 1,n, NoOp("bij waarde 1 bestaat het bestand " ${FILE_EXISTS})
exten => 1,n, GotoIf($[ “${FILE_EXISTS}” : “0”]?opname_nog_niet_beschikbaar)
exten => 1,n, NoOp(“xx”)
;exten => 1,n, Set(PITCH_SHIFT(tx)=0.6); raises pitch an octave
exten => 1,n, SET(__DYNAMIC_FEATURES=like_feature)
exten => 1,n, ControlPlayback(luisterboek/${BOEK}/${BLADZIJDE}/${BLADZIJDE},7500,#,*,1,2,3)
;exten => 1,n, SET(__DYNAMIC_FEATURES=)
exten => 1,n, SET(BLADZIJDE=$[ ${BLADZIJDE}+1])
exten => 1,n, NoOp(“XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”)
exten => 1,n, NoOp("De waarde van variabele BLADZIJDE is " ${BLADZIJDE})
exten => 1,n, NoOp(“XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX”)
exten => 1,n, PlayBack(luisterboek/de-volgende-bladzijde-is-bladzijde)
exten => 1,n, SayNumber(${BLADZIJDE},m)
exten => 1,n, Goto(luisteren) ; in oneindige loop tot eind van boek of laatste bladzijde die ingelezen is
exten => 1,n(opname_nog_niet_beschikbaar), PlayBack(luisterboek/opname_nog_niet_beschikbaar)
exten => 1,n,Goto(hoofdmenu,s,1)
This is the cli output when it is working. For a split second musiconhold is turn on and this generates cli output.
– Started music on hold, class ‘default’, on channel ‘Local/100@local-channel-bellen-00000012;2’
– Stopped music on hold on Local/100@local-channel-bellen-00000012;2
– Started music on hold, class ‘default’, on channel ‘Local/100@local-channel-bellen-00000012;2’
– Stopped music on hold on Local/100@local-channel-bellen-00000012;2
This is the cli output when returning to hoofdmenu (main menu). This seems to add another local channel (from sip channel -> local channel to sip channel -> local channel -> local channel. Can
– <Local/100@local-channel-bellen-00000017;2> Playing ‘luisterboek/opname_nog_niet_beschikbaar.gsm’ (language ‘en’)
– Executing [1@luisteren:18] Goto(“Local/100@local-channel-bellen-00000017;2”, “hoofdmenu,s,1”) in new stack
– Goto (hoofdmenu,s,1)
– Executing [s@hoofdmenu:1] Answer(“Local/100@local-channel-bellen-00000017;2”, “”) in new stack
– Executing [s@hoofdmenu:2] Dial(“Local/100@local-channel-bellen-00000017;2”, “local/100@local-channel-bellen/nj,30,r”) in new stack
– Called local/100@local-channel-bellen/nj
– Executing [100@local-channel-bellen:1] NoOp(“Local/100@local-channel-bellen-00000018;2”, “”) in new stack
– Executing [100@local-channel-bellen:2] Goto(“Local/100@local-channel-bellen-00000018;2”, “hoofdmenu,s,verder-met-hoofdmenu”) in new stack
When the 99 isn’t working there isn’t any cli output related to the key combination.