Index: app_h324m.c =================================================================== --- app_h324m.c (revision 209) +++ app_h324m.c (working copy) @@ -1012,7 +1012,8 @@ * Example for Austria(Europe): * pseudo = ast_request("Local", AST_FORMAT_ALAW , data, &reason); */ - pseudo = ast_request("Local", AST_FORMAT_ALAW | AST_FORMAT_ULAW, data, &reason); +// pseudo = ast_request("Local", AST_FORMAT_ALAW | AST_FORMAT_ULAW, data, &reason); + pseudo = ast_request("Local", AST_FORMAT_ALAW, data, &reason); /* If somthing has gone wrong */ if (!pseudo) @@ -1059,11 +1060,22 @@ case AST_CONTROL_RINGING: break; case AST_CONTROL_BUSY: + ast_log(LOG_DEBUG, "h324m_call: pseudo channel: BUSY\n"); + ast_log(LOG_DEBUG, "h324m_call: pseudo channel: hangupcause=%d\n",pseudo->hangupcause); + /* Delete frame */ + ast_frfree(f); + /* Save cause */ + reason = AST_CAUSE_BUSY; + /* exit */ + goto hangup_pseudo; + break; case AST_CONTROL_CONGESTION: + ast_log(LOG_DEBUG, "h324m_call: pseudo channel: CONGESTION\n"); + ast_log(LOG_DEBUG, "h324m_call: pseudo channel: hangupcause=%d\n",pseudo->hangupcause); /* Delete frame */ ast_frfree(f); /* Save cause */ - reason = pseudo->hangupcause; + reason = AST_CAUSE_CONGESTION; /* exit */ goto hangup_pseudo; break; @@ -1071,6 +1083,8 @@ /* Set UP*/ reason = 0; break; + default: + reason = pseudo->hangupcause; } } } else { @@ -1097,8 +1111,10 @@ /* If no answer */ if (pseudo->_state != AST_STATE_UP) + { ast_log(LOG_DEBUG, "h324m_call: pseudo channel not up -> hangup\n"); /* goto end */ goto clean_pseudo; + } /* Create session */ void* id = H324MSessionCreate(); @@ -1246,13 +1262,15 @@ end: /* Hangup channel if needed */ - ast_softhangup(chan, reason); +// ast_softhangup(chan, reason); /* Unlock module*/ ast_module_user_remove(u); //Exit - return -1; +// return -1; + chan->hangupcause = reason; + return 0; } static int app_h324m_gw_answer(struct ast_channel *chan, void *data)