The *MYSTERIOUS* extension 's'

[quote=“dgarstang”]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:

That contradicts what your saying. It doesn’t work with SIP.[/quote]

The ‘s’ extensions works just fine with SIP/IAX/H323 or any of the other channels that Asterisk uses.

MuppetMaster: In that case, do you have any idea, based on the numerous and varying portions of sip.conf and extensions.conf that I have posted, what it is not working? I simply cannot make the examples any more basic, yet it still does not work.

I am more than willing to assist, but you have not provided the detail necessary to assess the situation. As stated in various posts, what we need from you is:

  • Verbose CLI output from Asterisk when the error occurs

As I have mentioned before, a ‘Not found message’ appears to be a SIP configuration issue and not an extensions issue.

Here is an example of a CLI output where it works just fine:

[quote=“Asterisk CLI”]-- Call accepted by my_ip (format gsm)
– Format for call is gsm
> Channel IAX2/my_ip was answered.
– Executing Answer(“IAX2/my_ip:4569-5”, “”) in new stack
– Executing Wait(“IAX2/my_ip:4569-5”, “1”) in new stack
– Executing Answer(“IAX2/my_ip:4569-2”, “”) in new stack
– Executing Playback(“IAX2/my_ip:4569-2”, “lots-o-monkeys”) in new stack
– Playing ‘lots-o-monkeys’ (language ‘en’)
– Hungup ‘IAX2/my_ip:4569-19’[/quote]

based on this AEL code:

context test_campaign { s => { Answer(); Wait(1); Answer(); Playback(lots-o-monkeys); Hangup(); }; };

As you may see, the ‘s’ extension is clearly working as advertised.

MuppetMaster: I get absolutely nothing on the console of asterisk with ‘debug level 9’ when placing a call.

Here however are the SIP packets. The SIP hardphone (Polycom 601) is 192.168.10.124. Asterisk is 192.168.10.7

  1. Phone sends invite to Asterisk, for the number I dialled, ‘5’
  2. Asterisk requires proxy authentication.
  3. Phone sends an ACK and then a new INVITE with auth info to Asterisk.
  4. Asterisk sends back a 404 Not Found to the phone.
  5. Phone sends a final ACK to Asterisk.

U 192.168.10.124:5060 -> 192.168.10.7:5060
INVITE sip:5@voip.180internal.com;user=phone SIP/2.0.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK55e62a48E7F86449.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=C05B7FD2-5DBDDE05.
To: sip:5@voip.180internal.com;user=phone.
CSeq: 1 INVITE.
Call-ID: a0d25406-9ddab0b4-dca7bb8f@192.168.10.124.
Contact: sip:3250071@192.168.10.124.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER.
User-Agent: PolycomSoundPointIP-SPIP_600-UA/1.6.2.0041.
Supported: 100rel,replace.
Allow-Events: talk,hold,conference.
Max-Forwards: 70.
Content-Type: application/sdp.
Content-Length: 253.
.
v=0.
o=- 1131474308 1131474308 IN IP4 192.168.10.124.
s=Polycom IP Phone.
c=IN IP4 192.168.10.124.
t=0 0.
a=sendrecv.
m=audio 2240 RTP/AVP 0 8 18 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:18 G729/8000.
a=rtpmap:101 telephone-event/8000.

U 192.168.10.7:5060 -> 192.168.10.124:5060
SIP/2.0 407 Proxy Authentication Required.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK55e62a48E7F86449.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=C05B7FD2-5DBDDE05.
To: sip:5@voip.180internal.com;user=phone;tag=as059608dc.
Call-ID: a0d25406-9ddab0b4-dca7bb8f@192.168.10.124.
CSeq: 1 INVITE.
User-Agent: Asterisk PBX.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY.
Contact: sip:5@192.168.10.7.
Proxy-Authenticate: Digest realm=“asterisk”, nonce=“05846860”.
Content-Length: 0.
.

U 192.168.10.124:5060 -> 192.168.10.7:5060
ACK sip:5@voip.180internal.com SIP/2.0.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK55e62a48E7F86449.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=C05B7FD2-5DBDDE05.
To: sip:5@voip.180internal.com;user=phone;tag=as059608dc.
CSeq: 1 ACK.
Call-ID: a0d25406-9ddab0b4-dca7bb8f@192.168.10.124.
Contact: sip:3250071@192.168.10.124.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER.
User-Agent: PolycomSoundPointIP-SPIP_600-UA/1.6.2.0041.
Max-Forwards: 70.
Content-Length: 0.
.

