[Home]

Summary:ASTERISK-17844: [patch] Not correct return from ooh323_indicate(..) function for interoperating with res_fax (in particular)
Reporter:Alexander Vysokovskih (laowai)Labels:
Date Opened:2011-05-12 00:01:38Date Closed:2011-05-14 07:18:25
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Addons/chan_ooh323
Versions:1.8.4 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) ooh323_indicate.patch
Description:res_fax think what channel driver (ooh323) do not change mode to t38, because ooh323_indicate resulting always -1 (I think, this is wrong in comparison with sip_indicate..)



****** ADDITIONAL INFORMATION ******

here is patch, what make my asterisk working fine with res_fax+ooh323:

--- chan_ooh323.c.orig  2011-02-18 05:07:20.000000000 +0500
+++ chan_ooh323.c       2011-05-11 15:30:31.000000000 +0600
@@ -1188,11 +1188,11 @@

static int ooh323_indicate(struct ast_channel *ast, int condition, const void *data, size_t datalen)
{
-
       struct ooh323_pvt *p = (struct ooh323_pvt *) ast->tech_pvt;
       char *callToken = (char *)NULL;
+       int res=-1;

-       if (!p) return -1;
+       if (!p) return res;

       ast_mutex_lock(&p->lock);
       callToken = (p->callToken ? strdup(p->callToken) : NULL);
@@ -1201,34 +1201,43 @@
       if (!callToken) {
               if (gH323Debug)
                       ast_verbose("   ooh323_indicate - No callToken\n");
-               return -1;
+               return res;
       }

       if (gH323Debug)
               ast_verbose("----- ooh323_indicate %d on call %s\n", condition, callToken);
       
       ast_mutex_lock(&p->lock);
+
       switch (condition) {
-       case AST_CONTROL_CONGESTION:
+           case AST_CONTROL_CONGESTION:
               if (!ast_test_flag(p, H323_ALREADYGONE)) {
                       ooHangCall(callToken, OO_REASON_LOCAL_CONGESTED,
                                               AST_CAUSE_SWITCH_CONGESTION);
                       ast_set_flag(p, H323_ALREADYGONE);
               }
+               res=0;
               break;
-       case AST_CONTROL_BUSY:
+
+           case AST_CONTROL_BUSY:
               if (!ast_test_flag(p, H323_ALREADYGONE)) {
                       ooHangCall(callToken, OO_REASON_LOCAL_BUSY, AST_CAUSE_USER_BUSY);
                       ast_set_flag(p, H323_ALREADYGONE);
               }
+               res=0;
               break;
-       case AST_CONTROL_HOLD:
-               ast_moh_start(ast, data, NULL);
+
+           case AST_CONTROL_HOLD:
+               ast_moh_start(ast, data, NULL);
+               res=0;
               break;
-       case AST_CONTROL_UNHOLD:
+
+           case AST_CONTROL_UNHOLD:
               ast_moh_stop(ast);
+               res=0;
               break;
-       case AST_CONTROL_PROGRESS:
+
+           case AST_CONTROL_PROGRESS:
               if (ast->_state != AST_STATE_UP) {
                       if (!p->progsent) {
                               if (gH323Debug)
@@ -1237,12 +1246,14 @@
                               else
                                       ooManualProgress(callToken);
                               p->progsent = 1;
+                               res=0;
                       }
               }
-           break;
-      case AST_CONTROL_RINGING:
-           if (ast->_state == AST_STATE_RING || ast->_state == AST_STATE_RINGING) {
-               if (!p->alertsent) {
+               break;
+
+           case AST_CONTROL_RINGING:
+               if (ast->_state == AST_STATE_RING || ast->_state == AST_STATE_RINGING) {
+                   if (!p->alertsent) {
                       if (gH323Debug) {
                               ast_debug(1, "Sending manual ringback for %s, res = %d\n",
                                       callToken,
@@ -1250,16 +1261,22 @@
                       } else {
                                       ooManualRingback(callToken);
                       }
+                       res=0;
+                   }
               }
-           }
-        break;
-       case AST_CONTROL_SRCUPDATE:
+               break;
+
+           case AST_CONTROL_SRCUPDATE:
               ast_rtp_instance_update_source(p->rtp);
+               res=0;
               break;
-       case AST_CONTROL_SRCCHANGE:
+
+           case AST_CONTROL_SRCCHANGE:
               ast_rtp_instance_change_source(p->rtp);
+               res=0;
               break;
-       case AST_CONTROL_CONNECTED_LINE:
+
+           case AST_CONTROL_CONNECTED_LINE:
               if (!ast->connected.id.name.valid
                       || ast_strlen_zero(ast->connected.id.name.str)) {
                       break;
@@ -1268,9 +1285,10 @@
                       ast_log(LOG_DEBUG, "Sending connected line info for %s (%s)\n",
                               callToken, ast->connected.id.name.str);
               ooSetANI(callToken, ast->connected.id.name.str);
+               res=0;
               break;
-
-      case AST_CONTROL_T38_PARAMETERS:
+          
+           case AST_CONTROL_T38_PARAMETERS:
               if (p->t38support != T38_ENABLED) {
                       struct ast_control_t38_parameters parameters = { .request_response = 0 };
                       parameters.request_response = AST_T38_REFUSED;
@@ -1292,6 +1310,7 @@
                               if (!p->chmodepend && !p->faxmode) {
                                       ooRequestChangeMode(p->callToken, 1);
                                       p->chmodepend = 1;
+                                       res=0;
                               }
                               break;

@@ -1300,6 +1319,7 @@
                               if (!p->chmodepend && p->faxmode) {
                                       ooRequestChangeMode(p->callToken, 0);
                                       p->chmodepend = 1;
+                                       res=0;
                               }
                               break;

@@ -1311,10 +1331,10 @@

               }
               break;
-      case AST_CONTROL_PROCEEDING:
-       case -1:
+           case AST_CONTROL_PROCEEDING:
+           case -1:
               break;
-       default:
+           default:
               ast_log(LOG_WARNING, "Don't know how to indicate condition %d on %s\n",
                                                                       condition, callToken);
       }
@@ -1325,7 +1345,7 @@
               ast_verbose("++++  ooh323_indicate %d on %s\n", condition, callToken);

       free(callToken);
-       return -1;
+       return res;
}

static int ooh323_queryoption(struct ast_channel *ast, int option, void *data, int *datalen)
Comments:By: Alexander Anikin (may213) 2011-05-14 07:16:06

This duplicate issue 0018693 and fixed there for
1.8 branch (rev 310734) and trunk (rev 310735).
So i hope that it'll included in next release of 1.8

By: Alexander Anikin (may213) 2011-05-14 07:18:25

Closed due to fixed previously.