aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-12 15:08:41 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-12 15:08:41 +0000
commit941248879dc159eb2c053e9788b80301e4be8ef0 (patch)
tree873cbccfe39d572a595c84dc3ab1d3dc3aaa20a2
parent7e66e729a9ff57a89574e0410c0bcc649d83a783 (diff)
Merge rev 115565 from 1.4
git-svn-id: http://svn.digium.com/svn/asterisk/tags/1.4.19.2@115647 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_iax2.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 3aeae2a87..2825019ad 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -3616,6 +3616,24 @@ static int iax2_indicate(struct ast_channel *c, int condition, const void *data,
ast_mutex_lock(&iaxsl[callno]);
pvt = iaxs[callno];
+ if (!pvt->peercallno) {
+ /* We don't know the remote side's call number, yet. :( */
+ int count = 10;
+ while (count-- && pvt && !pvt->peercallno) {
+ ast_mutex_unlock(&iaxsl[callno]);
+ usleep(1);
+ ast_mutex_lock(&iaxsl[callno]);
+ pvt = iaxs[callno];
+ }
+ if (pvt->peercallno) {
+ ast_log(LOG_NOTICE, "Yay, we didn't know the peercallno, but we were patient and got it.\n");
+ } else {
+ ast_log(LOG_NOTICE, "Damnit! We waited around and never got the peercallno ...\n");
+ res = -1;
+ goto done;
+ }
+ }
+
switch (condition) {
case AST_CONTROL_HOLD:
if (strcasecmp(pvt->mohinterpret, "passthrough")) {