[Home]

Summary:ASTERISK-03584: Realtime updates
Reporter:constfilin (constfilin)Labels:
Date Opened:2005-02-25 00:23:05.000-0600Date Closed:2011-06-07 14:05:18
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/DatabaseSupport
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Greetings

I have a situation where in /etc/asterisk/extconfig.conf
there is

<EXTCONFIG>
[settings]
...
sippeers=odbc,database,asterisk_sip_friends
...
</EXTCONFIG>

asterisk_sip_friends is a view on several joined tables.
Everything is fine until in function realtime_update_peer
I have to update the peer. Views can't be updated (duh!)

I see 2 ways to fix it:

1. Add modifications to chan_sip.c so that realtime_update_peer uses another realtime table
(e.g. "sippeers_for_update") and have in /etc/asterisk/extconfig.conf something like

<EXTCONFIG>
[settings]
...
sippeers_for_update=odbc,database,my_table_name
...
</EXTCONFIG>

OR

2. Have a more generic solution
  where /usr/src/asterisk/config.c    
  function "ast_update_realtime" first calls find_engine
  with the first argument family+"_for_update" and if the
  engine is not found then defaults to the current code.

I'd appreciate your comments on which route is the best to fix the problem. I'd like to migrate to asterisk realtime engine completely from my properietary solution and this is
the last obstacle I have to overcome.
Comments:By: Kevin P. Fleming (kpfleming) 2005-02-25 06:41:22.000-0600

This is an interesting problem. There are databases with updatable views, but they are not common. There are also databases with "instead of" triggers on views that can send the updates elsewhere, but again they are not common.

I think your second solution is more palatable; keep it in the realtime code itself, not in the users of that code.

By: Brian West (bkw918) 2005-02-25 10:32:45.000-0600

Yet another reaons we use MSSQL.  You can update views.

/b

By: constfilin (constfilin) 2005-02-25 13:04:06.000-0600

MSSQL can only update *some* very limited set of views
I am running a postgres database and postgres supports
rules for updating views (http://www.postgresql.org/docs/7.4/interactive/rules-update.html). Still, to have a generic solution would
be nice.

Any ideas?

By: constfilin (constfilin) 2005-02-25 13:31:44.000-0600

Bugmarshals, please close this issue - I figured out how to apply postgres system of rules to do the UPDATEs on views.

Or, you can keep this bug open if you think this is important.

By: Olle Johansson (oej) 2005-03-10 23:55:37.000-0600

Closing bug on reporter's request.