U 192.168.10.124:5060 -> 192.168.10.7:5060
INVITE sip:5@voip.180internal.com;user=phone SIP/2.0.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK60072d2b46C43CE0.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=C05B7FD2-5DBDDE05.
To: sip:5@voip.180internal.com;user=phone.
CSeq: 2 INVITE.
Call-ID: a0d25406-9ddab0b4-dca7bb8f@192.168.10.124.
Contact: sip:3250071@192.168.10.124.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER.
User-Agent: PolycomSoundPointIP-SPIP_600-UA/1.6.2.0041.
Supported: 100rel,replace.
Allow-Events: talk,hold,conference.
Proxy-Authorization: Digest username=“3250071”, realm=“asterisk”, nonce=“05846860”, uri="sip:5@voip.180internal.com;user=phone", response=“411e81208e19869c30fb4ed55b55f4e8”, algorithm=MD5.
Max-Forwards: 70.
Content-Type: application/sdp.
Content-Length: 253.
.
v=0.
o=- 1131474308 1131474308 IN IP4 192.168.10.124.
s=Polycom IP Phone.
c=IN IP4 192.168.10.124.
t=0 0.
a=sendrecv.
m=audio 2240 RTP/AVP 0 8 18 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:18 G729/8000.
a=rtpmap:101 telephone-event/8000.

U 192.168.10.7:5060 -> 192.168.10.124:5060
SIP/2.0 404 Not Found.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK60072d2b46C43CE0.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=C05B7FD2-5DBDDE05.
To: sip:5@voip.180internal.com;user=phone;tag=as059608dc.
Call-ID: a0d25406-9ddab0b4-dca7bb8f@192.168.10.124.
CSeq: 2 INVITE.
User-Agent: Asterisk PBX.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY.
Contact: sip:5@192.168.10.7.
Content-Length: 0.
.

U 192.168.10.124:5060 -> 192.168.10.7:5060
ACK sip:5@voip.180internal.com SIP/2.0.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK60072d2b46C43CE0.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=C05B7FD2-5DBDDE05.
To: sip:5@voip.180internal.com;user=phone;tag=as059608dc.
CSeq: 2 ACK.
Call-ID: a0d25406-9ddab0b4-dca7bb8f@192.168.10.124.
Contact: sip:3250071@192.168.10.124.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER.
User-Agent: PolycomSoundPointIP-SPIP_600-UA/1.6.2.0041.
Max-Forwards: 70.
Content-Length: 0.

Here’s the relevant section of sip.conf:
[general]
context=local
port=5060
bindaddr=0.0.0.0
srvlookup=yes

[3250071]
accountcode=user1
type=friend
context=c_3250071
host=dynamic
mailbox=3250071@vm_www
username=3250071
secret=180
callerid=John Wayne <3250071>

And here’s the relevant section of extensions.conf:
[c_3250071]
exten => s,1,Answer
exten => s,2,Playback(tt-weasels)
exten => s,3,Hangup

So… dunno what else I can show you.

If you got nothing, definately a SIP problem as it is never finding the dial path in the first place. Good thing you ran SIP debug. Will take a look and see if I may determine what the problem is, but do not have the time right now for a detailed analysis.

At a quick check you are getting a 407 error (autheication required) and then a not found (404 error). Your call is never getting to the extensions.conf. You do need to review the way your phones are connecting to Asterisk and your sip.conf relative to those phones.

MuppetMaster, the 407 authentication isn’t an error in my understanding. it’s just part of the normal SIP authentication process. The phone sends the INVITE request, and Asterisk asks for authentication. The phone resends the INVITE with the correct credentials and all is ok.

Here’s another SIP output.

