Minor mgcp debuggin changes, sip deadlock improvement
authorMark Spencer <markster@digium.com>
Tue, 9 Dec 2003 00:02:06 +0000 (00:02 +0000)
committerMark Spencer <markster@digium.com>
Tue, 9 Dec 2003 00:02:06 +0000 (00:02 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1841 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_mgcp.c
channels/chan_sip.c

index f55141e..a3efad5 100755 (executable)
@@ -1060,13 +1060,16 @@ static struct mgcp_subchannel *find_subchannel(char *name, int msgid, struct soc
                        }
                        p = g->endpoints;
                        while(p) {
-                ast_log(LOG_DEBUG, "Searching on %s@%s for subchannel\n", p->name, g->name);
+                               if (option_debug)
+                       ast_log(LOG_DEBUG, "Searching on %s@%s for subchannel\n", p->name, g->name);
                 if (msgid) {
                     sub = p->sub;
                     do {
-                        ast_log(LOG_DEBUG, "Searching on %s@%s-%d for subchannel with lastout: %d\n", p->name, g->name, sub->id, msgid);
+                                               if (option_debug)
+                           ast_log(LOG_DEBUG, "Searching on %s@%s-%d for subchannel with lastout: %d\n", p->name, g->name, sub->id, msgid);
                         if (sub->lastout == msgid) {
-                            ast_log(LOG_DEBUG, "Found subchannel sub%d to handle request %d sub->lastout: %d\n", sub->id, msgid, sub->lastout);
+                                                       if (option_debug)
+                               ast_log(LOG_DEBUG, "Found subchannel sub%d to handle request %d sub->lastout: %d\n", sub->id, msgid, sub->lastout);
                             found = 1;
                             break;
                         }
index cefe7ab..d56479b 100755 (executable)
@@ -463,7 +463,7 @@ static int retrans_pkt(void *data)
        } else {
                ast_log(LOG_WARNING, "Maximum retries exceeded on call %s for seqno %d (%s)\n", pkt->owner->callid, pkt->seqno, pkt->resp ? "Response" : "Request");
                pkt->retransid = -1;
-               while(pkt->owner->owner && ast_mutex_lock(&pkt->owner->owner->lock)) {
+               while(pkt->owner->owner && ast_mutex_trylock(&pkt->owner->owner->lock)) {
                        ast_mutex_unlock(&pkt->owner->lock);
                        usleep(1);
                        ast_mutex_lock(&pkt->owner->lock);