Asterisk Responds 404 to OPTIONS from Provider

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

Asterisk Responds 404 to OPTIONS from Provider

Postby rcrcr » Mon May 13, 2013 1:14 pm

Hello,

I have a fairly simple installation of Asterisk PBX 11.3.0.

I am noticing when I 'sip set debug peer provider', though, that Asterisk is frequently responding '404 Not Found' to OPTIONS messages from my VoIP Provider.

Here is a sample of the SIP debug, with some limited redaction for a public forum:

Code: Select all
<--- SIP read from UDP:[PROVIDER-IP]:5060 --->
OPTIONS sip:[DID-FROM-PROVIDER]@[ASTERISK-IP]:5060 SIP/2.0
Via: SIP/2.0/UDP [PROVIDER-IP];rport;branch=z9hG4bKguggnwwe
To: <sip:[DID-FROM-PROVIDER]@[ASTERISK-IP]>
From: <sip:ping@[PROVIDER-DOMAIN].com>;tag=519136
Call-ID: 8d2c61052bbef8e9-5191@ping.[PROVIDER-DOMAIN].com
CSeq: 35099 OPTIONS
Contact: <sip:ping@[PROVIDER-IP]>
Accept: application/sdp
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Looking for 5678 in default (domain [ASTERISK-IP])

<--- Transmitting (no NAT) to [PROVIDER-IP]:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP [PROVIDER-IP];rport;branch=z9hG4bKguggnwwe;received=[PROVIDER-IP]
From: <sip:ping@[PROVIDER-DOMAIN].com>;tag=519136
To: <sip:[DID-FROM-PROVIDER]@[ASTERISK-IP]>;tag=as69a5b089
Call-ID: 8d2c61052bbef8e9-5191@ping.[PROVIDER-DOMAIN].com
CSeq: 35099 OPTIONS
Server: Asterisk PBX 11.3.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Accept: application/sdp
Content-Length: 0



extensions.conf looks like this:

Code: Select all
[incoming]
exten => 5678,1,Dial(SIP/softphone,60)
exten => 5678,n,Hangup()

[outgoing]
exten => _X.,1,Dial(SIP/${EXTEN}@provider)
exten => _X.,n,Hangup()


sip.conf looks like this:

Code: Select all
[general]
disallow=all
allow=ulaw
allow=alaw
allow=g729
qualify=yes
directrtpsetup=yes
allowguest=no
alwaysauthreject=yes
udpbindaddr=0.0.0.0:5060
tcpenable=yes
tcpbinaddr=0.0.0.0:5060
maxexpiry=720
defaultexpiry=600
register => [PROVIDER-CREDENTIALS]@[PROVIDER-SIP-SERVER]/5678

[provider]
defaultusername=[REDACTED]
username=[REDACTED]
fromuser=[REDACTED]
type=peer
secret=[REDACTED]
insecure=port,invite
host=[PROVIDER-SIP-SERVER]
qualify=5000
dtmfmode=auto
context=incoming
transport=udp

[softphone]
type=friend
context=outgoing
host=dynamic
secret=[REDACTED]
transport=tcp
qualify=0



Any thoughts on how to fix the 404 repsonse to OPTIONS from the provider?

Thanks.
rcrcr
Newsterisk
 
Posts: 4
Joined: Mon May 13, 2013 12:52 pm

Re: Asterisk Responds 404 to OPTIONS from Provider

Postby navaismo » Mon May 13, 2013 1:21 pm

default != incoming
navaismo
Salt of the Asterisk
 
Posts: 1610
Joined: Mon Dec 07, 2009 1:30 pm
Location: Mexico City, Mexico

Re: Asterisk Responds 404 to OPTIONS from Provider

Postby rcrcr » Mon May 13, 2013 1:37 pm

Thanks. I am sure is this most naive question you have ever heard (learning Asterisk on my own from scratch), but how do I best remedy that?

Do I set the default context somehow, and if so, how?

Thanks.
rcrcr
Newsterisk
 
Posts: 4
Joined: Mon May 13, 2013 12:52 pm

Re: Asterisk Responds 404 to OPTIONS from Provider

Postby navaismo » Mon May 13, 2013 1:47 pm

Take a look on www.asteriskdocs.org

About your issue change the context of your trunk, your debug seems looking for "deafult" context and you have defined "incoming" so, or you change default for incoming or create default too.
navaismo
Salt of the Asterisk
 
Posts: 1610
Joined: Mon Dec 07, 2009 1:30 pm
Location: Mexico City, Mexico

Re: Asterisk Responds 404 to OPTIONS from Provider

Postby david55 » Mon May 13, 2013 4:20 pm

It normally doesn't need fixing, e.g. when Asterisk sends options to check a connection, it considers a 404 response to indicate a good connection.

If you want to send something other than 404, you will need to define an extension called ping. I would rather suspect if it is using that user part that it will be happy with a 404 response.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: Asterisk Responds 404 to OPTIONS from Provider

Postby rcrcr » Mon May 13, 2013 5:47 pm

I was able to supress the 404 and get a 200 instead by adding a [default] context in extensions.conf which was a duplicate of the [incoming] context:

Code: Select all
[incoming]
exten => 5678,1,Dial(SIP/softphone,60)
exten => 5678,n,Hangup()

[outgoing]
exten => _X.,1,Dial(SIP/${EXTEN}@provider)
exten => _X.,n,Hangup()

[default]
exten => 5678,1,Dial(SIP/softphone,60)
exten => 5678,n,Hangup()


No changes were made to sip.conf.

Anything wrong with this?

Any security implications I am not thinking about?

Thanks!
rcrcr
Newsterisk
 
Posts: 4
Joined: Mon May 13, 2013 12:52 pm

Re: Asterisk Responds 404 to OPTIONS from Provider

Postby david55 » Tue May 14, 2013 12:46 am

You need to be more careful about the allowguest setting as unknown callers will now be treated the same as your ITSP.

If OPTIONS really is handled in a different context from incoming calls from the same ITSP, there may be a bug, but, as I said, it hasn't concerned us, because we have always found 404 an acceptable response.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: Asterisk Responds 404 to OPTIONS from Provider

Postby rcrcr » Tue May 14, 2013 7:04 am

In sip.conf, I already have:

Code: Select all
[general]
...
allowguest=no
...


Would that not suffice? Should I reassert 'allowguest=no' in the [default] context? Would that do it?
rcrcr
Newsterisk
 
Posts: 4
Joined: Mon May 13, 2013 12:52 pm


Return to Asterisk Support

Who is online

Users browsing this forum: No registered users and 1 guest