Summary: | ASTERISK-16266: [patch] Adding useragent in realtime database | ||
Reporter: | Ricardo Landim (ricardolandim) | Labels: | |
Date Opened: | 2010-06-18 08:57:04 | Date Closed: | 2010-06-18 10:36:01 |
Priority: | Minor | Regression? | No |
Status: | Closed/Complete | Components: | Channels/chan_sip/NewFeature |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) chan_sip-useragent.diff | |
Description: | Adding useragent in realtime database This function already exists in version 1.6 Also proposing to add on 1.4 ****** ADDITIONAL INFORMATION ****** --- chan_sip.c 2010-05-05 13:42:22.000000000 -0300 +++ chan_sip.c 2010-06-18 10:43:05.723917368 -0300 @@ -1497,7 +1497,7 @@ static int handle_common_options(struct ast_flags *flags, struct ast_flags *mask, struct ast_variable *v); /* Realtime device support */ -static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *username, const char *fullcontact, int expirey, int lastms); +static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *username, const char *fullcontact, const char *useragent, int expirey, int lastms); static struct sip_user *realtime_user(const char *username); static void update_peer(struct sip_peer *p, int expiry); static struct sip_peer *realtime_peer(const char *peername, struct sockaddr_in *sin, int devstate_only); @@ -2517,7 +2517,7 @@ that name and store that in the "regserver" field in the sippeers table to facilitate multi-server setups. */ -static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *username, const char *fullcontact, int expirey, int lastms) +static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *username, const char *fullcontact, const char *useragent, int expirey, int lastms) { char port[10]; char ipaddr[INET_ADDRSTRLEN]; @@ -2542,11 +2542,11 @@ if (fc) ast_update_realtime("sippeers", "name", peername, "ipaddr", ipaddr, - "port", port, "regseconds", regseconds, + "port", port, "regseconds", regseconds, "useragent", useragent, "username", username, fc, fullcontact, syslabel, sysname, NULL); /* note fc and syslabel _can_ be NULL */ else ast_update_realtime("sippeers", "name", peername, "ipaddr", ipaddr, - "port", port, "regseconds", regseconds, + "port", port, "regseconds", regseconds, "useragent", useragent, "username", username, syslabel, sysname, NULL); /* note syslabel _can_ be NULL */ if (seen_lastms) { /* We cannot do this in the same statement as above, because the lack of @@ -2628,7 +2628,7 @@ int rtcachefriends = ast_test_flag(&p->flags[1], SIP_PAGE2_RTCACHEFRIENDS); if (ast_test_flag(&global_flags[1], SIP_PAGE2_RTUPDATE) && (ast_test_flag(&p->flags[0], SIP_REALTIME) || rtcachefriends)) { - realtime_update_peer(p->name, &p->addr, p->username, rtcachefriends ? p->fullcontact : NULL, expiry, p->lastms); + realtime_update_peer(p->name, &p->addr, p->username, rtcachefriends ? p->fullcontact : NULL, p->useragent, expiry, p->lastms); } } | ||
Comments: | By: Russell Bryant (russell) 2010-06-18 10:36:01 Unfortunately, since Asterisk 1.4 is feature frozen, we can not commit this patch. However, thanks for posting the patch for others to use if they desire this functionality. |