[Home]

Summary:ASTERISK-17426: default subscribecontext ignored when allowguest=yes
Reporter:Manuel Meitinger (meitinger)Labels:
Date Opened:2011-02-17 13:30:10.000-0600Date Closed:
Priority:MinorRegression?No
Status:Open/NewComponents:Channels/chan_sip/Subscriptions
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Let's say sip.conf is configured like this:

[general]
allowguest=yes
context=from-guest-sip
allowsubscribe=yes
subscribecontext=all-hints

If an unauthenticated client then tries to subscribe for notifications, Asterisk will look for the hint extension under from-guest-sip instead of all-hints. In my opinion, this is an error. Asterisk should either deny unauthenticated clients to subscribe at all or lookup the hints in the same context as it would do if the client had authenticated first. If others agree, please change

if (req->method == SIP_SUBSCRIBE && !ast_strlen_zero(p->subscribecontext))
 ast_string_field_set(p, context, p->subscribecontext);


to something like

if (req->method == SIP_SUBSCRIBE) {
 if (!ast_strlen_zero(p->subscribecontext))
   ast_string_field_set(p, context, p->subscribecontext);
 else if (!ast_strlen_zero(default_subscribecontext))
   ast_string_field_set(p, context, default_subscribecontext);
}

in function "get_destination" in chan_sip.c
Thanks.
Comments: