[asterisk-addons-commits] file: trunk r487 - /trunk/asterisk-ooh323c/src/chan_h323.c

SVN commits to the Asterisk addons project asterisk-addons-commits at lists.digium.com
Tue Nov 20 08:40:58 CST 2007


Author: file
Date: Tue Nov 20 08:40:58 2007
New Revision: 487

URL: http://svn.digium.com/view/asterisk-addons?view=rev&rev=487
Log:
Use the wrappers for locking/unlocking the channel.
(closes issue #11320)
Reported by: dimas
Patches:
      ooh323c.patch uploaded by dimas (license 88)

Modified:
    trunk/asterisk-ooh323c/src/chan_h323.c

Modified: trunk/asterisk-ooh323c/src/chan_h323.c
URL: http://svn.digium.com/view/asterisk-addons/trunk/asterisk-ooh323c/src/chan_h323.c?view=diff&rev=487&r1=486&r2=487
==============================================================================
--- trunk/asterisk-ooh323c/src/chan_h323.c (original)
+++ trunk/asterisk-ooh323c/src/chan_h323.c Tue Nov 20 08:40:58 2007
@@ -252,7 +252,7 @@
 
    if(ch)
    {
-      ast_mutex_lock(&ch->lock);
+      ast_channel_lock(ch);
       ch->tech = &ooh323_tech;
 
       ch->nativeformats = i->capability;
@@ -332,7 +332,7 @@
       if (state != AST_STATE_DOWN) {
          if (ast_pbx_start(ch)) {
             ast_log(LOG_WARNING, "Unable to start PBX on %s\n", ch->name);
-            ast_mutex_unlock(&ch->lock);
+            ast_channel_unlock(ch);
             ast_hangup(ch);
             ch = NULL;
          }
@@ -341,7 +341,7 @@
       ast_log(LOG_WARNING, "Unable to allocate channel structure\n");
 
 
-   if(ch)   ast_mutex_unlock(&ch->lock);
+   if(ch)   ast_channel_unlock(ch);
 
    if(gH323Debug)
       ast_debug(1, "+++   h323_new\n");
@@ -864,10 +864,10 @@
    ast_mutex_lock(&p->lock);
    if(ast->_state != AST_STATE_UP)
    {
-      ast_mutex_lock(&ast->lock);
+      ast_channel_lock(ast);
       ast_setstate(ast, AST_STATE_UP);
       ast_debug(1, "ooh323_answer(%s)\n", ast->name);
-      ast_mutex_unlock(&ast->lock);
+      ast_channel_unlock(ast);
       ast_mutex_lock(&ooh323c_cmd_lock);
       ooAnswerCall(p->callToken);
       ast_mutex_unlock(&ooh323c_cmd_lock);
@@ -1123,9 +1123,9 @@
       }
       c = p->owner;
       ast_mutex_unlock(&p->lock);
-      ast_mutex_lock(&c->lock);
+      ast_channel_lock(c);
       ast_setstate(c, AST_STATE_RINGING);
-      ast_mutex_unlock(&c->lock);
+      ast_channel_unlock(c);
       ast_queue_control(c, AST_CONTROL_RINGING);
    }
    
@@ -1410,7 +1410,7 @@
       return -1;
    }
    
-   while(ast_mutex_trylock(&p->owner->lock))
+   while(ast_channel_trylock(p->owner))
    {
       ast_debug(1,"Failed to grab lock, trying again\n");
       ast_mutex_unlock(&p->lock);
@@ -1421,7 +1421,7 @@
    {
       ast_setstate(p->owner, AST_STATE_UP);
    }
-   ast_mutex_unlock(&p->owner->lock);
+   ast_channel_unlock(p->owner);
    if(ast_test_flag(p, H323_OUTGOING)) {
       struct ast_channel* c = p->owner;
       ast_mutex_unlock(&p->lock);
@@ -1448,7 +1448,7 @@
    ast_mutex_lock(&p->lock);
   
    while(p->owner) {
-      if(ast_mutex_trylock(&p->owner->lock)) {
+      if(ast_channel_trylock(p->owner)) {
          ooTrace(OOTRCLVLINFO, "Failed to grab lock, trying again\n");
          ast_debug(1,"Failed to grab lock, trying again\n");
          ast_mutex_unlock(&p->lock);
@@ -1468,12 +1468,12 @@
          p->owner->hangupcause = 
             ooh323_convert_hangupcause_h323ToAsterisk(call->callEndReason);
          p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
-         ast_mutex_unlock(&p->owner->lock);
+         ast_channel_unlock(p->owner);
          ast_queue_hangup(p->owner);
          ast_mutex_unlock(&p->lock);
          return OO_OK;
       }
-      ast_mutex_unlock(&p->owner->lock);
+      ast_channel_unlock(p->owner);
    }
    ast_set_flag(p, H323_NEEDDESTROY);
    ast_mutex_unlock(&p->lock);
@@ -2700,10 +2700,10 @@
 	
       /* Unlink us from the owner if we have one */
       if (cur->owner) {
-         ast_mutex_lock(&cur->owner->lock);
+         ast_channel_lock(cur->owner);
          ast_debug(1, "Detaching from %s\n", cur->owner->name);
          cur->owner->tech_pvt = NULL;
-         ast_mutex_unlock(&cur->owner->lock);
+         ast_channel_unlock(cur->owner);
          cur->owner = NULL;
       }
   




More information about the asterisk-addons-commits mailing list