[Freeswitch-users] Issue with database updates

Rick Jarvis rick at magicmail.mooo.com
Mon Oct 9 18:38:38 UTC 2017


Sure, but surely the point of SQL is to update only the affected fields? If it’s going to read the values out one by one, and then set them one by one on a following transaction, it just creates the opportunity for stale data, which is what I’m getting :(


> On 9 Oct 2017, at 19:34, Michael Jerris <mike at jerris.com> wrote:
> 
> it updates them with the values in channel vars.
> 
>> On Oct 8, 2017, at 2:13 PM, Rick Jarvis <rick at magicmail.mooo.com <mailto:rick at magicmail.mooo.com>> wrote:
>> 
>> I had resorted to updating the table directly through SQL as FS doesn't appear to dynamically update the table if I use uuid_setvar :/
>> 
>>> On 8 Oct 2017, at 19:05, Vallimamod Abdullah <vma at vallimamod.org <mailto:vma at vallimamod.org>> wrote:
>>> 
>>> Hi,
>>> 
>>> I am not sure how you are updating these columns but if you are doing it directly through sql, I don't think it's the correct way.
>>> To set or update a value on a "presence data" column, you have to define or update a channel variable with the same name as the column. If there is no variable defined, the corresponding column will be set to NULL on the state change.
>>> 
>>> Hope this helps.
>>> 
>>> Best Regards,
>>> -- 
>>> Vallimamod Abdullah
>>> SIP Solutions
>>> vma at sipsolutions.fr <mailto:vma at sipsolutions.fr>
>>> tel: +33 6 62 60 68 97
>>> .
>>> 
>>>> On 8 Oct 2017, at 16:50, Rick Jarvis <rick at magicmail.mooo.com <mailto:rick at magicmail.mooo.com>> wrote:
>>>> 
>>>> Is there any reason why FS iterates through all the fields in the channels table, when it updates a field? I’ve created some custom columns (as per https://freeswitch.org/confluence/display/FREESWITCH/Variable+presence+data+cols <https://freeswitch.org/confluence/display/FREESWITCH/Variable+presence+data+cols>) but the values I’m writing to my new columns are being overwritten when FS changes the channel state - it appears from the logs that this is due to FS reading the values from the table, and then setting every column (including my custom fields) when it then updates … to me this is counter-intuitive as far as SQL goes!?
>>> 
> 
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
> 
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
> 
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20171009/5a75763d/attachment.html>


More information about the FreeSWITCH-users mailing list