Would like to run sip show registry from DB

In extconfig.conf
sippeers => odbc,asterisk,sip_buddies
sipusers => odbc,asterisk,sip_buddies
voicemail => odbc,asterisk,voicemail_users
sip.conf => odbc,asterisk,sip_reg

In sip.conf
[general]
udpbindaddr=0.0.0.0:5070
tcpbindaddr=0.0.0.0:5070

Table schema sip_reg
’id’, ‘int(10) unsigned’, ‘NO’, ‘PRI’, ‘’, ‘auto_increment’
‘cat_metric’, ‘varchar(45)’, ‘NO’, ‘’, ‘0’, ‘’
‘var_metric’, ‘varchar(45)’, ‘NO’, ‘’, ‘0’, ‘’
‘commented’, ‘varchar(45)’, ‘NO’, ‘’, ‘0’, ‘’
‘filename’, ‘varchar(45)’, ‘NO’, ‘’, ‘sip.conf’, ‘’
‘category’, ‘varchar(45)’, ‘NO’, ‘’, ‘general’, ‘’
‘var_name’, ‘varchar(45)’, ‘NO’, ‘’, ‘register’, ‘’
‘var_val’, ‘varchar(45)’, ‘NO’, ‘’, ‘’, ‘’
‘name’, ‘varchar(45)’, ‘NO’, ‘’, ‘’, ‘’
‘bindport’, ‘int(4) unsigned’, ‘NO’, ‘’, ‘5070’, ‘’

bindport is not a valid field in the sip_reg schema. It would be a separate row with filename as sip.conf, category as general, var_name as bindport, and var_val as 5070.

Oh I see…and is there any other easy way of changing the SIP listening port? As I read so many articles and found that for sip outbound registration we should not use separate table instead we should use same table as we are using for sippeers.

Can you please shed some light on it?

You can configure the bindport in sip.conf or using static realtime like above. For outbound registration it is the same.

So what line should i write in extconfig.conf then if i use bindport in sip.conf?

The sip.conf line configures it. It literally means “read the sip.conf file from the database”. It’s as if you have a sip.conf, but it’s just in the database.

filename is sip.conf
category is the part between the [ ]
var_name is the part to the left of the =
var_value is the part to the right of the =

Example:

[general]
register => test:test@test.com

filename is sip.conf
category is general
var_name is register
var_value is test:test@test.com

And you will have to reload chan_sip when changes are made.

1 Like

And if you are using bindport in the real sip.conf file in /etc/asterisk you CAN NOT store sip.conf in the database. You would remove the sip.conf => odbc,asterisk,sip_reg line.

1 Like

But If I remove sip.conf => odbc,asterisk,sip_reg line then my server is not getting registered with my provider and I am able to register my phone with my server using 5070 port, so it means the way I am doing is not right way and will never get success…right?

We’re going in circles. You can either put an outbound registration in sip.conf in the file, or the sip_reg table. Whichever you choose you have to ALSO put the bindport in. You CAN NOT use both sip.conf from a file and the sip_reg table. The code does not allow it. What you do is up to you.

1 Like

I understand completely…but very interesting link I found here which tells outbound regsitration will work if we specify callbackextension in sippeers table and not required sip_reg table also

It might work if you enable caching, but if you made any changes they likely would not get picked up and it is not a method I would recommend or that would likely work well. As I said before, it’s up to you. I have nothing else to add.

@jcolp Great Thanks and you are right callbackextension is not working as expected as after sip reploading peers is purged…

Sorry for taking so much of your time.

Once again Thanks so much, I will try your method and let you know…