Hi list, I am having some difficulty implementing a certain dialplan where the following happens. If the first Dial() is not answered, I want to play a small greeting then ask the caller to either hold the line (try calling again) or press 1 to leave voicemail. exten => s,1,Dial(${BLAH},10,Tt) ; Dial 10 sec exten => s,2,Answer exten => s,3,Playback(greeting) exten => s,4,Playback(werebusy) exten => s,5,DigitTimeout(1) exten => s,6,ResponseTimeout(3) exten => s,7,Read(WHAT,holdormsg,1) ; "Hold the line, or press 1 to leave a msg.." exten => s,8,Gotoif($[${WHAT} = 1]?30) exten => s,9,Dial(${BLAH},15,Ttm) ; Dial another 15 sec with music on hold exten => s,10,Goto(7) ; Loop My problem is that if the caller doesn't press a key when prompted, and the Read() is allowed to time out (3 seconds), (s,7) returns non-zero and asterisk hangs up on the caller without further execution. I want it to continue down the priorities and redial the line, with hold music.. It doesn't even get to test the value of ${WHAT} if nothing is entered. However, if the caller enters an number other than 1, it will perform properly and redial the line. -- Executing Read("vpb/1-1", "WHAT|holdormsg|1") in new stack -- Accepting a maximum of 1 digits. -- Playing 'holdormsg' (language 'en') -- User entered '' == Spawn extension (blah, s, 9) exited non-zero on 'vpb/1-1' == vpb/1-1: Hangup requested == vpb/1-1: Ending record mode (1/yes) == vpb/1-1: Ending play mode on vpb/1-1 == vpb/1-1: Hangup complete Any ideas what could be wrong ? Cheers Troy
As far as I can see the problem is with the Read() function. When this function times out due to no user input, the extension is terminated and the call is hung up. Maybe this was the intended behaviour, but I can't see how its of any use.. Surely this is not the most desirable behaviour ? Please anyone who can shed some light ? or offer a workaround ? T On 06/01/2005, at 10:22 AM, Troy wrote:> Hi list, > > I am having some difficulty implementing a certain dialplan where the > following > happens. If the first Dial() is not answered, I want to play a small > greeting then > ask the caller to either hold the line (try calling again) or press 1 > to leave > voicemail. > > exten => s,1,Dial(${BLAH},10,Tt) ; Dial 10 sec > exten => s,2,Answer > exten => s,3,Playback(greeting) > exten => s,4,Playback(werebusy) > exten => s,5,DigitTimeout(1) > exten => s,6,ResponseTimeout(3) > exten => s,7,Read(WHAT,holdormsg,1) ; "Hold the line, or > press 1 to leave a msg.." > exten => s,8,Gotoif($[${WHAT} = 1]?30) > exten => s,9,Dial(${BLAH},15,Ttm) ; Dial another > 15 sec with music on hold > exten => s,10,Goto(7) ; Loop > > My problem is that if the caller doesn't press a key when prompted, > and the Read() > is allowed to time out (3 seconds), (s,7) returns non-zero and > asterisk hangs up > on the caller without further execution. I want it to continue down > the priorities and > redial the line, with hold music.. It doesn't even get to test the > value of ${WHAT} > if nothing is entered. However, if the caller enters an number other > than 1, it will > perform properly and redial the line. > > -- Executing Read("vpb/1-1", "WHAT|holdormsg|1") in new stack > -- Accepting a maximum of 1 digits. > -- Playing 'holdormsg' (language 'en') > -- User entered '' > == Spawn extension (blah, s, 9) exited non-zero on 'vpb/1-1' > == vpb/1-1: Hangup requested > == vpb/1-1: Ending record mode (1/yes) > == vpb/1-1: Ending play mode on vpb/1-1 > == vpb/1-1: Hangup complete > > Any ideas what could be wrong ? > > Cheers > Troy > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > lists.digium.com/mailman/listinfo/asterisk-users > To UNSUBSCRIBE or update options visit: > lists.digium.com/mailman/listinfo/asterisk-users >