SWITCH_DECLARE(switch_call_cause_t) switch_channel_cause_q850(switch_call_cause_t cause);
SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause_q850(switch_channel_t *channel);
+SWITCH_DECLARE(switch_call_cause_t *) switch_channel_get_cause_ptr(switch_channel_t *channel);
/*!
\brief return a cause string for a given cause
switch_core_session_rwunlock(session);
stake->running = 0;
+
return NULL;
}
switch_threadattr_t *thd_attr = NULL;
char *camp_data = NULL;
switch_status_t status;
+ int camp_loops = 0;
if (zstr(data)) {
return;
do {
fail = 0;
- status = switch_ivr_originate(NULL, &peer_session, &cause, camp_data, campon_timeout, NULL, NULL, NULL, NULL, NULL, SOF_NONE, NULL);
if (!switch_channel_ready(caller_channel)) {
fail = 1;
thread_started = 1;
}
+ if (camp_loops++) {
+ if (--campon_retries <= 0 || stake.do_xfer) {
+ camping = 0;
+ stake.do_xfer = 1;
+ break;
+ }
- if (--campon_retries <= 0 || stake.do_xfer) {
- camping = 0;
- stake.do_xfer = 1;
- break;
- }
-
- if (fail) {
- int64_t wait = campon_sleep * 1000000;
-
- while (stake.running && wait > 0 && switch_channel_ready(caller_channel)) {
- switch_yield(100000);
- wait -= 100000;
+ if (fail) {
+ int64_t wait = campon_sleep * 1000000;
+
+ while (stake.running && wait > 0 && switch_channel_ready(caller_channel)) {
+ switch_yield(100000);
+ wait -= 100000;
+ }
}
}
}
+
+ status = switch_ivr_originate(NULL, &peer_session,
+ &cause, camp_data, campon_timeout, NULL, NULL, NULL, NULL, NULL, SOF_NONE,
+ switch_channel_get_cause_ptr(caller_channel));
+
+
} while (camping && switch_channel_ready(caller_channel));
if (thread) {
}
+SWITCH_DECLARE(switch_call_cause_t *) switch_channel_get_cause_ptr(switch_channel_t *channel)
+{
+ return &channel->hangup_cause;
+}
+
+
struct switch_callstate_table {
const char *name;
switch_channel_callstate_t callstate;