[asterisk-dev] [svn-commits] tilghman: branch 1.6.1 r176461 - in /branches/1.6.1: ./ channels/chan_sip.c

Johansson Olle E oej at edvina.net
Tue Feb 17 08:29:07 CST 2009


17 feb 2009 kl. 15.24 skrev Tilghman Lesher:

> On Tuesday 17 February 2009 02:00:18 Johansson Olle E wrote:
>> 17 feb 2009 kl. 03.07 skrev SVN commits to the Digium repositories:
>>> +	/* We cannot do this in the same statement as above, because the
>>> lack of
>>> +	 * this field could cause the whole statement to fail. */
>>> +	ast_update_realtime("sippeers", "name", peername, "lastms",
>>> str_lastms, NULL);
>>> }
>>
>> You should really use "tablename" instead of sippeers here to enable
>> the sipregs functionality where we only write in one configuration  
>> and
>> read from sippeers.
>
> It's simply updating exactly the same table as a few lines before,  
> only not
> encoding it into the same query, because in the version this change  
> originated
> from, adding a non-existent column to the API call might cause the  
> whole thing
> to fail.

You are not using the same table as above, where we either use  
sippeers or sipregs...

Please take a moment to check before you answer!

/O

  if (fc) {
                 ast_update_realtime(tablename, "name", peername,  
"ipaddr", ipaddr,
                         "port", port, "regseconds", regseconds,
                         deprecated_username ? "username" :  
"defaultuser", defaultuser,
                         "useragent", useragent,
                         fc, fullcontact, syslabel, sysname,  
SENTINEL); /* note fc and syslabel _can_ be NULL */
         } else {
                 ast_update_realtime(tablename, "name", peername,  
"ipaddr", ipaddr,
                         "port", port, "regseconds", regseconds,
                         "useragent", useragent,
                         deprecated_username ? "username" :  
"defaultuser", defaultuser,
                         syslabel, sysname, SENTINEL); /* note  
syslabel _can_ be NULL */
         }
         /* We cannot do this in the same statement as above, because  
the lack of
          * this field could cause the whole statement to fail. */
         ast_update_realtime("sippeers", "name", peername, "lastms",  
str_lastms, NULL);
}




More information about the asterisk-dev mailing list