In this version, we can combine the queries, because we support dropping
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 17 Feb 2009 14:39:36 +0000 (14:39 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 17 Feb 2009 14:39:36 +0000 (14:39 +0000)
nonexistent columns.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176501 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index f9f0c94..da32f62 100644 (file)
@@ -4158,18 +4158,15 @@ static void realtime_update_peer(const char *peername, struct sockaddr_in *sin,
                ast_update_realtime(tablename, "name", peername, "ipaddr", ipaddr,
                        "port", port, "regseconds", regseconds,
                        deprecated_username ? "username" : "defaultuser", defaultuser,
-                       "useragent", useragent,
+                       "useragent", useragent, "lastms", str_lastms,
                        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,
+                       "useragent", useragent, "lastms", str_lastms,
                        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);
 }
 
 /*! \brief Automatically add peer extension to dial plan */