diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-23 21:22:08 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-06-23 21:22:08 +0000 |
commit | 0633d87c07697665773bf43c0d77322d8581b1cd (patch) | |
tree | 97cdc7b1f17d5217e5d0ab18ad172f9f990b9566 /channels/chan_iax2.c | |
parent | d7d5539aa67c582c38cd0bf7452037d6ceea3ee0 (diff) |
emit a warning if the old IAX2 call searching code finds a call when the new code did not... so that we can get rid of the old code in 2-3 months
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@124743 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 274d47deb..c90ca1341 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -1556,7 +1556,17 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s } } - /* Look for an existing connection first */ + /* If we get here, we SHOULD NOT find a call structure for this + callno; if we do, it means that there is a call structure that + has a peer callno but did NOT get entered into the hash table, + which is bad. + + If we find a call structure using this old, slow method, output a log + message so we'll know about it. After a few months of leaving this in + place, if we don't hear about people seeing these messages, we can + remove this code for good. + */ + for (x = 1; !res && x < maxnontrunkcall; x++) { ast_mutex_lock(&iaxsl[x]); if (iaxs[x]) { @@ -1568,6 +1578,7 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s if (!res || !return_locked) ast_mutex_unlock(&iaxsl[x]); } + for (x = TRUNK_CALL_START; !res && x < maxtrunkcall; x++) { ast_mutex_lock(&iaxsl[x]); if (iaxs[x]) { @@ -1579,6 +1590,10 @@ static int __find_callno(unsigned short callno, unsigned short dcallno, struct s if (!res || !return_locked) ast_mutex_unlock(&iaxsl[x]); } + + if (res) { + ast_log(LOG_WARNING, "Old call search code found call number %d that was not in hash table!\n", res); + } } if (!res && (new >= NEW_ALLOW)) { int start, found = 0; |