U 192.168.10.124:5060 -> 192.168.10.7:5060
INVITE sip:5000@voip.180internal.com;user=phone SIP/2.0.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK98546d5cE2752E0D.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=8B100DC6-8EC64109.
To: sip:5000@voip.180internal.com;user=phone.
CSeq: 1 INVITE.
Call-ID: 865a7dba-22476608-8643e973@192.168.10.124.
Contact: sip:3250071@192.168.10.124.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER.
User-Agent: PolycomSoundPointIP-SPIP_600-UA/1.6.2.0041.
Supported: 100rel,replace.
Allow-Events: talk,hold,conference.
Max-Forwards: 70.
Content-Type: application/sdp.
Content-Length: 253.
.
v=0.
o=- 1131480428 1131480428 IN IP4 192.168.10.124.
s=Polycom IP Phone.
c=IN IP4 192.168.10.124.
t=0 0.
a=sendrecv.
m=audio 2260 RTP/AVP 0 8 18 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:18 G729/8000.
a=rtpmap:101 telephone-event/8000.

U 192.168.10.124:5060 -> 192.168.10.7:5060
ACK sip:5000@voip.180internal.com SIP/2.0.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK98546d5cE2752E0D.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=8B100DC6-8EC64109.
To: sip:5000@voip.180internal.com;user=phone;tag=as3d5c6a74.
CSeq: 1 ACK.
Call-ID: 865a7dba-22476608-8643e973@192.168.10.124.
Contact: sip:3250071@192.168.10.124.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER.
User-Agent: PolycomSoundPointIP-SPIP_600-UA/1.6.2.0041.
Max-Forwards: 70.
Content-Length: 0.
.

U 192.168.10.124:5060 -> 192.168.10.7:5060
INVITE sip:5000@voip.180internal.com;user=phone SIP/2.0.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK63849e4f98DDD874.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=8B100DC6-8EC64109.
To: sip:5000@voip.180internal.com;user=phone.
CSeq: 2 INVITE.
Call-ID: 865a7dba-22476608-8643e973@192.168.10.124.
Contact: sip:3250071@192.168.10.124.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER.
User-Agent: PolycomSoundPointIP-SPIP_600-UA/1.6.2.0041.
Supported: 100rel,replace.
Allow-Events: talk,hold,conference.
Proxy-Authorization: Digest username=“3250071”, realm=“asterisk”, nonce=“597483e4”, uri="sip:5000@voip.180internal.com;user=phone", response=“583b2f6a2ae5630fafd62f8ebec3eefd”, algorithm=MD5.
Max-Forwards: 70.
Content-Type: application/sdp.
Content-Length: 253.
.
v=0.
o=- 1131480428 1131480428 IN IP4 192.168.10.124.
s=Polycom IP Phone.
c=IN IP4 192.168.10.124.
t=0 0.
a=sendrecv.
m=audio 2260 RTP/AVP 0 8 18 101.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:18 G729/8000.
a=rtpmap:101 telephone-event/8000.

U 192.168.10.7:5060 -> 192.168.10.124:5060
SIP/2.0 100 Trying.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK63849e4f98DDD874.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=8B100DC6-8EC64109.
To: sip:5000@voip.180internal.com;user=phone.
Call-ID: 865a7dba-22476608-8643e973@192.168.10.124.
CSeq: 2 INVITE.
User-Agent: Asterisk PBX.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY.
Contact: sip:5000@192.168.10.7.
Content-Length: 0.
.

U 192.168.10.7:5060 -> 192.168.10.124:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK63849e4f98DDD874.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=8B100DC6-8EC64109.
To: sip:5000@voip.180internal.com;user=phone;tag=as2b22efce.
Call-ID: 865a7dba-22476608-8643e973@192.168.10.124.
CSeq: 2 INVITE.
User-Agent: Asterisk PBX.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY.
Contact: sip:5000@192.168.10.7.
Content-Type: application/sdp.
Content-Length: 261.
.
v=0.
o=root 6306 6306 IN IP4 192.168.10.7.
s=session.
c=IN IP4 192.168.10.7.
t=0 0.
m=audio 18632 RTP/AVP 3 0 8 101.
a=rtpmap:3 GSM/8000.
a=rtpmap:0 PCMU/8000.
a=rtpmap:8 PCMA/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=silenceSupp:off - - - -.

