Summary:ASTERISK-10464: "port" configuration parameter conflicts with runtime status
Reporter:Dmitry Andrianov (dimas)Labels:
Date Opened:2007-10-06 14:53:47Date Closed:2011-06-07 14:03:00
Versions:Frequency of
Description:When IAX/SIP updates realtime database on peer registration etc, it updates (among others) "ipaddr" and "host" columns. The problem is that "port" is  also an input parameter for peer configuration.

Why this is a problem:

1. It is just not good that one of important peer configuration parameters gets overwritten with runtime data. As I understand currently it is not a problem but what if in the future, "input" port parameter will allow specifying multiple ports or name instead of value for example? As soon as channel driver registers the peer and updates realtime, original configuration value is lost.

2. Realtime behaviour is just inconsistent with what you do with the text file config. With text files, you can completely omit "port" parameter from both [general] section and from specific peer sections. This will cause default port to be used. With realtime, you HAVE TO specify port. Otherwise default 0/NULL value will be used and nothing will work.


My suggestion is to separate "port" configuration parameter and port reported for connected peer. I would save peer's runtime port value into the same column where IP address is saved. This way, ipaddr column value instead of "" becomes "".
Comments:By: Dmitry Andrianov (dimas) 2007-10-06 16:58:30

Oops. Sorry, for lots of typos. Of course, realtime updates (among others) "ipaddr" and "port" columns, not "ipaddr" and "host".

And small clarification - even if you are using default ports everywhere, with reltime you have to have "port" column because it is the one that gets updated.

Alternative solution of separating configuration port and runtime port would be adding new "ipport" column to pair "ipaddr". Unfortunately this approach breaks compatibility with already existing databases where putting addr:port into already existing ipaddr column should not break much.

By: Sergey Tamkovich (sergee) 2007-12-30 14:37:19.000-0600


For SIP, asterisk updates port only for dynamic peers (peers that send REGISTER message). Usualy they has host field set to 'dynamic'. I can't imagine , why would you need to configurre port for peers where you don't know exact ip address. Asterisk doesn't update static peers (with host != dynamic) at all.

as for port, you must configure it for static peer, for dynamic peers it will be calculated (and stored) during Registration.

If you have default value for port 0 or NULL, maybe it is a problem of your RDBMS? maybe you should change 0/NULL to proper default value (5060/4569)?

By: Tilghman Lesher (tilghman) 2008-01-28 14:42:11.000-0600

No response from reporter.