[asterisk-commits] pabelanger: branch pabelanger/issue18183 r292782 - /team/pabelanger/issue1818...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Oct 22 15:17:06 CDT 2010
Author: pabelanger
Date: Fri Oct 22 15:17:02 2010
New Revision: 292782
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=292782
Log:
Remove debug code, formatting. Fix issue with dynamic setting in realtime_peer.
Modified:
team/pabelanger/issue18183/channels/chan_iax2.c
Modified: team/pabelanger/issue18183/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/issue18183/channels/chan_iax2.c?view=diff&rev=292782&r1=292781&r2=292782
==============================================================================
--- team/pabelanger/issue18183/channels/chan_iax2.c (original)
+++ team/pabelanger/issue18183/channels/chan_iax2.c Fri Oct 22 15:17:02 2010
@@ -4304,9 +4304,8 @@
{
struct ast_variable *var = NULL;
struct ast_variable *tmp;
- struct iax2_peer *peer=NULL;
+ struct iax2_peer *peer = NULL;
time_t regseconds = 0, nowtime;
- int dynamic=0;
if (peername) {
var = ast_load_realtime("iaxpeers", "name", peername, "host", "dynamic", SENTINEL);
@@ -4379,7 +4378,7 @@
ast_set_flag64(peer, IAX_TEMPONLY);
}
- if (!ast_test_flag64(&globalflags, IAX_RTIGNOREREGEXPIRE) && dynamic) {
+ if (!ast_test_flag64(&globalflags, IAX_RTIGNOREREGEXPIRE) && ast_test_flag64(peer, IAX_DYNAMIC)) {
time(&nowtime);
if ((nowtime - regseconds) > IAX_DEFAULT_REG_EXPIRE) {
memset(&peer->addr, 0, sizeof(peer->addr));
@@ -4520,7 +4519,6 @@
sin->sin_family = AF_INET;
if (!(peer = find_peer(peername, 1))) {
-ast_log(LOG_WARNING, "No peer, lets check");
struct ast_sockaddr sin_tmp;
cai->found = 0;
@@ -4534,8 +4532,9 @@
/* use global iax prefs for unknown peer/user */
/* But move the calling channel's native codec to the top of the preference list */
memcpy(&ourprefs, &prefs, sizeof(ourprefs));
- if (c)
+ if (c) {
ast_codec_pref_prepend(&ourprefs, c->nativeformats, 1);
+ }
ast_codec_pref_convert(&ourprefs, cai->prefs, sizeof(cai->prefs), 1);
return 0;
}
@@ -4583,8 +4582,9 @@
family = ast_strdupa(peer->dbsecret);
key = strchr(family, '/');
- if (key)
+ if (key) {
*key++ = '\0';
+ }
if (!key || ast_db_get(family, key, cai->secret, sizeof(cai->secret))) {
ast_log(LOG_WARNING, "Unable to retrieve database password for family/key '%s'!\n", peer->dbsecret);
goto return_unref;
More information about the asterisk-commits
mailing list