U 192.168.10.124:5060 -> 192.168.10.7:5060
ACK sip:5000@192.168.10.7 SIP/2.0.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK388710a0FD626B41.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=8B100DC6-8EC64109.
To: sip:5000@voip.180internal.com;user=phone;tag=as2b22efce.
CSeq: 2 ACK.
Call-ID: 865a7dba-22476608-8643e973@192.168.10.124.
Contact: sip:3250071@192.168.10.124.
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER.
User-Agent: PolycomSoundPointIP-SPIP_600-UA/1.6.2.0041.
Max-Forwards: 70.
Content-Length: 0.
.

U 192.168.10.124:5060 -> 192.168.10.7:5060
BYE sip:5000@192.168.10.7 SIP/2.0.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK214b911eFCDD8E47.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=8B100DC6-8EC64109.
To: sip:5000@voip.180internal.com;user=phone;tag=as2b22efce.
CSeq: 3 BYE.
Call-ID: 865a7dba-22476608-8643e973@192.168.10.124.
Contact: sip:3250071@192.168.10.124.
User-Agent: PolycomSoundPointIP-SPIP_600-UA/1.6.2.0041.
Proxy-Authorization: Digest username=“3250071”, realm=“asterisk”, nonce=“597483e4”, uri="sip:5000@voip.180internal.com;user=phone", response=“583b2f6a2ae5630fafd62f8ebec3eefd”, algorithm=MD5.
Max-Forwards: 70.
Content-Length: 0.
.

U 192.168.10.7:5060 -> 192.168.10.124:5060
SIP/2.0 200 OK.
Via: SIP/2.0/UDP 192.168.10.124;branch=z9hG4bK214b911eFCDD8E47.
From: “J. Wayne” sip:3250071@voip.180internal.com;tag=8B100DC6-8EC64109.
To: sip:5000@voip.180internal.com;user=phone;tag=as2b22efce.
Call-ID: 865a7dba-22476608-8643e973@192.168.10.124.
CSeq: 3 BYE.
User-Agent: Asterisk PBX.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY.
Contact: sip:5000@192.168.10.7.
Content-Length: 0.
.

This time I dialled 5000, and I modified my extensions.conf to
[c_3250071]
exten => 5000,1,Answer
exten => 5000,2,Playback(tt-weasels)
exten => 5000,3,Hangup

and it works. This very heavily implies to me that it IS getting to extensions.conf. Asterisk is just choosing not to execute the s extension.

Definately a SIP config problem somewhere, as the extensions.conf is never being reached due to the SIP errors.

Also, on 407:

Source

MuppetMaster: A couple of things. First of all this isn’t a REGISTER request. It’s an INVITE, so your diagram is not relevant.

In any case, the phone has already sucessfully registered, because asterisk is aware of it, and can route calls to it with Dial(). I wish asterisk had better output when showing which friends are registered tho. That’s annoying.

Anyway, the phone is registered. I don’t know why Asterisk sends that proxy auth when a phone sends an INVITE, but it clearly isn’t a problem because calls DO GO THROUGH from this phone, and the phone gets a 200 OK from Asterisk when it does send auth credentials.

This clearly isn’t a SIP configuration problem.

Good point, this is not a register it is an invite and indeed is the correct response, so the issue is only with the 404 error.

Contribute some code to the Asterisk project as complaining is meaningless, it is what it is as it is a community effort.

[quote=“dgarstang”]Anyway, the phone is registered. I don’t know why Asterisk sends that proxy auth when a phone sends an INVITE, but it clearly isn’t a problem because calls DO GO THROUGH from this phone, and the phone gets a 200 OK from Asterisk when it does send auth credentials.

This clearly isn’t a SIP configuration problem.[/quote]

Yes, it is. You are attempting to dial a SIP URI that does not exist on your system.

To solve your problem, ultimately you need to delve into Macros as recommended before.

So, in your dialplan, you would dial something like 91X. to get an outside line:

[outbound]

exten => _91X.,1,Macro(set-caller-id)
exten => _91X.,2,Dial(whatever)

[macro-set-caller-id]

exten => s,1,do_my_stuff_here

If necessary, you may also call an AGI instead of a Macro to do the same thing.

How can it be a SIP configuration problem? These sip users are routable. A dial() command is able to reach them. Everything else is working fine. The users DO REGISTER with Asterisk.
.

