|
|
|
|
@ -2887,7 +2887,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 *username, const char *fullcontact, int expirey)
|
|
|
|
|
static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *defaultuser, const char *fullcontact, int expirey)
|
|
|
|
|
{
|
|
|
|
|
char port[10];
|
|
|
|
|
char ipaddr[INET_ADDRSTRLEN];
|
|
|
|
|
@ -2916,11 +2916,11 @@ static void realtime_update_peer(const char *peername, struct sockaddr_in *sin,
|
|
|
|
|
if (fc)
|
|
|
|
|
ast_update_realtime(tablename, "name", peername, "ipaddr", ipaddr,
|
|
|
|
|
"port", port, "regseconds", regseconds,
|
|
|
|
|
"username", username, fc, fullcontact, syslabel, sysname, NULL); /* note fc and syslabel _can_ be NULL */
|
|
|
|
|
"defaultuser", defaultuser, 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,
|
|
|
|
|
"username", username, syslabel, sysname, NULL); /* note syslabel _can_ be NULL */
|
|
|
|
|
"defaultuser", defaultuser, syslabel, sysname, NULL); /* note syslabel _can_ be NULL */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*! \brief Automatically add peer extension to dial plan */
|
|
|
|
|
@ -8660,7 +8660,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", "username", "", "regserver", "", NULL);
|
|
|
|
|
ast_update_realtime(tablename, "name", peer->name, "fullcontact", "", "ipaddr", "", "port", "", "regseconds", "0", "defaultuser", "", "regserver", "", NULL);
|
|
|
|
|
else
|
|
|
|
|
ast_db_del("SIP/Registry", peer->name);
|
|
|
|
|
}
|
|
|
|
|
@ -17961,7 +17961,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
|
|
|
|
|
peer->callingpres = ast_parse_caller_presentation(v->value);
|
|
|
|
|
if (peer->callingpres == -1)
|
|
|
|
|
peer->callingpres = atoi(v->value);
|
|
|
|
|
} else if (!strcasecmp(v->name, "username")) {
|
|
|
|
|
} else if (!strcasecmp(v->name, "username") | !strcmp(v->name, "defaultuser")) { /* "username" is deprecated */
|
|
|
|
|
ast_copy_string(peer->username, v->value, sizeof(peer->username));
|
|
|
|
|
} else if (!strcasecmp(v->name, "language")) {
|
|
|
|
|
ast_copy_string(peer->language, v->value, sizeof(peer->language));
|
|
|
|
|
|