|
|
|
@ -2056,7 +2056,7 @@ static void set_insecure_flags(struct ast_flags *flags, const char *value, int l
|
|
|
|
|
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 deprecated_username);
|
|
|
|
|
static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *username, const char *fullcontact, const char *useragent, int expirey, int deprecated_username);
|
|
|
|
|
static struct sip_user *realtime_user(const char *username);
|
|
|
|
|
static void update_peer(struct sip_peer *p, int expiry);
|
|
|
|
|
static struct ast_variable *get_insecure_variable_from_config(struct ast_config *config);
|
|
|
|
@ -3630,7 +3630,7 @@ static int sip_sendtext(struct ast_channel *ast, const char *text)
|
|
|
|
|
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 *defaultuser, const char *fullcontact, int expirey, int deprecated_username)
|
|
|
|
|
static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *defaultuser, const char *fullcontact, const char *useragent, int expirey, int deprecated_username)
|
|
|
|
|
{
|
|
|
|
|
char port[10];
|
|
|
|
|
char ipaddr[INET_ADDRSTRLEN];
|
|
|
|
@ -3656,14 +3656,19 @@ static void realtime_update_peer(const char *peername, struct sockaddr_in *sin,
|
|
|
|
|
else if (sip_cfg.rtsave_sysname)
|
|
|
|
|
syslabel = "regserver";
|
|
|
|
|
|
|
|
|
|
if (fc)
|
|
|
|
|
if (fc) {
|
|
|
|
|
ast_update_realtime(tablename, "name", peername, "ipaddr", ipaddr,
|
|
|
|
|
"port", port, "regseconds", regseconds,
|
|
|
|
|
deprecated_username ? "username" : "defaultuser", defaultuser, fc, fullcontact, syslabel, sysname, NULL); /* note fc and syslabel _can_ be NULL */
|
|
|
|
|
else
|
|
|
|
|
deprecated_username ? "username" : "defaultuser", defaultuser,
|
|
|
|
|
"useragent", useragent,
|
|
|
|
|
fc, fullcontact, syslabel, sysname, NULL); /* note fc and syslabel _can_ be NULL */
|
|
|
|
|
} else {
|
|
|
|
|
ast_update_realtime(tablename, "name", peername, "ipaddr", ipaddr,
|
|
|
|
|
"port", port, "regseconds", regseconds,
|
|
|
|
|
deprecated_username ? "username" : "defaultuser", defaultuser, syslabel, sysname, NULL); /* note syslabel _can_ be NULL */
|
|
|
|
|
"useragent", useragent,
|
|
|
|
|
deprecated_username ? "username" : "defaultuser", defaultuser,
|
|
|
|
|
syslabel, sysname, NULL); /* note syslabel _can_ be NULL */
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*! \brief Automatically add peer extension to dial plan */
|
|
|
|
@ -3783,7 +3788,7 @@ static void update_peer(struct sip_peer *p, int expiry)
|
|
|
|
|
int rtcachefriends = ast_test_flag(&p->flags[1], SIP_PAGE2_RTCACHEFRIENDS);
|
|
|
|
|
if (sip_cfg.peer_rtupdate &&
|
|
|
|
|
(p->is_realtime || rtcachefriends)) {
|
|
|
|
|
realtime_update_peer(p->name, &p->addr, p->username, rtcachefriends ? p->fullcontact : NULL, expiry, p->deprecated_username);
|
|
|
|
|
realtime_update_peer(p->name, &p->addr, p->username, rtcachefriends ? p->fullcontact : NULL, p->useragent, expiry, p->deprecated_username);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -10093,7 +10098,7 @@ static void destroy_association(struct sip_peer *peer)
|
|
|
|
|
|
|
|
|
|
if (!sip_cfg.ignore_regexpire) {
|
|
|
|
|
if (peer->rt_fromcontact)
|
|
|
|
|
ast_update_realtime(tablename, "name", peer->name, "fullcontact", "", "ipaddr", "", "port", "", "regseconds", "0", peer->deprecated_username ? "username" : "defaultuser", "", "regserver", "", NULL);
|
|
|
|
|
ast_update_realtime(tablename, "name", peer->name, "fullcontact", "", "ipaddr", "", "port", "", "regseconds", "0", peer->deprecated_username ? "username" : "defaultuser", "", "regserver", "", "useragent", "", NULL);
|
|
|
|
|
else
|
|
|
|
|
ast_db_del("SIP/Registry", peer->name);
|
|
|
|
|
}
|
|
|
|
@ -22863,6 +22868,7 @@ static int load_module(void)
|
|
|
|
|
"defaultuser", RQ_CHAR, 10,
|
|
|
|
|
"fullcontact", RQ_CHAR, 20,
|
|
|
|
|
"regserver", RQ_CHAR, 20,
|
|
|
|
|
"useragent", RQ_CHAR, 20,
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
return AST_MODULE_LOAD_SUCCESS;
|
|
|
|
|