[Home]

Summary:ASTERISK-26337: chan_sip: Received "Forbidden" on qualify messages
Reporter:Hannes Kroeger (hkroeger)Labels:
Date Opened:2016-09-05 07:05:57Date Closed:2016-10-26 08:06:11
Priority:MajorRegression?
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:11.13.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Debian 8.5Attachments:
Description:If "qualify" is set to "yes", the qualify messages are answered by "Forbidden" by the provider. I suspect, this is because the "fromdomain" setting is not properly respected in the qualify messages.

The whole configuration only works for some minutes. After that, no incoming or outgoing calls can be made any more.

The sip.conf section is here:
{noformat}
[O2Line]
type=peer
insecure=port,invite
nat=force_rport
username=493811216473
fromuser=493811216473
fromdomain=sip.alice-voip.de
secret=***********
host=sip.alice-voip.de
qualify=no
canreinvite=no
dtmfmode=rfc2833
context=default
callbackextension=493811216473
outboundproxy=sip.alice-voip.de
trustrpid=yes
sendrpid=no
disallow=g729
directmedia=no
rtpkeepalive=60
keepalive=yes
{noformat}

With debug enabled for the peer "O2Line", the qualify communication looks like this:
{noformat}
*CLI> sip qualify peer O2Line
Reliably Transmitting (NAT) to 62.52.148.214:5060:
OPTIONS sip:sip.alice-voip.de SIP/2.0
Via: SIP/2.0/UDP 192.168.1.7:5060;branch=z9hG4bK4e8837c0;rport
Max-Forwards: 70
From: "asterisk" <sip:493811216473@192.168.1.7>;tag=as33536d28
To: <sip:sip.alice-voip.de>
Contact: <sip:493811216473@192.168.1.7:5060>
Call-ID: 0e0cbec4112196de7781d9e706e727ed@192.168.1.7:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 11.13.1~dfsg-2+b1
Date: Mon, 05 Sep 2016 12:03:49 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:62.52.148.214:5060 --->
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 192.168.1.7:5060;received=77.186.233.123;branch=z9hG4bK4e8837c0;rport=5060
From: "asterisk" <sip:493811216473@192.168.1.7:5060>;tag=as33536d28
To: <sip:sip.alice-voip.de>;tag=aprqngfrt-ctpjjf30000c6
Call-ID: 0e0cbec4112196de7781d9e706e727ed@192.168.1.7:5060
CSeq: 102 OPTIONS

<------------->
--- (6 headers 0 lines) ---
Really destroying SIP dialog '0e0cbec4112196de7781d9e706e727ed@192.168.1.7:5060' Method: OPTIONS
{noformat}
Comments:By: Asterisk Team (asteriskteam) 2016-09-05 07:05:58.893-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Rusty Newton (rnewton) 2016-10-12 20:31:01.084-0500

I think this has always been this way, I'm not sure it is a bug. Will have to get a developer to check the code. I don't think the qualify OPTIONS respect the fromdomain setting.

By: Rusty Newton (rnewton) 2016-10-26 08:06:11.394-0500

So, this isn't a bug. Turns out it has been this way for a very long time and the design simply doesn't take fromdomain into account for OPTIONS.

You are welcome to submit a patch to Gerrit and then we can ask the community via the lists to see what others think - as a change to this behavior may affect production systems. Qualify is used by a lot of folks.

I'm closing this out for now. If you do decide to submit a patch it'll need to be for Asterisk 14 or greater as it would be a new feature of course.