Background doesn't recognise keypress

Hi,

Can anybody explain why, in the following dialplan, context [ivr-works] works if you start with priority 1 but [ivr-doesnt-work] doesn’t when it’s priority starts with 5. They both play the welcome message but only [ivr-works] plays the option_1 message when the caller presses 1. [ivr-doesnt-work] plays the invalid_option message when the caller presses 1.

I’m running v1.6.0.9

Thanks,
redbook

[internal]
exten => 200,1,Dial(SIP/200)

exten => 400,1,Goto(ivr-works,s,1)
exten => 401,1,Goto(ivr-doesnt-work,s,5)

[ivr-works]
exten => s,1,Answer() ; starts with priority 1
exten => s,2,Wait(1)
exten => s,3,Background(welcome)
exten => s,4,Hangup()

exten => 1,1,Playback(option_1)
exten => 1,2,Hangup()

exten => i,1,Playback(invalid_option)
exten => i,2,Goto(s,3)

[ivr-doesnt-work]
exten => s,5,Answer() ; starts with priority 5
exten => s,6,Wait(1)
exten => s,7,Background(welcome)
exten => s,8,Hangup()

exten => 1,1,Playback(option_1)
exten => 1,2,Hangup()

exten => i,1,Playback(invalid_option)
exten => i,2,Goto(s,7)

Why are you satrting a context at priority 5?

Contexts start with 1

Ian

Didn’t realise they had to start at 1… I’d read this http://www.voip-info.org/wiki/index.php?page=Asterisk%20priorities which says they '…typically start at 1". Took that to mean you could start at any arbitrary number.

I’ve other dialplans that have 5 as the starting priority and they appear to work fine.

It would be helpful if Asterisk didn’t execute the context at all and gave a ‘no starting priority’ error rather than produce a weird result.

Anyway, learnt something new… so thanks.