[asterisk-bugs] [Asterisk 0016683]: [patch] warning about "Invalid peer port configuration" for realtime

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Feb 18 15:42:55 CST 2010


The following issue has been ASSIGNED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16683 
====================================================================== 
Reported By:                wdoekes
Assigned To:                tilghman
====================================================================== 
Project:                    Asterisk
Issue ID:                   16683
Category:                   Channels/chan_sip/DatabaseSupport
Reproducibility:            always
Severity:                   trivial
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
JIRA:                       SWP-786 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 242602 
Request Review:              
====================================================================== 
Date Submitted:             2010-01-24 03:10 CST
Last Modified:              2010-02-18 15:42 CST
====================================================================== 
Summary:                    [patch] warning about "Invalid peer port
configuration" for realtime
Description: 
When my (x-lite) phone unregisters, asterisk sets the realtime sipregs info
to:

mysql> select ipaddr, port from asterisk_sipreg where name = '126680005';
+---------+------+
| ipaddr  | port |
+---------+------+
| 0.0.0.0 |    0 | 
+---------+------+
1 row in set (0.00 sec)


This is all perfectly fine. But then when I retrieve the info for the
account, I get a warning about the port being bad:

CLI> sip show peer 126680005 load
..
[2010-01-24 09:58:04] WARNING[31055]: chan_sip.c:22868 build_peer: Invalid
peer port configuration at line 0 : 0


This new warning was introduced in r221697.

-if (!realtime && peer->host_dynamic) {
-  peer->defaddr.sin_port = htons(atoi(v->value));
-} else {
-  peer->addr.sin_port = htons(atoi(v->value));
+if (!(port = port_str2int(v->value, 0))) {
+  ast_log(LOG_WARNING, "Invalid peer port configuration at line %d :
%s\n", v->lineno, v->value);


I suppose it shouldn't fire the warning when you're using realtime-dynamic
accounts.

See the attached diff.


Regards,
Walter Doekes
OSSO B.V.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-02-18 15:42 svnbot         Status                   ready for testing =>
assigned
2010-02-18 15:42 svnbot         Assigned To               => tilghman        
======================================================================




More information about the asterisk-bugs mailing list