[Home]

Summary:ASTERISK-23971: In pjsip.conf, match property of identify section does not allow subnet masks
Reporter:Akinori Takigawa (atakigawa)Labels:
Date Opened:2014-07-01 02:24:34Date Closed:2014-11-15 15:33:03.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip_endpoint_identifier_ip
Versions:12.2.0 12.3.2 Frequency of
Occurrence
Constant
Related
Issues:
is related toASTERISK-24290 Endpoint identifier match value fails to parse when CIDR network format is specified
Environment:CentOS release 6.5 64bitAttachments:
Description:When specifying any ip address with a subnet mask prepended on "match" property of identify section in pjsip.conf, asterisk logs on start up that it is not a valid ip address, thus failing to create identify object.

The document
(https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Configuration_res_pjsip_endpoint_identifier_ip)
says "match" can have a subnet mask,

but by briefly scanning the source code,
(http://svn.asterisk.org/svn/asterisk/branches/12/res/res_pjsip_endpoint_identifier_ip.c)
ip_identify_match_handler() first checks the string provided by "match" by ast_sockaddr_resolve(), which does not accept ip addresses with subnet masks.

If the document is right, res_pjsip_endpoint_identifier_ip.c should be fixed to accept ip address(es) with subnet mask prepended.

Thanks in advance.

pjsip.conf sample -------------------------------
[mytrunk]
type=identify
endpoint=mytrunk
match=61.114.160.0/20

/var/log/asterisk/messages log on startup -------------------------------
[2014-07-01 14:58:41] ERROR[11999] netsock2.c: getaddrinfo("61.114.160.0/20", "(null)", ...): Name or service not known
[2014-07-01 14:58:41] ERROR[11999] res_pjsip_endpoint_identifier_ip.c: Address '61.114.160.0/20' provided on ip endpoint identifier 'mytrunk' did not resolve to any address
[2014-07-01 14:58:41] ERROR[11999] config_options.c: Error parsing match=61.114.160.0/20 at line 340 of
[2014-07-01 14:58:41] ERROR[11999] res_sorcery_config.c: Could not create an object of type 'identify' with id 'mytrunk' from configuration file 'pjsip.conf
Comments:By: Cameron (cbanta78) 2014-09-11 14:15:58.173-0500

I have the same issue on 13.0.0-beta1

By: Matt Jordan (mjordan) 2014-10-31 14:13:17.317-0500

This may already be fixed in ASTERISK-24290. Can you re-test with 12.6.0/13.0.0?

By: Akinori Takigawa (atakigawa) 2014-10-31 20:09:57.428-0500

I've tested on 12.6.0 and it's working as expected so far. Thanks so much!!