The *MYSTERIOUS* extension 's'

Well, I’ve been playing with Asterisk for a week or two now and eventhough I’ve read the docs many times, I still cannot get the ‘s’ extension to work. I’ve asked many times in this forum and never gotten a concrete answer. I would LOVE it if someone could explain to me why this doesn’t work.

sip.conf:
[5551212]
context=c_5551212

extensions.conf:
[c_5551212]
exten => s,1,Answer
exten => s,2,Playback(tt-weasels)
exten => s,3,Hangup

Based on the many many docs I have read and the many posts I have read on numerous discussion forums, what I have above should work. There are NO OTHER extensions defined in the context, so therefore all calls should be picked up by the ‘s’ extension, but they are not!

The only thing I’m unsure about is that they say that the ‘s’ extension is for INCOMING calls. What is an INCOMING call exactly? Incoming from WHO’s perspective? Does that mean incoming into asterisk? Incoming into a dialled peer? What exactly does that mean?

I’ve just looked over all the examples I could find where people used the ‘s’ extension. I’m doing the same thing as they are. They have a context:

[context]

and then they immediately have dialplan commands with the ‘s’ extension, exactly like I have. I just DO NOT GET IT

Here’s the defintion of the ‘s’ extension from the Asterisk Wiki.

"The “s” extension is used when there is no known called number in the context used.

Incoming calls are always placed in a context in the dialplan, either one you specify in the channel configuration file, or the default context. If no other match exist for the call within the context, the s extension is activated. "

Welll, what’s the defintion of an incoming call? Incoming from who’s perspective? No known called number? Is this before or after matching other numbers? Why does it say that the s extension is only called when you don’t specify a context? What does that mean? That makes no sense. My sip.conf file specifies a default starting context for each user. When execution begins at that user’s context in extensions.conf, I want it to execute the s extension. Why can’t I do this in a specified context??? That makes absolutely no sense.

What does the CLI show, with a verbosity of atleast 4, when you make the call? There could be a problem with your config file. What did you edit it in? Try running it through dos2unix if it came from a windows machine.

zmanea, don’t bother asking for log output, i’m not sure doug wants to post info like that, someone may end up actually helping him.

doug, why post repeatedly about the same thing when you already have the info ? if 1000s of other users can get Asterisk to work, but not you, maybe it’s you that’s the problem.

you’ve had offers of help you’ve not even acknowledged, yet you’re still here posting the same incomplete .conf files and no log output. why ? is it now a mission to prove that Asterisk is at fault here ?

So, I started Asterisk with ‘asterisk -cvvvvvvvvvvv’ and then ran ‘debug level 4’ and executred my dial. Nothing appears on the console. I also tried it with 'debug level 9. Still no output.

Here’s my complete sip.conf file with comments removed.

realm=voip.com
bindport=5060
bindaddr=0.0.0.0
srvlookup=ye

[2001]
context=c_2001
type=friend
host=dynamic
canreinvite=yes
disallow=all
allow=gsm
allow=ulaw
allow=alaw
username=2001
secret=foo

Here’s my complete extensions.conf with comments removed.
[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
priorityjumping=no
[globals]
CONSOLE=Console/dsp
IAXINFO=guest
TRUNK=Zap/g2

[c_2001]
exten => s,1,Answer
exten => s,2,Playback(tt-weasels)
exten => s,3,Hangup

OH! Look at that! It looks JUST like the file sections I have been cutting and pasting for the last several days. I don’t know what else you expect me to give you. Here’s the config files. I dial a number, say, 123 from user 20001, and asterisk returns a ‘404 Not Found’.

comments like that mean i can now say “sod off !!” you carry on whining about this, while i’ll continue installing and playing with Asterisk.

MY system works, YOURS doesn’t, and i’m stupid ?? i give up :open_mouth:

Hey, I’m giving you the info you’ve requested, and you still complain. Good grief. I don’t know what else you expect me to provide. Looks like someone can’t take critisicsm, because it turns out what I have been cutting and pasting here for days really is what my config looks like.

complaining, me ? no, i’m the one sat here laughing at you paying 800 bucks for a system you can’t make a simple call with, despite all the docs in the world !!

now if you had followed some much earlier advice and made/read samples you wouldn’t still be at step 1. but thanks for the giggle and the inspiration to write a blocklist AGI anyway.

What the hell, I’ll take a shot at answering. I’ve only been using * a few weeks so this is based on my limited experience.

The s extension will only be selected when a call enters a context without a target extension defined. Imagine a ZAP channel (regular phone line), it rings, asterisk answers but it has no idea what the target extension will be so it throws it into s.

Why doesn’t this work with SIP? When a SIP packet comes in, it has the target extension in the packet so instead of sending it to s it tries to send the call to the target extension. If the target extension can’t be matched it sends a not found back to the SIP phone, basically telling you you dialed a wrong number.

Who said I’m not making calls. I think you just did. We’re making calls. We are able to make outgoing calls from asterisk, send them to SER, onto an Audiocodes Mediant Gateway, and the onto our class 5 switch. Same deal for incoming calls.

I just found this on the Asterisk Wiki…
"For some kinds of connections — such incoming calls from an outside telephone line — the user has not dialed an extension. In that case, Asterisk behaves as if the user had dialed a special extension named “s” (for Start). Asterisk will look for an extension “number” s in the definition of the context for that channel for instructions about what it should do to handle the call. "

Gee. This seems relevant, and it’s the first time I’ve seen it expressed. It says that the s extension is only used for calls coming from an OUTSIDE telephone line. I assume therefore that this means that calls coming from a Polycom phone cannot be handled by the s extension. If that’s true, the question is how we can make calls coming from a local SIP Polycom phone be picked up by a special extension. Just what’s the definition of an ‘outside line’ anyway???

still laughing !! have fun, and watch the pressure cooker in your head.

sweazle: Thanks for the reply. Most useful info I’ve received so far. It seems that all the documentation has forgotten to mention this rather important detail about the s extension and SIP. This is a pure SIP implementation and I’ve never touched ZAP, so I can’t imagine how a dialled number can’t have an extension, but that’s not important.

This seems like a pretty serious limitation of Asterisk then. I need to find a way to have SIP calls execute some set of special setup commands before a call is placed. I was thinking about implementing the entire dial plan with AGI, and thought maybe I could so something like:

exten => s,AGI(script)

and use that as a single access point for the entire dial plan. If SIP calls won’t execute the s extension, then It seems like I’m screwed on this and a lot of other features in Asterisk.

Oh, and baconbuttie: What percentage of all those docs in the world do you think mention what sweazle just told me about s and ZAP? It’s about quality, not quantity, and most of the Asterisk docs are crap. I guess you where either a) too ignorant to know about how the s extension works with SIP or b) too busy laughing at my alleged misfortune.

