]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
freetdm: use ftdm_channel_hangup_with_cause for CAS channels (ftmod_r2)
authorMoises Silva <moy@sangoma.com>
Tue, 1 Mar 2011 17:10:18 +0000 (12:10 -0500)
committerMoises Silva <moy@sangoma.com>
Tue, 1 Mar 2011 17:16:27 +0000 (12:16 -0500)
libs/freetdm/mod_freetdm/mod_freetdm.c
libs/freetdm/src/ftmod/ftmod_r2/ftmod_r2.c

index a52abc0cec931b3b8fd4604fed73f851ef7e7922..4c8c12432adabfc7f44e929c697caed40eaf578f 100755 (executable)
@@ -493,7 +493,6 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session)
        switch (chantype) {
        case FTDM_CHAN_TYPE_FXO:
        case FTDM_CHAN_TYPE_EM:
-       case FTDM_CHAN_TYPE_CAS:
                {
                        ftdm_channel_call_hangup(tech_pvt->ftdmchan);
                }
@@ -510,6 +509,7 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session)
                        }
                }
                break;
+       case FTDM_CHAN_TYPE_CAS:
        case FTDM_CHAN_TYPE_B:
                {
                        ftdm_call_cause_t hcause = switch_channel_get_cause_q850(channel);
@@ -521,8 +521,7 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session)
                break;
        default: 
                {
-                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Unhandled channel type %d for channel %s\n", chantype,
-                    switch_channel_get_name(channel));
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Unhandled channel type %d for channel %s\n", chantype, switch_channel_get_name(channel));
                }
                break;
        }
index 46eb92fededbab9b2671bf136a768ab4951c0cff..c47f97a50bb5d3be00127684ccd3718a2491e2a3 100755 (executable)
@@ -307,6 +307,7 @@ static openr2_call_disconnect_cause_t ftdm_r2_ftdm_cause_to_openr2_cause(ftdm_ch
                return OR2_CAUSE_NORMAL_CLEARING;
 
        case FTDM_CAUSE_USER_BUSY:
+       case FTDM_CAUSE_CALL_REJECTED:
                return OR2_CAUSE_BUSY_NUMBER;
 
        case FTDM_CAUSE_SWITCH_CONGESTION:
@@ -334,7 +335,7 @@ static openr2_call_disconnect_cause_t ftdm_r2_ftdm_cause_to_openr2_cause(ftdm_ch
                return OR2_CAUSE_GLARE;
 
        }
-       ftdm_log_chan(fchan, FTDM_LOG_WARNING, "freetdm hangup cause %d mapped to openr2 cause %s\n",
+       ftdm_log_chan(fchan, FTDM_LOG_NOTICE, "freetdm hangup cause %d mapped to openr2 cause %s\n",
                        fchan->caller_data.hangup_cause, openr2_proto_get_disconnect_string(OR2_CAUSE_UNSPECIFIED));
        return OR2_CAUSE_UNSPECIFIED;
 }