aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-25 20:01:00 +0000
committerroot <root@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-25 20:01:00 +0000
commit59c94040fae522e223e6a375abf29be566fd71a7 (patch)
tree61a7551b91cc0a9e956b5095b961b4d34e2b0c62 /channels
parent2b261c5f3a68cc4cc02c185255101f43729c67e6 (diff)
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@8686 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d09d0ee5a..56914677b 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1617,16 +1617,15 @@ static void realtime_update_peer(const char *peername, struct sockaddr_in *sin,
{
char port[10];
char ipaddr[20];
- char regseconds[20] = "0";
+ char regseconds[20];
+ time_t nowtime;
+
+ time(&nowtime);
+ nowtime += expirey;
+ snprintf(regseconds, sizeof(regseconds), "%d", (int)nowtime); /* Expiration time */
+ ast_inet_ntoa(ipaddr, sizeof(ipaddr), sin->sin_addr);
+ snprintf(port, sizeof(port), "%d", ntohs(sin->sin_port));
- if (expirey) { /* Registration */
- time_t nowtime;
- time(&nowtime);
- nowtime += expirey;
- snprintf(regseconds, sizeof(regseconds), "%d", (int)nowtime); /* Expiration time */
- ast_inet_ntoa(ipaddr, sizeof(ipaddr), sin->sin_addr);
- snprintf(port, sizeof(port), "%d", ntohs(sin->sin_port));
- }
if (fullcontact)
ast_update_realtime("sippeers", "name", peername, "ipaddr", ipaddr, "port", port, "regseconds", regseconds, "username", username, "fullcontact", fullcontact, NULL);
else