Summary:ASTERISK-02090: [patch] [post 1.0] Improved SIP friends, supported postgres
Reporter:constfilin (constfilin)Labels:
Date Opened:2004-07-22 22:52:30Date Closed:2004-10-07 23:00:01
Versions:Frequency of
Environment:Attachments:( 0) asterisk_chan_sip.patch
( 1) asterisk_chan_sip.patch
( 2) asterisk_chan_sip.patch
( 3) asterisk_chan_sip.patch
( 4) asterisk_chan_sip.patch
( 5) asterisk_channels_Makefile.patch
( 6) chan_sip.c
( 7) chan_sip.c
Description:greetings -

I improved chan_sip.c so that SIP channel works better with SIP friends taken from the database (either mysql or postgres)

I also added to configurability of chan_sip so that the queries that chan_sip uses to get SQL sip friends can be specified from sip.conf instead of being hardcoded. The changes are backwards compartible - if the custom queries are not specified then chan_sip uses the hardcoded defaults.

My disclaimer is on file with Digium.

Would be great to see this in CVS!


Comments:By: Olle Johansson (oej) 2004-07-23 02:51:09

Moving this to experimental features as of now. There is a lot of work to change the database architecture of Asterisk going on and the general direction is trying to remove database-specific support from the channel sources and have general API's.

If you have any questions, please join the #asterisk-dev channel on IRC.

By: Olle Johansson (oej) 2004-07-23 02:58:43

Please check bug ASTERISK-2023 - duplicate?

By: Olle Johansson (oej) 2004-07-23 03:06:57

There's a lot of good code in here to clean up the configuration issues.
I don't like all those EXTRA_LOG printf's, though.

By: Brian West (bkw918) 2004-07-23 16:33:34

Also on a side note SIP friends is uuuuuuuuuuuuuuuuuuuugly.  MWI doesn't work with it..

By: constfilin (constfilin) 2004-07-24 19:59:09

About patch ASTERISK-2022051 - yes it is similar, but my patch makes configuration more generic by allowing to specify the entire SQL query string instead of mapping the individual column names.

Also my patch supports postgres.

edited on: 07-24-04 19:45

By: constfilin (constfilin) 2004-07-24 20:18:59

I added a new patch that has no EXTRA_LOG printfs!

By: constfilin (constfilin) 2004-08-03 19:57:33

Uploaded patch to the latest chan_sip.c, ignored whitespace.

By: twisted (twisted) 2004-08-24 13:23:10

What's the status on this?   /* Housekeeping reminder */

By: constfilin (constfilin) 2004-08-27 21:33:12

Status update: the last time I synced with CVS was 8/3/04. Since then I
haven't made any changes or sycning. Would be great to see this in CVS.

By: Mark Spencer (markster) 2004-08-28 10:54:34

Patch looks good, but should probably be post 1.0

By: Mark Spencer (markster) 2004-08-30 16:15:36

The more I look at your patch, the more I think you're *really* onto something about how we can really back-end Asterisk with a database while keeping transparency with the config file format -- very clever.

After we release 1.0, I'd like to investigate having the databases for all entities (IAX, SIP, maybe even MGCP) database backended be mapped such that the columns of the database are the fields, and if a field has to have more than one entry they can be separated by the '|' character.  In that way we could have a struct ast_variable *db_retrieve_entity_by_name(char *config, char *s) and then it would pull immediately from the database using the same routine that applies it from the category_browse stuff.

By: constfilin (constfilin) 2004-08-30 17:46:39

I synced chan_sip.c supporting this patch with CVS version of chan_sip.c
The result of cvs diff -u asterisk/channels/chan_sip.c is uploaded.

By: constfilin (constfilin) 2004-09-09 20:24:17

I synced my changes in chan_sip.c with the latest chan_sip.c in CVS and replaced PostgreSQL specific code with generic database code based on
astodbc library mentioned in http://bugs.digium.com/bug_view_page.php?bug_id=0002398.

With this change chan_sip.c can talk over ODBC to a database and get sip friends from there.



By: constfilin (constfilin) 2004-09-10 05:21:05

Fixed a few bugs in accessing astodbc.

By: Mark Spencer (markster) 2004-10-07 15:00:10

We've updated chan_sip to use the new "realtime" configuration, so this patch should not be necessary.  Pleas e-mail me your full name though offline so that I can add you to the README as one of the people that participated in creating the new architecture.  Thanks!