It is a SIP configuration issue as you are attempting to dial a non-existant SIP URI on your system. This does not mean that your /etc/asterisk/sip.conf is wrong for your end-points, but that your overall SIP configuration is flawed within Asterisk. The 404 error is in response to attempting to dial a ‘5@your_asterisk_box’ where no 5 exists.

MuppetMaster: I misinterpreted you. I thought you where referring to the SIP authorisation process as being flawed. As I said, Asterisk would not send back a 200 OK if the user was not authorised.

Now, of course I am trying to a dial a non existent extension. That’s what the ‘s’ extension is supposed to do, and why we’re now up to ~30 posts on this thread.

We’re going in circles here. Dialling 9 won’t help me. The ‘s’ extension is supposed to pick up when no valid extensions exist. We want the ‘s’ extension to pick up the call BEFORE it matches anything else, so we can perform setup information for the call… ie make it a 's’tart extension.

Indeed, we are going in circles and forgetting what we set out to do. What you have to understand is that you must dial something in order to invoke an extension in extensions.conf. This does not mean that the extension must dial something at all. In fact, you could dial an extension that in turn does nothing but turn on a coffee maker for you and never dials anything else.

So, as stated before, you need to do a Macro that does your call setup (using the ‘s’ extension) before you issue a Dial command. This may be done in the following ways:

  • If a small number of users, a series of GotoIf’s evaluating on individual users and skipping through points in a dialplan assigning call ids would work fine.
  • If there are more, then you need to use a database to do the storage and assignment.
  • This may be done within the dialplan itself, using extensions or AEL or a branch out to an AGI (Perl, Python, PHP, Java, C, etc).

These types of applications are done all the time, to do pre-call processing before issuing a dial command.

In order to stop going in circles, I would be happy to log into your server and help you setup such a scenario (using AEL - which would mean v1.2+), and then work with you to test it. Just PM me with details on how to get an SSH session and we may do this tomorrow.

OK, I’m afraid to ask this question, but if I can’t get it to execute on the ‘s’ extension, how am I going to get it to execute a macro???

Do you enjoy bloodying your head against a wall? I have already provided the answer to your question, more than once:

[code][outbound]

exten => _91X.,1,Macro(set-caller-id)
exten => _91X.,2,Dial(whatever)

[macro-set-caller-id]

exten => s,1,do_my_stuff_here [/code]

The user may then dial 913035551212 (with outbound as the context in their sip.conf entry) and the Macro will be called for pre-call processing before the number is ever actually dialed. As I have said many times before, something must be ‘dialed’ from the endpoint to invoke a context.

If you are looking for a user to manually set their caller id, before they dial a number (ie - dial 5 if you want to set your private ID, dial 6 if you want to set it to a group ID and then these would set a GlobalVar for each user) then you would need to setup those contexts, but you are still dialing an extension from the end-point.

Ok, I’m just going to drop this because your failing to grasp what I am trying to do.

A number IS actually dialled.

Use GlobarVar? Are you suggesting I define a several hundred or several thousand global variables? lol

[quote=“dgarstang”]Ok, I’m just going to drop this because your failing to grasp what I am trying to do.

A number IS actually dialled.

Use GlobarVar? Are you suggesting I define a several hundred or several thousand global variables? lol[/quote]

Who ever suggested setting global vars? Further, I had asked in a previous post whether this was a few, or many, as that would determine if you could do an AEL case/switch statement or needed to use a DB.

It is sad to watch you chase your tail so much. Good luck!

I was just reading through all the messages in this thread. For all the examples I have provided, all the SIP debug and so forth, not a single person has been able to come up with a single pointer as to why a context with no extensions is not dialling the s extension. Awesome.

You have been told several times, you choose to ignore the responses. Stop fighting Asterisk and try to understand how it actually works.

As stated before, the SIP 404 message is received as you are attempting to dial a SIP URI that does not exist on your Asterisk switch (in the first case a 5). You have also been told how to work through this issue in this very thread.

If you choose to ignore the way Asterisk works, of course you will not be successful.

sigh Yes. I am dialling a non existent extension.

That-is-what-the-s-extention-is-supposed-to-handle.

“This is the start extension. If a call comes in on a given context that does not have an extension associated with it, the call will begin at this extension”