I can’t say this is a limitation of Asterisk. It may be the way SIP works. I haven’t read the SIP spec but I would hesitate to assume it is a problem with Asterisk. If the SIP spec says that the packet must carry the target then Asterisk is operating correctly.

What about:
exten => _.,AGI(script)

That should match any dialed number.

[quote=“dgarstang”]
Oh, and baconbuttie: What percentage of all those docs in the world do you think mention what sweazle just told me about s and ZAP? It’s about quality, not quantity, and most of the Asterisk docs are crap.[/quote]

I have to disagree here. I found the wiki to have an incredible amount of good info. I would have been lost without it and the demo files. I had never touched a PBX before and was able to get it going with multiple differnt companies on one box in about 3 days.

sweazle: We’ll have to agree to disagree on the quality of the asterisk docs.

Your right, exten => _.,1,AGI(script) will match all numbers and provide a single access point into a dial plan application.

I think part of my problem is that I’m trying to create an environment where asterisk can host multiple independant businesses. Seems like most people are providing services to one company only, and that makes it more complex. We absolutely must provide servides that no one else seems to be discussing here. For example, the ability to mask all numbers from a certain business with the one main number calling id, but still be able to use the caller id on the phones to log into ACD Queues etc. Thats why I was trying to set the caller id on outgoing calls. Or, providing user-level number blocking, or the ability to have calls placed in an ACD Queue AND dial sip users concurrently. People who are switching from old PSTN phone systems won’t switch unless their functionality carries over. Asterisk should be able to do all these things as Digum states the business edition is ‘carrier grade’.

the docs are fine, it’s how you use the info they give you.

remember the blocklist thing … well, the first line of my internal dialplan calls the AGI i wrote, like this

exten => s,1,AGI,bbBlocked.agi ; Check to see if called number is blocked for this caller : n+101 for fail so maybe i do know how it works 'cos it works from SIP phones too.

i’m not laughing at your alleged misfortune, i’m laughing at you.

Well then, kindly explain to us how it can work when it isn’t supposed to. With the lead that Zweazle gave me, I was able to find documentation supporting what he said.

Couple final comments for the night:

My ZAP example was incomplete, image the ZAP line is coming in from the phone company, that is why Asterisk has no idea what the target extension will be.

You can run multiple companies on one asterisk box (I’m running 2), the only part I haven’t figured out is parking as they seem to share a common lot but there are extension to asterisk that may allow separate lots, it isn’t an issue for me yet.

Contexts are the key, go to the pub/bar/coffee shop sit and read about contexts until you can’t stand it any more then go for one more hour and it will all fall into place. Took me 2.5 days of reading/playing with the demo files, lots of headaches, wanting to punch the server, etc. Then it all clicked and the config files just fell into place and I understood the logic behind the Asterisk system.

sweazle: I’d love to. I’ve been looking. Docs on contexts are pretty thin. Even the O’reilly book has few details. It just seems to be quoting the other limited sources out there, which is pretty disappointing for an O’Reilly book.

[quote=“baconbuttie”]

remember the blocklist thing … well, the first line of my internal dialplan calls the AGI i wrote, like this

exten => s,1,AGI,bbBlocked.agi ; Check to see if called number is blocked for this caller : n+101 for fail [/quote]

I’m gonna have to try that one! If I can get that to work I may have a few ideas for things.

Just poured over several sip.conf and extensions.conf examples.
Tried this…

sip.conf:
[general]
context=default

[2001]
context=default

extensions.conf
[default]
exten => s,1,Answer
exten => s,2,Playback(tt-weasels)
exten => s,3,Hangup

Still no go. Back to the drawing board.

I think your mistaken baconbuttie. Just found this:

“The “start” extension. A call which does not have digits associated with it (for example, a loopstart analog line) begins at the “s” extension.”

at:
66.102.7.104/search?q=cache:jBNv … conf&hl=en

That contradicts what your saying. It doesn’t work with SIP.