Summary:ASTERISK-07246: [patch][post 1.4] Move SIP registration information out of sippeers table into it's own
Reporter:Aaron Daniel (adaniel)Labels:
Date Opened:2006-06-28 22:47:56Date Closed:2007-02-15 06:13:43.000-0600
Versions:Frequency of
Environment:Attachments:( 0) asterisk-
( 1) sipregs-37046.patch
( 2) sipregs-47050.patch
( 3) sipregs-54521.patch
Description:I'm in the process of restructuring my database, and realized that it would be a lot simpler if asterisk didn't update the same table that the configurations were in.  This patch moves everything that asterisk actually updates regarding sip peers in the database into it's own table (I used the name sipregs for the table).  The fields that have been moved are fullcontact, ipaddr, port, regseconds, and username.  There is also a name field (for ID) so that's one thing you have to put in the table yourself (or set up triggers or however else you want to do it).  With this configuration, you can set up multiple tables that control phone configurations and create a view with the info you need to use as sippeers, without having to worry about so much duplicated information in a database.
Comments:By: Serge Vecher (serge-v) 2006-06-29 08:25:51

Cool. Marking this post 1.4.

By: Olle Johansson (oej) 2006-07-03 09:54:20

We need this to be optional for backwards compatibility. Also, I changed these routines a bit a few days ago, so we need an update too. We only need patches for svn trunk, not 1.2. THanks.

By: Aaron Daniel (adaniel) 2006-07-03 14:54:36

Ok, I've gone through and added a few modifications.  After some testing, I found a few bugs, this most recent version should work (I've got it in production on a box, this is the port to trunk).  Also, I added in backwards compatibility.  It now uses sipregs if it finds it in realtime, otherwise it uses sippeers.

oej: I had posted the version since some people requested I do that so they could use it as well, not sure if that's allowed or not :)  It was just meant for ease of use and testing purposes.

By: Serge Vecher (serge-v) 2006-07-05 10:13:10

amdtech, a couple of things:
1. For sipregs-36891.patch, there is no need for curly brackets in single line if ... else [if] ... statements as per CODING-GUIDELINES.
2. Generally, we will allow feature patches to be provided for release branch in the bugtracker under the following conditions:
a) there is no expectation of the 1.2 patch to be merged into the release branch;
b) there is a trunk patch provided and is updated often if trunk changes break it;
c) there is no support offered for 1.2 patch via the bugtracker. Feel free to use off-bugtracker resources, though, like email or www.asterisk-backports.org.


By: Aaron Daniel (adaniel) 2006-07-05 13:33:59

Here's another patch, this one removes the extraneous curly braces (force of habit).  This one compiles against the latest trunk, as the patch number states.  I'll see about posting the 1.2.x patch on backports or somewhere off-tracker.

By: jmls (jmls) 2006-10-31 13:31:32.000-0600

sorry to ask, but can we have an updated patch for trunk, please ? Thanks

By: Aaron Daniel (adaniel) 2006-11-02 23:16:25.000-0600

Here's an updated patch as of trunk v47050.  As a side note, we've had this running since it's inception back in July and haven't had any major problems with it.  It is backwards compatible, as build_peer will parse through the sippeers table or the sipregs table regardless of how it's built.

By: Olle Johansson (oej) 2006-11-06 09:26:06.000-0600

I would suggest adding a line for this in "sip show settings" under realtime. Other than that - are we ready for commit? I like this change.

By: Aaron Daniel (adaniel) 2006-11-06 10:09:07.000-0600

The patch already has that under the Realtime SIP Settings section, I called it Realtime Regs.  :)

By: Olle Johansson (oej) 2007-02-14 15:07:35.000-0600

is this up to date with svn trunk? If so, I'm ready for commit.

By: Aaron Daniel (adaniel) 2007-02-14 17:09:29.000-0600

The most recent version of the patch is up to date for svn trunk (sipregs-54521.patch).  This has been active since it was created, and there haven't been any problems as of yet.

By: Olle Johansson (oej) 2007-02-15 06:12:59.000-0600

Committed to svn trunk, rev 54574 with small, minor, changes.

Thanks for your patience and for your contribution to Asterisk!