[HELP] extensions

What i’m trying to do is have the ability for asterisk to answer my call, someone punch in an extension and based on the extension they punch in asterisk ring one of the softphones connected to it…

right now i’m using xlite softphones

i’ve got asterisk answering the call, but it won’t ring another phone if i use the exten => s,n,WaitExten …
when i call asterisk, whether i punch in an extension or not i get this error

“WARNING[23119]: pbx.c:5517 pbx_builtin_waitexten: Timeout but no rule ‘t’ in context ‘mainmenu’”

i have absolutely no idea what this means…if i force every call received by asterisk to ring a certain softphone asterisk can do that just fine…

thanks for the help

What you’re seeing in the Asterisk console is letting you know you haven’t defined the t – or timeout – extension in that context. Much like s, it’s a special extension. When a caller doesn’t enter input in the time provided, the call times out and goes to the t extension.

The other thing to be aware of is that WaitExten only does exactly what it says – waits for the user to dial an extension. It won’t actually dial the extension. The extension the user dialed is stored in ${EXTEN}, so something like this will do what you’re trying to accomplish:

... ; Beginning of your s section
s,3,WaitExten(8)    ; Wait 8 seconds for an extension
s,4,Goto(${EXTEN}, 1)   ; Redirect to the dialed extension

thanks, that fixed the rule t problem

except for some reason ${EXTEN} is not being set as the extension i dial after WaitExten(8) it is the original number that was called.

I’m using a FWD account, so i dial my FWD number, the asterisk picks up, then does WaitExten(8) and it waits for the extension, except in the line Goto(${EXTEN},1) just brnigs me back to the first priority in my FWD number not the extension i dialed during the WaitExten period…

thanks for the help

now im no pro… not yet, but

${EXTEN} is the variable for the current extension

why dont you try setting the ext. as its own variable or using the actual ext itself.

SALES => Zap/3
SALES => Sip/salesphone

s,3,WaitExten(4) ; Wait 4 seconds for an extension
s,4,Goto(${SALES}, 1) ; Redirect to the dialed extension

my WaitExten(8) keeps posting as a smiley. :smile:

in that case wouldn’t it go to the SALES regardless of waht extension was entered? i want the caller to have options…

i see what youre saying. i was only using the sales group as an example.
what are the options the dialer has? is this a voice menu? im under the impression {EXTEN} is set to the current extension. meaning if youre in the s ext its going to keep you in s. do you have any additional context’s setup? rather than goto EXTEN, why not setup the contexts and have it goto that.

I have two xlite softphones connected to asterisk. I want someone to call my number, have asterisk answer (which works) and then they press 4 if they want phone1 or press 5 if they want phone2 adn based on what they press asterisk ring the appropriate phone

my problem is figuring out how to determine what they pressed (4 or 5 in this case)

something like this…
[] is your context
anything after Background is a recorded voice/sound


exten => s,1,Wait(10)
exten => s,2,Answer
exten => s,3,Background(welcome-msg) ; play the intro message
exten => s,4,Wait(20)

exten => 4,1,Dial(SIP/phone1) ; this may need to be tweaked a bit
exten => 5,1,Dial(SIP/phone2)
; edit/add more phones here

exten => *,1,Goto(s,3) ; * to repeat the menu
; put these options in your voice menu (optional of course)
exten => #,1,Background(goodbye) ; # to hang up
exten => #,2,Hangup

exten => t,1,Goto(i,1) ; If they take too long, give up
exten => i,1,Background(session-timeout) ; "Invalid choice"
exten => i,2,Wait(1)
exten => i,3,Goto(s,3)

etc etc

this should suit you fine
you would have to set incoming calls to go to this context
im assuming youre using sip