205 const char *str =
"UNKNOWN";
208 if (CAUSE_CHART[x].cause == cause) {
209 str = CAUSE_CHART[x].
name;
223 if (*str > 47 && *str < 58) {
227 if (!strcasecmp(CAUSE_CHART[x].
name, str)) {
228 cause = CAUSE_CHART[x].
cause;
284 const char *file,
const char *func,
int line)
289 if (o_callstate == callstate || o_callstate ==
CCS_HANGUP)
return;
296 "(%s) Callstate Change %s -> %s\n", channel->
name,
318 const char *str =
"UNKNOWN";
321 if (CALLSTATE_CHART[x].callstate == callstate) {
322 str = CALLSTATE_CHART[x].
name;
333 const char *str =
"UNKNOWN";
336 if (DEVICE_STATE_CHART[x].device_state == device_state) {
337 str = DEVICE_STATE_CHART[x].
name;
351 if (*str > 47 && *str < 58) {
352 callstate = atoi(str);
355 if (!strcasecmp(CALLSTATE_CHART[x].
name, str)) {
356 callstate = CALLSTATE_CHART[x].
callstate;
470 (*channel)->name =
"";
471 (*channel)->direction = (*channel)->logical_direction = direction;
531 if (new_dtmf.
digit !=
'w' && new_dtmf.
digit !=
'W') {
579 int sent = 0, dur, bad_input = 0;
584 if (
zstr(dtmf_string)) {
591 if (*dtmf_string ==
'~') {
599 for (i = 0; i < argc; i++) {
602 if ((p = strchr(argv[i],
'@'))) {
609 for (p = argv[i]; p && *p; p++) {
678 const char *dtmf_source_str = NULL;
684 dtmf_source_str =
"INBAND_AUDIO";
687 dtmf_source_str =
"RTP";
690 dtmf_source_str =
"ENDPOINT";
693 dtmf_source_str =
"APP";
697 dtmf_source_str =
"UNKNOWN";
719 dtmf_str[x++] = dtmf.
digit;
771 channel->
state = state;
779 const char *file,
const char *func,
int line)
783 const char *call_info = NULL;
784 char *call_info_state =
"active";
822 call_info_state =
"idle";
823 }
else if (!strcasecmp(status,
"hold-private")) {
824 call_info_state =
"held-private";
825 }
else if (!strcasecmp(status,
"hold")) {
826 call_info_state =
"held";
829 call_info_state =
"progressing";
832 call_info_state =
"idle";
834 call_info_state =
"alerting";
905 if (expanded != var) {
918 const char *r = NULL;
932 if (event && *event) {
975 const char *v = NULL, *r = NULL, *vdup = NULL;
980 if (!
zstr(varname)) {
995 if (!strncmp(varname,
"aleg_", 5)) {
998 }
else if (!strncmp(varname,
"bleg_", 5)) {
1012 if (dup && v != vdup) {
1029 return value ? (
const char *)strdup(value) : NULL;
1046 const char *val = NULL, *r = NULL;
1049 if (!
zstr(varname)) {
1128 const char *old = NULL;
1132 old = channel->
name;
1134 channel->
name = NULL;
1162 if (!strcasecmp(name,
"device_id") && !
zstr(val)) {
1163 const char *device_id;
1179 if (!strcasecmp(name,
"dialplan")) {
1181 }
else if (!strcasecmp(name,
"username")) {
1183 }
else if (!strcasecmp(name,
"caller_id_name")) {
1185 }
else if (!strcasecmp(name,
"caller_id_number")) {
1187 }
else if (!strcasecmp(name,
"callee_id_name")) {
1189 }
else if (!strcasecmp(name,
"callee_id_number")) {
1191 }
else if (val && !strcasecmp(name,
"caller_ton")) {
1193 }
else if (val && !strcasecmp(name,
"caller_numplan")) {
1195 }
else if (val && !strcasecmp(name,
"destination_number_ton")) {
1197 }
else if (val && !strcasecmp(name,
"destination_number_numplan")) {
1199 }
else if (!strcasecmp(name,
"ani")) {
1201 }
else if (!strcasecmp(name,
"aniii")) {
1203 }
else if (!strcasecmp(name,
"network_addr")) {
1205 }
else if (!strcasecmp(name,
"rdnis")) {
1207 }
else if (!strcasecmp(name,
"destination_number")) {
1209 }
else if (!strcasecmp(name,
"uuid")) {
1211 }
else if (!strcasecmp(name,
"source")) {
1213 }
else if (!strcasecmp(name,
"context")) {
1215 }
else if (!strcasecmp(name,
"chan_name")) {
1230 if (!strcasecmp(pn->
var,n->
var)) {
1241 if (pn && !pn->
next && !var_found) {
1261 if (
zstr(export_vars))
return;
1276 for (x = 0; x < argc; x++) {
1279 char *vvar = argv[x];
1280 if (!strncasecmp(vvar,
"nolocal:", 8)) {
1282 }
else if (!strncasecmp(vvar,
"_nolocal_", 9)) {
1289 "%s EXPORTING[%s] [%s]=[%s] to event\n",
1296 "%s EXPORTING[%s] [%s]=[%s] to %s\n",
1310 const char *varname,
const char *val,
1313 char *var_name = NULL;
1314 const char *exports;
1315 char *var, *new_exports, *new_exports_d = NULL;
1323 if (!strncasecmp(var,
"nolocal:", 8)) {
1326 }
else if (!strncasecmp(var,
"_nolocal_", 9)) {
1335 export_varname, local ?
"" :
"(REMOTE ONLY) ",
1336 var_name ? var_name :
"", val ? val :
"UNDEF");
1344 new_exports = new_exports_d;
1358 const char *export_varname,
const char *
fmt, ...)
1393 if (
zstr(prefix) || !strncasecmp(hp->
name, prefix, strlen(prefix))) {
1410 for (; hi; hi = hi->
next) {
1411 char *var = hi->
name;
1412 char *val = hi->
value;
1414 if (
zstr(prefix) || !strncasecmp(var, prefix, strlen(prefix))) {
1427 char *cols[128] = { 0 };
1428 char header_name[128] =
"";
1429 int col_count = 0, i = 0;
1430 char *data_copy = NULL;
1432 if (
zstr(presence_data_cols)) {
1434 if (
zstr(presence_data_cols)) {
1439 data_copy = strdup(presence_data_cols);
1443 for (i = 0; i < col_count; i++) {
1444 const char *val = NULL;
1458 if (!
zstr(tagname)) {
1462 if (
zstr(tagvalue)) {
1481 if (channel->
log_tags && log_tags) {
1531 char *t = (
char *)value;
1532 char *r = (
char *)value;
1535 if (t && *t ==
'"') {
1538 r = tmp = strdup(t);
1662 if (!
zstr(varname)) {
1684 r = channel->
flags[flag];
1774 if (++count >= timeout) {
1870 channel->
caps[cap] = 0;
1877 return channel->
caps[cap] ? 1 : 0;
1908 if (channel->
flags[i]) {
1914 r = (
char *) stream.
data;
1934 if (channel->
caps[i]) {
1940 r = (
char *) stream.
data;
1962 if (channel->
flags[flag] != value) {
2035 channel->
flags[flag]++;
2072 uint32_t *flagp = NULL;
2096 uint32_t *flagp = NULL;
2113 uint32_t *flagp = NULL;
2118 r = (*flagp & flags);
2161 if (channel->
flags[flag]) {
2166 channel->
flags[flag] = 0;
2225 if (channel->
flags[flag]) {
2226 channel->
flags[flag]--;
2240 state = channel->
state;
2310 "CS_EXCHANGE_MEDIA",
2349 for (x = 0; x < 100; x++) {
2367 const char *file,
const char *func,
int line)
2375 channel->
flags[x] = 1;
2429 last_state = channel->
state;
2432 if (last_state == state) {
2436 if (last_state >=
CS_HANGUP && state < last_state) {
2459 switch (last_state) {
2637 return channel->
state;
2659 switch_caller_profile_t *caller_profile, *originator_caller_profile = NULL, *originatee_caller_profile = NULL;
2741 if (caller_profile) {
2761 int global_verbose_events = -1;
2767 if (global_verbose_events ||
2809 char *vvar = NULL, *vval = NULL;
2811 vvar = (
char *) hi->
name;
2812 vval = (
char *) hi->
value;
2827 char *vvar = NULL, *vval = NULL;
2829 vvar = (
char *) hi->
name;
2830 vval = (
char *) hi->
value;
2875 if (!caller_profile->
uuid || strcasecmp(caller_profile->
uuid, uuid)) {
2883 if (!caller_profile->
context) {
2887 if (!caller_profile->
times) {
2932 if (!caller_profile->
times) {
3096 if (state_handler) {
3097 for (index = 0; index < i; index++) {
3103 for (index = 0; index < i; index++) {
3167 if (extension && orig_extension) {
3168 for (ap = orig_extension->current_application; ap && offset > 0; offset--) {
3172 for (; ap; ap = ap->
next) {
3182 for (i = 0; i < argc; i++) {
3183 if (!strcasecmp(argv[i], hi->
name)) {
3208 const char *tname, *tnum;
3216 #ifdef DEEP_DEBUG_CID 3239 const char *tmp = NULL;
3320 return caller_extension;
3401 return channel->
state;
3419 last_state = channel->
state;
3455 return channel->
state;
3468 const char *file,
const char *func,
int line)
3477 const char *file,
const char *func,
int line)
3633 const char *file,
const char *func,
int line)
3673 char *expanded = NULL;
3678 if ((arg = strchr(app,
' '))) {
3693 if (expanded && expanded != arg) {
3711 char *var = hp->
name;
3712 char *val = hp->
value;
3714 if (!strncasecmp(var, variable_prefix, strlen(variable_prefix))) {
3717 for (i = 0; i < hp->
idx; i++) {
3740 char *expanded = NULL;
3744 for(p = app; p && *p; p++) {
3745 if (*p ==
' ' || (*p ==
':' && (*(p+1) !=
':'))) {
3749 }
else if (*p ==
':' && (*(p+1) ==
':')) {
3756 if (!strncasecmp(app,
"perl", 4)) {
3772 if (expanded && expanded != arg) {
3790 char *var = hp->
name;
3791 char *val = hp->
value;
3793 if (!strncasecmp(var, variable_prefix, strlen(variable_prefix))) {
3796 for (i = 0; i < hp->
idx; i++) {
3865 uint32_t seconds = 60;
3964 uint32_t msec = atoi(delay);
3976 #define resize(l) {\ 3978 olen += (len + l + block);\ 3980 if ((dp = realloc(data, olen))) {\ 3983 memset(c, 0, olen - cpos);\ 3989 char *data, *indup, *endof_indup;
3990 size_t sp = 0, len = 0, olen = 0, vtype = 0, br = 0, cpos, block = 128;
3991 char *cloned_sub_val = NULL, *sub_val = NULL, *expanded_sub_val = NULL;
3992 char *func_val = NULL, *sb = NULL;
4011 olen = strlen(in) + 1;
4015 if ((data = malloc(olen))) {
4018 for (p = indup; p && p < endof_indup && *p; p++) {
4023 if (*(p + 1) ==
'$') {
4026 if (*(p + 1) ==
'$') {
4029 }
else if (*(p + 1) ==
'\'') {
4032 }
else if (*(p + 1) ==
'\\') {
4033 if (len + 1 >= olen) {
4043 if (*p ==
'$' && !nv) {
4045 if (*(p + 1) ==
'$') {
4051 if (*(p + 1) ==
'{') {
4052 vtype = global ? 3 : 1;
4062 if (len + 1 >= olen) {
4073 char *s = p, *e, *vname, *vval = NULL;
4078 if ((vtype == 1 || vtype == 3) && *s ==
'{') {
4086 if (br == 1 && *e ==
'}') {
4093 if (e != s && *e ==
'{') {
4095 }
else if (br > 1 && *e ==
'}') {
4102 p = e > endof_indup ? endof_indup : e;
4105 for(sb = vname; sb && *sb; sb++) {
4109 }
else if (*sb ==
'(') {
4127 }
else if (br > 1 && *e ==
')') {
4129 }
else if (br == 1 && *e ==
')') {
4139 if (vtype == 1 || vtype == 3) {
4140 char *expanded = NULL;
4152 if ((ptr = strchr(vname,
':'))) {
4155 if ((ptr = strchr(ptr,
':'))) {
4157 ooffset = atoi(ptr);
4161 if ((ptr = strchr(vname,
'[')) && strchr(ptr,
']')) {
4168 sub_val =
"<Variable Expansion Permission Denied>";
4172 expanded_sub_val = NULL;
4174 sub_val = expanded_sub_val;
4177 if (offset || ooffset) {
4178 cloned_sub_val = strdup(sub_val);
4180 sub_val = cloned_sub_val;
4184 if ((
size_t) offset > strlen(sub_val)) {
4189 }
else if ((
size_t) abs(offset) <= strlen(sub_val)) {
4190 sub_val = cloned_sub_val + (strlen(cloned_sub_val) + offset);
4193 if (ooffset > 0 && (
size_t) ooffset < strlen(sub_val)) {
4194 if ((ptr = (
char *) sub_val + ooffset)) {
4203 char *expanded = NULL;
4208 char *expanded_vname = NULL;
4211 expanded_vname = NULL;
4213 vname = expanded_vname;
4224 sub_val =
"<API Execute Permission Denied>";
4228 func_val = stream.
data;
4245 if ((nlen = sub_val ? strlen(sub_val) : 0)) {
4246 if (len + nlen >= olen) {
4264 if (len + 1 >= olen) {
4276 if (len + 1 >= olen) {
4294 char *encode_buf = NULL;
4295 const char *prof[13] = { 0 }, *prof_names[13] = {
4307 encode_buf = malloc(encode_len);
4310 if (!caller_profile) {
4316 prof[0] = caller_profile->
context;
4321 prof[5] = caller_profile->
ani;
4322 prof[6] = caller_profile->
aniii;
4323 prof[7] = caller_profile->
rdnis;
4324 prof[8] = caller_profile->
source;
4326 prof[10] = caller_profile->
uuid;
4329 prof_names[0] =
"context";
4330 prof_names[1] =
"destination_number";
4331 prof_names[2] =
"caller_id_name";
4332 prof_names[3] =
"caller_id_number";
4333 prof_names[4] =
"network_addr";
4334 prof_names[5] =
"ani";
4335 prof_names[6] =
"aniii";
4336 prof_names[7] =
"rdnis";
4337 prof_names[8] =
"source";
4338 prof_names[9] =
"chan_name";
4339 prof_names[10] =
"uuid";
4340 prof_names[11] =
"transfer_source";
4342 for (x = 0; prof[x]; x++) {
4343 if (
zstr(prof[x])) {
4346 new_len = (strlen(prof[x]) * 3) + 1;
4347 if (encode_len < new_len) {
4350 encode_len = new_len;
4352 if (!(tmp = realloc(encode_buf, encode_len))) {
4359 stream.
write_function(&stream,
"%s=%s&", prof_names[x], encode_buf);
4366 char *var = pn->
var;
4367 char *val = pn->
val;
4369 new_len = (strlen((
char *) var) * 3) + 1;
4370 if (encode_len < new_len) {
4373 encode_len = new_len;
4375 tmp = realloc(encode_buf, encode_len);
4381 stream.
write_function(&stream,
"%s=%s&", (
char *) var, encode_buf);
4387 for (; hi; hi = hi->
next) {
4388 char *var = hi->
name;
4389 char *val = hi->
value;
4391 new_len = (strlen((
char *) var) * 3) + 1;
4392 if (encode_len < new_len) {
4395 encode_len = new_len;
4397 tmp = realloc(encode_buf, encode_len);
4403 stream.
write_function(&stream,
"%s=%s&", (
char *) var, encode_buf);
4409 e = (
char *) stream.
data + (strlen((
char *) stream.
data) - 1);
4411 if (e && *e ==
'&') {
4471 if (!strncmp(hi->
name, prefix, strlen(prefix))) {
4491 const char *cid_buf = NULL;
4494 char *last_app = NULL, *last_arg = NULL;
4495 char start[80] =
"", resurrect[80] =
"", answer[80] =
"", hold[80],
4496 bridge[80] =
"", progress[80] =
"", progress_media[80] =
"", end[80] =
"", tmp[80] =
"",
4497 profile_start[80] =
"";
4498 int32_t duration = 0, legbillsec = 0, billsec = 0, mduration = 0, billmsec = 0, legbillmsec = 0, progressmsec = 0, progress_mediamsec = 0;
4499 int32_t answersec = 0, answermsec = 0, waitsec = 0, waitmsec = 0;
4501 switch_time_t uduration = 0, legbillusec = 0, billusec = 0, progresssec = 0, progressusec = 0, progress_mediasec = 0, progress_mediausec = 0, waitusec = 0;
4502 time_t tt_created = 0, tt_answered = 0, tt_resurrected = 0, tt_bridged, tt_last_hold, tt_hold_accum,
4503 tt_progress = 0, tt_progress_media = 0, tt_hungup = 0, mtt_created = 0, mtt_answered = 0, mtt_bridged = 0,
4504 mtt_hungup = 0, tt_prof_created, mtt_progress = 0, mtt_progress_media = 0;
4524 for (ap = app_log; ap && ap->
next; ap = ap->
next);
4540 dtstr[x++] = dt->
digit;
4548 char *digit_string = dtstr;
4551 char *substituted = NULL;
4557 if ((proceed =
switch_regex_perform(dtstr, var, &re, ovector,
sizeof(ovector) /
sizeof(ovector[0])))) {
4558 int len = (strlen(dtstr) + strlen(var) + 10) * proceed;
4560 const char *replace = NULL;
4564 for (i = 0; i < proceed; i++) {
4565 if (pcre_get_substring(dtstr, ovector, proceed, i, &replace) >= 0) {
4574 pcre_free_substring(replace);
4579 if (!
zstr(substituted)) {
4580 digit_string = substituted;
4593 if (caller_profile->
times) {
4596 const char *
fmt =
"%Y-%m-%d %T";
4663 tt_created = (time_t) (caller_profile->
times->
created / 1000000);
4664 mtt_created = (time_t) (caller_profile->
times->
created / 1000);
4676 tt_answered = (time_t) (caller_profile->
times->
answered / 1000000);
4677 mtt_answered = (time_t) (caller_profile->
times->
answered / 1000);
4683 tt_bridged = (time_t) (caller_profile->
times->
bridged / 1000000);
4684 mtt_bridged = (time_t) (caller_profile->
times->
bridged / 1000);
4690 tt_last_hold = (time_t) (caller_profile->
times->
last_hold / 1000000);
4696 tt_hold_accum = (time_t) (caller_profile->
times->
hold_accum / 1000000);
4710 tt_progress = (time_t) (caller_profile->
times->
progress / 1000000);
4711 mtt_progress = (time_t) (caller_profile->
times->
progress / 1000);
4724 tt_hungup = (time_t) (caller_profile->
times->
hungup / 1000000);
4725 mtt_hungup = (time_t) (caller_profile->
times->
hungup / 1000);
4731 duration = (int32_t) (tt_hungup - tt_created);
4732 mduration = (int32_t) (mtt_hungup - mtt_created);
4736 waitsec = (int32_t) (tt_bridged - tt_created);
4737 waitmsec = (int32_t) (mtt_bridged - mtt_created);
4746 billsec = (int32_t) (tt_hungup - tt_answered);
4747 billmsec = (int32_t) (mtt_hungup - mtt_answered);
4750 legbillsec = (int32_t) (tt_hungup - tt_created);
4751 legbillmsec = (int32_t) (mtt_hungup - mtt_created);
4754 answersec = (int32_t) (tt_answered - tt_created);
4755 answermsec = (int32_t) (mtt_answered - mtt_created);
4760 progresssec = (int32_t) (tt_progress - tt_created);
4761 progressmsec = (int32_t) (mtt_progress - mtt_created);
4766 progress_mediasec = (int32_t) (tt_progress_media - tt_created);
4767 progress_mediamsec = (int32_t) (mtt_progress_media - mtt_created);
4847 const char *uuid = NULL;
4855 strncpy(buf, uuid, blen);
4856 uuid = (
const char *) buf;
4866 const char *uuid = NULL;
4878 const char *transfer_on_fail = NULL;
4879 char *tof_data = NULL;
4880 char *tof_array[4] = { 0 };
4890 transfer_on_fail = tof_array[0];
4901 const char *continue_on_fail = NULL, *failure_causes = NULL;
4906 if (continue_on_fail || failure_causes) {
4907 const char *cause_str;
4908 char cause_num[35] =
"";
4913 if (failure_causes) {
4915 char *argv[256] = { 0 };
4919 for (i = 0; i < argc; i++) {
4920 if (!strcasecmp(argv[i], cause_str) || !strcasecmp(argv[i], cause_num)) {
4927 "Failure causes [%s]: Cause: %s\n", failure_causes, cause_str);
4932 if (continue_on_fail) {
4937 char *argv[256] = { 0 };
4941 for (i = 0; i < argc; i++) {
4942 if (!strcasecmp(argv[i], cause_str) || !strcasecmp(argv[i], cause_num)) {
4944 "Continue on fail [%s]: Cause: %s\n", continue_on_fail, cause_str);
4957 if (transfer_on_fail || failure_causes) {
4958 const char *cause_str;
4959 char cause_num[35] =
"";
4964 if ((tof_array[1] == NULL ) || (!strcasecmp(tof_array[1],
"auto_cause"))){
4965 tof_array[1] = (
char *) cause_str;
4968 if (failure_causes) {
4970 char *argv[256] = { 0 };
4974 for (i = 0; i < argc; i++) {
4975 if (!strcasecmp(argv[i], cause_str) || !strcasecmp(argv[i], cause_num)) {
4982 "Failure causes [%s]: Cause: %s\n", failure_causes, cause_str);
4988 if (transfer_on_fail) {
4993 char *argv[256] = { 0 };
4997 for (i = 0; i < argc; i++) {
4998 if (!strcasecmp(argv[i], cause_str) || !strcasecmp(argv[i], cause_num)) {
5000 "Transfer on fail [%s]: Cause: %s\n", transfer_on_fail, cause_str);
5136 char prefix[80] =
"";
5287 switch(drec->
state) {
5345 "%s device: %s\nState: %s Dev State: %s/%s Total:%u Offhook:%u " 5346 "Ringing:%u Early:%u Active:%u Held:%u Unheld:%u Hungup:%u Dur: %u Ringtime: %u Holdtime: %u %s\n",
5365 for (ptr =
globals.device_bindings; ptr; ptr = ptr->
next) {
5493 if (drecp && *drecp) {
5502 assert(
function != NULL);
5512 for (ptr =
globals.device_bindings; ptr && ptr->next; ptr = ptr->next);
5515 ptr->next = binding;
5517 globals.device_bindings = binding;
5531 for (ptr =
globals.device_bindings; ptr; ptr = ptr->
next) {
5553 char *use_sdp = (
char *) sdp;
5554 char *patched_sdp = NULL;
5561 use_sdp = patched_sdp;
char * switch_channel_get_cap_string(switch_channel_t *channel)
switch_status_t switch_channel_set_variable_printf(switch_channel_t *channel, const char *varname, const char *fmt,...)
_Ret_opt_z_ char * switch_event_get_header_idx(switch_event_t *event, const char *header_name, int idx)
void switch_channel_set_cap_value(switch_channel_t *channel, switch_channel_cap_t cap, uint32_t value)
switch_time_t switch_micro_time_now(void)
Get the current epoch time in microseconds.
void switch_core_session_hangup_state(switch_core_session_t *session, switch_bool_t force)
void * switch_core_hash_find_locked(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_ switch_mutex_t *mutex)
Retrieve data from a given hash.
switch_channel_state_t switch_channel_get_state(switch_channel_t *channel)
Get the current state of a channel in the state engine.
#define switch_event_fire(event)
Fire an event filling in most of the arguements with obvious values.
#define switch_channel_hangup(channel, hangup_cause)
Hangup a channel flagging it's state machine to end.
#define switch_regex_safe_free(re)
void switch_xml_free(_In_opt_ switch_xml_t xml)
frees the memory allocated for an switch_xml structure
unsigned int switch_queue_size(switch_queue_t *queue)
void switch_channel_state_thread_unlock(switch_channel_t *channel)
switch_event_types_t event_id
#define switch_core_new_memory_pool(p)
Create a new sub memory pool from the core's master pool.
void switch_channel_set_flag_recursive(switch_channel_t *channel, switch_channel_flag_t flag)
switch_caller_extension_t * switch_channel_get_caller_extension(switch_channel_t *channel)
Retrieve caller extension from a given channel.
char * switch_core_session_sprintf(_In_ switch_core_session_t *session, _In_z_ _Printf_format_string_ const char *fmt,...)
printf-style style printing routine. The data is output to a string allocated from the session ...
switch_status_t switch_channel_set_profile_var(switch_channel_t *channel, const char *name, const char *val)
Set a variable on a given channel.
void switch_channel_flush_dtmf(switch_channel_t *channel)
switch_event_t * variables
#define SWITCH_SENSITIVE_DTMF_VARIABLE
static switch_bool_t switch_true(const char *expr)
Evaluate the truthfullness of a string expression.
#define SWITCH_CHANNEL_SESSION_LOG(x)
An Abstract Representation of a dialplan extension.
switch_channel_callstate_t callstate
void switch_channel_handle_cause(switch_channel_t *channel, switch_call_cause_t cause)
switch_channel_state_t switch_channel_perform_set_state(switch_channel_t *channel, const char *file, const char *func, int line, switch_channel_state_t state)
#define switch_set_flag(obj, flag)
Set a flag on an arbitrary object.
switch_call_direction_t logical_direction
#define SWITCH_ORIGINATOR_VARIABLE
switch_core_session_message_types_t message_id
#define SWITCH_CHANNEL_LOG
switch_status_t switch_channel_set_variable_name_printf(switch_channel_t *channel, const char *val, const char *fmt,...)
switch_status_t switch_mutex_trylock(switch_mutex_t *lock)
switch_status_t switch_core_hash_destroy(_Inout_ switch_hash_t **hash)
Destroy an existing hash table.
uint32_t switch_channel_test_flag_partner(switch_channel_t *channel, switch_channel_flag_t flag)
switch_status_t switch_channel_export_variable_var_check(switch_channel_t *channel, const char *varname, const char *val, const char *export_varname, switch_bool_t var_check)
void * switch_core_hash_find(_In_ switch_hash_t *hash, _In_z_ const char *key)
Retrieve data from a given hash.
struct switch_hold_record_s * next
void switch_core_session_signal_state_change(_In_ switch_core_session_t *session)
struct switch_device_state_binding_s switch_device_state_binding_t
void switch_channel_set_hangup_time(switch_channel_t *channel)
switch_status_t switch_channel_perform_mark_pre_answered(switch_channel_t *channel, const char *file, const char *func, int line)
#define switch_event_del_header(_e, _h)
#define switch_channel_export_variable(_channel, _varname, _value, _ev)
int switch_core_test_flag(int flag)
#define switch_core_hash_init(_hash)
#define switch_channel_set_state(channel, state)
Set the current state of a channel.
switch_status_t switch_channel_set_private(switch_channel_t *channel, const char *key, const void *private_info)
Set private data on channel.
void switch_channel_clear_state_flag(switch_channel_t *channel, switch_channel_flag_t flag)
void switch_channel_perform_video_sync(switch_channel_t *channel, const char *file, const char *func, int line)
switch_call_direction_t switch_channel_logical_direction(switch_channel_t *channel)
void switch_channel_event_set_basic_data(switch_channel_t *channel, switch_event_t *event)
switch_status_t switch_ivr_sleep(switch_core_session_t *session, uint32_t ms, switch_bool_t sync, switch_input_args_t *args)
Wait for time to pass for a specified number of milliseconds.
switch_status_t switch_channel_dequeue_dtmf(switch_channel_t *channel, switch_dtmf_t *dtmf)
switch_event_t * api_list
struct switch_caller_profile * originatee_caller_profile
switch_queue_t * dtmf_log_queue
switch_device_state_t state
switch_event_types_t
Built-in Events.
void switch_channel_clear_device_record(switch_channel_t *channel)
#define SWITCH_CHANNEL_EXECUTE_ON_MEDIA_VARIABLE
switch_device_state_t last_state
switch_hash_t * app_flag_hash
char * switch_core_get_variable_pdup(_In_z_ const char *varname, switch_memory_pool_t *pool)
static int switch_string_has_escaped_data(const char *in)
void switch_channel_set_bridge_time(switch_channel_t *channel)
switch_device_stats_t stats
opaque_channel_flag_t opaque_flags
void switch_event_add_presence_data_cols(switch_channel_t *channel, switch_event_t *event, const char *prefix)
const char * switch_channel_callstate2str(switch_channel_callstate_t callstate)
switch_status_t switch_core_session_perform_receive_message(_In_ switch_core_session_t *session, _In_ switch_core_session_message_t *message, const char *file, const char *func, int line)
Receive a message on a given session.
switch_status_t switch_channel_queue_dtmf(switch_channel_t *channel, const switch_dtmf_t *dtmf)
switch_mutex_t * switch_core_session_get_mutex(switch_core_session_t *session)
Signal a session's state machine thread that a state change has occured.
#define switch_channel_presence(_a, _b, _c, _d)
#define switch_core_strdup(_pool, _todup)
Copy a string using memory allocation from a given pool.
#define switch_split(_data, _delim, _array)
const char * network_addr
#define SWITCH_PROTO_SPECIFIC_HANGUP_CAUSE_VARIABLE
switch_time_t active_stop
switch_status_t switch_api_execute(const char *cmd, const char *arg, switch_core_session_t *session, switch_stream_handle_t *stream)
Execute a registered API command.
#define SWITCH_CHANNEL_API_ON_PRE_ANSWER_VARIABLE
switch_caller_profile_t * caller_profile
switch_channel_flag_t
Channel Flags.
#define switch_core_destroy_memory_pool(p)
Returns a subpool back to the main pool.
switch_memory_pool_t * pool
switch_status_t switch_event_add_header(switch_event_t *event, switch_stack_t stack, const char *header_name, const char *fmt,...) PRINTF_FUNCTION(4
Add a header to an event.
Representation of an event.
int switch_event_check_permission_list(switch_event_t *list, const char *name)
switch_caller_profile_t * hup_profile
switch_hold_record_t * hold_record
#define switch_channel_ready(_channel)
const char * switch_channel_get_variable_strdup(switch_channel_t *channel, const char *varname)
Retrieve a copy of a variable from a given channel. switch_safe_free() call will be required...
const char *const const char *const const cJSON *const value
An Abstract Representation of a dialplan Application.
switch_status_t switch_queue_trypop(switch_queue_t *queue, void **data)
void * switch_channel_get_private_partner(switch_channel_t *channel, const char *key)
switch_core_session_message_types_t
Possible types of messages for inter-session communication.
switch_hash_t * private_hash
switch_caller_profile_t * switch_caller_profile_clone(_In_ switch_core_session_t *session, _In_ switch_caller_profile_t *tocopy)
Clone an existing caller profile object.
switch_size_t switch_channel_dequeue_dtmf_string(switch_channel_t *channel, char *dtmf_str, switch_size_t len)
switch_status_t switch_channel_bind_device_state_handler(switch_device_state_function_t function, void *user_data)
void switch_channel_set_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
Set the given channel's caller profile.
switch_channel_state_t switch_channel_get_running_state(switch_channel_t *channel)
void switch_channel_flip_cid(switch_channel_t *channel)
switch_status_t switch_channel_alloc(switch_channel_t **channel, switch_call_direction_t direction, switch_memory_pool_t *pool)
#define SWITCH_HOLD_MUSIC_VARIABLE
switch_status_t switch_channel_set_variable_partner_var_check(switch_channel_t *channel, const char *varname, const char *value, switch_bool_t var_check)
const char * switch_channel_get_partner_uuid_copy(switch_channel_t *channel, char *buf, switch_size_t blen)
switch_bool_t switch_is_number(const char *str)
switch_status_t switch_time_exp_lt(switch_time_exp_t *result, switch_time_t input)
struct switch_event * next
const char * switch_core_session_get_external_id(_In_ switch_core_session_t *session)
Retrieve the unique external identifier from a session.
switch_time_t active_start
struct switch_caller_profile * next
const char * switch_channel_get_variable_dup(switch_channel_t *channel, const char *varname, switch_bool_t dup, int idx)
Retrieve a variable from a given channel.
void switch_channel_set_state_flag(switch_channel_t *channel, switch_channel_flag_t flag)
Set given flag(s) on a given channel to be applied on the next state change.
switch_status_t switch_core_session_queue_message(_In_ switch_core_session_t *session, _In_ switch_core_session_message_t *message)
Queue a message on a session.
switch_device_state_binding_t * device_bindings
const char * switch_channel_device_state2str(switch_device_state_t device_state)
static const char * state_names[]
int switch_channel_check_signal(switch_channel_t *channel, switch_bool_t in_thread_only)
struct real_pcre switch_regex_t
char * switch_channel_expand_variables_check(switch_channel_t *channel, const char *in, switch_event_t *var_list, switch_event_t *api_list, uint32_t recur)
Expand varaibles in a string based on the variables in a paticular channel.
switch_mutex_t * state_mutex
char * switch_url_encode(const char *url, char *buf, size_t len)
switch_status_t switch_event_dup(switch_event_t **event, switch_event_t *todup)
Duplicate an event.
switch_status_t switch_strftime_nocheck(char *s, switch_size_t *retsize, switch_size_t max, const char *format, switch_time_exp_t *tm)
switch_event_header_t * switch_channel_variable_first(switch_channel_t *channel)
Start iterating over the entries in the channel variable list.
#define SWITCH_MAX_STATE_HANDLERS
switch_status_t switch_channel_perform_answer(switch_channel_t *channel, const char *file, const char *func, int line)
switch_status_t switch_core_session_execute_application_async(switch_core_session_t *session, const char *app, const char *arg)
char * switch_channel_get_flag_string(switch_channel_t *channel)
int switch_snprintf(_Out_z_cap_(len) char *buf, _In_ switch_size_t len, _In_z_ _Printf_format_string_ const char *format,...)
_Check_return_ _Ret_opt_z_ const char * switch_caller_get_field_by_name(_In_ switch_caller_profile_t *caller_profile, _In_z_ const char *name)
Get the value of a field in a caller profile based on it's name.
int switch_channel_test_private_flag(switch_channel_t *channel, uint32_t flags)
uint32_t switch_channel_test_flag(switch_channel_t *channel, switch_channel_flag_t flag)
Test for presence of given flag on a given channel.
void switch_channel_event_set_extended_data(switch_channel_t *channel, switch_event_t *event)
void switch_channel_perform_audio_sync(switch_channel_t *channel, const char *file, const char *func, int line)
void switch_channel_set_scope_variables(switch_channel_t *channel, switch_event_t **event)
const char * switch_channel_get_partner_uuid(switch_channel_t *channel)
switch_call_cause_t switch_channel_str2cause(const char *str)
switch_codec_t * switch_core_session_get_write_codec(_In_ switch_core_session_t *session)
Retrieve the write codec from a given session.
A message object designed to allow unlike technologies to exchange data.
void switch_channel_set_origination_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
Set the given channel's origination caller profile.
#define SWITCH_ORIGINATE_SIGNAL_BOND_VARIABLE
static void do_api_on(switch_channel_t *channel, const char *variable)
struct device_uuid_node_s * uuid_tail
switch_status_t switch_channel_get_scope_variables(switch_channel_t *channel, switch_event_t **event)
switch_codec_t * switch_core_session_get_read_codec(_In_ switch_core_session_t *session)
Retrieve the read codec from a given session.
switch_size_t switch_core_session_id(void)
Provide the current session_id.
switch_caller_profile_t * switch_channel_get_originatee_caller_profile(switch_channel_t *channel)
Retrieve the given channel's originatee caller profile.
uint32_t switch_core_max_dtmf_duration(uint32_t duration)
struct switch_caller_application * next
static switch_status_t send_ind(switch_channel_t *channel, switch_core_session_message_types_t msg_id, const char *file, const char *func, int line)
switch_channel_state_t switch_channel_perform_hangup(switch_channel_t *channel, const char *file, const char *func, int line, switch_call_cause_t hangup_cause)
static void process_device_hup(switch_channel_t *channel)
switch_status_t switch_ivr_session_transfer(_In_ switch_core_session_t *session, const char *extension, const char *dialplan, const char *context)
Transfer an existing session to another location.
switch_mutex_t * profile_mutex
#define is_dtmf(key)
determine if a character is a valid DTMF key
void switch_channel_invert_cid(switch_channel_t *channel)
switch_status_t switch_mutex_unlock(switch_mutex_t *lock)
switch_status_t switch_core_session_get_read_impl(switch_core_session_t *session, switch_codec_implementation_t *impp)
void switch_channel_state_thread_lock(switch_channel_t *channel)
switch_event_t * scope_variables
#define switch_core_session_execute_application(_a, _b, _c)
Execute an application on a session.
_Ret_ switch_channel_t * switch_core_session_get_channel(_In_ switch_core_session_t *session)
Retrieve a pointer to the channel object associated with a given session.
void switch_core_recovery_track(switch_core_session_t *session)
switch_status_t switch_channel_queue_dtmf_string(switch_channel_t *channel, const char *dtmf_string)
void switch_channel_clear_app_flag_key(const char *key, switch_channel_t *channel, uint32_t flags)
void switch_channel_mark_hold(switch_channel_t *channel, switch_bool_t on)
#define SWITCH_MUTEX_NESTED
uint32_t switch_core_min_dtmf_duration(uint32_t duration)
switch_caller_extension_t * queued_extension
void switch_channel_wait_for_state(switch_channel_t *channel, switch_channel_t *other_channel, switch_channel_state_t want_state)
switch_status_t switch_channel_perform_pre_answer(switch_channel_t *channel, const char *file, const char *func, int line)
void switch_caller_profile_event_set_data(_In_ switch_caller_profile_t *caller_profile, _In_opt_z_ const char *prefix, _In_ switch_event_t *event)
Add headers to an existing event in regards to a specific profile.
void switch_core_session_enable_heartbeat(switch_core_session_t *session, uint32_t seconds)
switch_channel_state_t running_state
switch_status_t switch_channel_perform_mark_ring_ready_value(switch_channel_t *channel, switch_ring_ready_t rv, const char *file, const char *func, int line)
void switch_channel_event_set_data(switch_channel_t *channel, switch_event_t *event)
switch_byte_t switch_byte_t * buf
switch_event_t * app_list
void switch_channel_set_private_flag(switch_channel_t *channel, uint32_t flags)
switch_channel_timetable_t * switch_channel_get_timetable(switch_channel_t *channel)
if((uint32_t)(unpack->cur - unpack->buf) > unpack->buflen)
const char * switch_channel_state_name(switch_channel_state_t state)
switch_status_t switch_core_get_variables(switch_event_t **event)
#define switch_yield(ms)
Wait a desired number of microseconds and yield the CPU.
switch_device_state_function_t function
struct switch_caller_extension * next
#define switch_channel_audio_sync(_c)
unsigned int switch_separate_string(_In_ char *buf, char delim, _Post_count_(return) char **array, unsigned int arraylen)
Separate a string into an array based on a character delimiter.
switch_status_t switch_core_hash_insert_locked(_In_ switch_hash_t *hash, _In_z_ const char *key, _In_opt_ const void *data, _In_opt_ switch_mutex_t *mutex)
Insert data into a hash.
switch_event_t * log_tags
switch_call_direction_t logical_direction
void switch_channel_global_init(switch_memory_pool_t *pool)
const char * switch_channel_get_hold_music(switch_channel_t *channel)
void switch_channel_sort_cid(switch_channel_t *channel)
void switch_event_merge(switch_event_t *event, switch_event_t *tomerge)
switch_status_t switch_mutex_lock(switch_mutex_t *lock)
const char * callee_id_number
void switch_channel_process_export(switch_channel_t *channel, switch_channel_t *peer_channel, switch_event_t *var_event, const char *export_varname)
int switch_channel_test_ready(switch_channel_t *channel, switch_bool_t check_ready, switch_bool_t check_media)
Determine if a channel is ready for io.
switch_status_t switch_channel_set_log_tag(switch_channel_t *channel, const char *tagname, const char *tagvalue)
switch_status_t switch_channel_add_variable_var_check(switch_channel_t *channel, const char *varname, const char *value, switch_bool_t var_check, switch_stack_t stack)
static void fetch_device_stats(switch_device_record_t *drec)
switch_queue_t * dtmf_queue
#define switch_core_session_request_video_refresh(_s)
uint32_t switch_channel_test_cap_partner(switch_channel_t *channel, switch_channel_cap_t cap)
#define switch_core_alloc(_pool, _mem)
Allocate memory directly from a memory pool.
#define SWITCH_ENDPOINT_DISPOSITION_VARIABLE
uint32_t actual_samples_per_second
void switch_channel_clear_state_handler(switch_channel_t *channel, const switch_state_handler_table_t *state_handler)
clear a state handler table from a given channel
switch_call_direction_t direction
#define switch_channel_get_variable(_c, _v)
switch_status_t switch_event_add_header_string(switch_event_t *event, switch_stack_t stack, const char *header_name, const char *data)
Add a string header to an event.
switch_status_t switch_channel_caller_extension_masquerade(switch_channel_t *orig_channel, switch_channel_t *new_channel, uint32_t offset)
#define switch_zmalloc(ptr, len)
uint8_t destination_number_ton
switch_call_cause_t * switch_channel_get_cause_ptr(switch_channel_t *channel)
const char * caller_id_name
#define switch_channel_set_variable_partner(_channel, _var, _val)
#define switch_safe_free(it)
Free a pointer and set it to NULL unless it already is NULL.
switch_originator_type_t last_profile_type
switch_call_cause_t switch_channel_get_cause(switch_channel_t *channel)
switch_status_t switch_channel_get_variables(switch_channel_t *channel, switch_event_t **event)
void switch_channel_process_device_hangup(switch_channel_t *channel)
switch_status_t switch_mutex_init(switch_mutex_t **lock, unsigned int flags, switch_memory_pool_t *pool)
#define SWITCH_BLANK_STRING
void switch_channel_set_flag_value(switch_channel_t *channel, switch_channel_flag_t flag, uint32_t value)
Set given flag(s) on a given channel.
#define SWITCH_CHANNEL_EXECUTE_ON_ANSWER_VARIABLE
switch_status_t switch_channel_transfer_variable_prefix(switch_channel_t *orig_channel, switch_channel_t *new_channel, const char *prefix)
static struct switch_cause_table CAUSE_CHART[]
switch_status_t switch_channel_export_variable_printf(switch_channel_t *channel, const char *varname, const char *export_varname, const char *fmt,...)
#define switch_channel_down_nosig(_channel)
switch_status_t switch_core_session_recv_dtmf(_In_ switch_core_session_t *session, const switch_dtmf_t *dtmf)
RECV DTMF on a session.
struct profile_node_s * next
void switch_channel_set_caller_extension(switch_channel_t *channel, switch_caller_extension_t *caller_extension)
Assign a caller extension to a given channel.
struct switch_caller_profile * origination_caller_profile
switch_call_direction_t direction
static void switch_channel_check_device_state(switch_channel_t *channel, switch_channel_callstate_t callstate)
void switch_channel_set_presence_data_vals(switch_channel_t *channel, const char *presence_data_cols)
Takes presence_data_cols as a parameter or as a channel variable and copies them to channel profile v...
int switch_vasprintf(_Out_opt_ char **buf, _In_z_ _Printf_format_string_ const char *format, _In_ va_list ap)
const switch_state_handler_table_t * state_handlers[SWITCH_MAX_STATE_HANDLERS]
void bridge(CoreSession &session_a, CoreSession &session_b)
bridge the audio of session_b into session_a
switch_bool_t switch_channel_set_flag_partner(switch_channel_t *channel, switch_channel_flag_t flag)
Set given flag(s) on a given channel's bridge partner.
switch_status_t switch_channel_pass_sdp(switch_channel_t *from_channel, switch_channel_t *to_channel, const char *sdp)
void switch_caller_extension_add_application(_In_ switch_core_session_t *session, _In_ switch_caller_extension_t *caller_extension, _In_z_ const char *application_name, _In_z_ const char *extra_data)
Add an application (instruction) to the given extension.
switch_status_t switch_channel_get_variable_buf(switch_channel_t *channel, const char *varname, char *buf, switch_size_t buflen)
Retrieve a variable from a given channel to a pre-allocated buffer without using a memory pool...
switch_status_t switch_channel_wait_for_app_flag(switch_channel_t *channel, uint32_t app_flag, const char *key, switch_bool_t pres, uint32_t to)
void switch_channel_set_originator_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
Set the given channel's originator caller profile.
uint8_t destination_number_numplan
struct device_uuid_node_s * next
uint32_t flags[CF_FLAG_MAX]
static switch_bool_t switch_string_var_check_const(const char *s)
switch_byte_t switch_byte_t uint32_t buflen
switch_mutex_t * flag_mutex
const char * profile_index
void switch_cond_next(void)
#define switch_core_session_get_partner(_session, _partner)
switch_size_t switch_channel_has_dtmf(switch_channel_t *channel)
switch_status_t switch_core_session_get_write_impl(switch_core_session_t *session, switch_codec_implementation_t *impp)
struct switch_caller_profile * originator_caller_profile
#define SWITCH_STANDARD_STREAM(s)
void switch_channel_global_uninit(void)
const char * switch_channel_get_hold_music_partner(switch_channel_t *channel)
int switch_regex_perform(const char *field, const char *expression, switch_regex_t **new_re, int *ovector, uint32_t olen)
void switch_channel_wait_for_state_timeout(switch_channel_t *channel, switch_channel_state_t want_state, uint32_t timeout)
switch_channel_callstate_t
void switch_channel_restart(switch_channel_t *channel)
char * switch_copy_string(_Out_z_cap_(dst_size) char *dst, _In_z_ const char *src, _In_ switch_size_t dst_size)
uint32_t switch_core_session_count(void)
Provide the total number of sessions.
switch_status_t switch_caller_extension_clone(switch_caller_extension_t **new_ext, switch_caller_extension_t *orig, switch_memory_pool_t *pool)
switch_status_t switch_core_session_queue_event(_In_ switch_core_session_t *session, _Inout_ switch_event_t **event)
Queue an event on a given session.
switch_status_t switch_event_base_add_header(switch_event_t *event, switch_stack_t stack, const char *header_name, char *data)
void switch_channel_set_hunt_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
static switch_status_t switch_event_create_plain(switch_event_t **event, switch_event_types_t event_id)
char * switch_channel_get_uuid(switch_channel_t *channel)
Retrieve the given channel's unique id.
switch_caller_extension_t * switch_caller_extension_new(_In_ switch_core_session_t *session, _In_z_ const char *extension_name, _In_z_ const char *extension_number)
Create a new extension with desired parameters.
void * switch_core_hash_delete(_In_ switch_hash_t *hash, _In_z_ const char *key)
Delete data from a hash based on desired key.
void switch_core_session_rwunlock(_In_ switch_core_session_t *session)
Unlock a read or write lock on as given session.
switch_status_t switch_channel_dtmf_lock(switch_channel_t *channel)
switch_status_t switch_channel_get_variables_prefix(switch_channel_t *channel, const char *prefix, switch_event_t **event)
char * switch_core_session_get_uuid(_In_ switch_core_session_t *session)
Retrieve the unique identifier from a session.
switch_channel_callstate_t callstate
switch_status_t switch_channel_set_variable_var_check(switch_channel_t *channel, const char *varname, const char *value, switch_bool_t var_check)
uint32_t switch_channel_test_cap(switch_channel_t *channel, switch_channel_cap_t cap)
switch_channel_state_t switch_channel_perform_set_running_state(switch_channel_t *channel, switch_channel_state_t state, const char *file, const char *func, int line)
void switch_channel_set_app_flag_key(const char *key, switch_channel_t *channel, uint32_t flags)
#define SWITCH_CHANNEL_EXECUTE_ON_RING_VARIABLE
void switch_channel_perform_set_callstate(switch_channel_t *channel, switch_channel_callstate_t callstate, const char *file, const char *func, int line)
#define switch_str_nil(s)
Make a null string a blank string instead.
switch_status_t switch_channel_unbind_device_state_handler(switch_device_state_function_t function)
struct fspr_thread_mutex_t switch_mutex_t
switch_device_state_t device_state
unsigned int switch_core_session_running(_In_ switch_core_session_t *session)
determine if the session's state machine is running
const char * switch_channel_get_variable_partner(switch_channel_t *channel, const char *varname)
uint32_t switch_core_default_dtmf_duration(uint32_t duration)
switch_channel_state_t
Channel States (these are the defaults, CS_SOFT_EXECUTE, CS_EXCHANGE_MEDIA, and CS_CONSUME_MEDIA are ...
#define switch_channel_expand_variables(_channel, _in)
void switch_channel_clear_cap(switch_channel_t *channel, switch_channel_cap_t cap)
switch_stream_handle_write_function_t write_function
static void add_uuid(switch_device_record_t *drec, switch_channel_t *channel)
#define switch_channel_down(_channel)
const char * switch_channel_set_device_id(switch_channel_t *channel, const char *device_id)
#define switch_channel_set_callstate(channel, state)
#define SWITCH_DTMF_LOG_LEN
void switch_channel_step_caller_profile(switch_channel_t *channel)
#define SWITCH_PASSTHRU_PTIME_MISMATCH_VARIABLE
void switch_channel_clear_private_flag(switch_channel_t *channel, uint32_t flags)
void switch_channel_uninit(switch_channel_t *channel)
Uninitalize a channel.
switch_status_t
Common return values.
#define MESSAGE_STAMP_FFL(_m)
switch_memory_pool_t * pool
char * switch_string_replace(const char *string, const char *search, const char *replace)
void * switch_channel_get_private(switch_channel_t *channel, const char *key)
Retrieve private from a given channel.
static struct switch_callstate_table CALLSTATE_CHART[]
static switch_status_t create_device_record(switch_device_record_t **drecp, const char *device_id)
switch_core_session_t * switch_channel_get_session(switch_channel_t *channel)
#define SWITCH_ENABLE_HEARTBEAT_EVENTS_VARIABLE
switch_call_direction_t direction
#define SWITCH_SIGNAL_BOND_VARIABLE
uint32_t caps[CC_FLAG_MAX]
#define check_media(session)
char * destination_number
struct switch_device_record_s * parent
const switch_state_handler_table_t * switch_channel_get_state_handler(switch_channel_t *channel, int index)
Retrieve an state handler tablefrom a given channel at given index level.
void switch_channel_variable_last(switch_channel_t *channel)
Stop iterating over channel variables.
void switch_channel_set_originatee_caller_profile(switch_channel_t *channel, switch_caller_profile_t *caller_profile)
Set the given channel's originatee caller profile.
switch_device_record_t * switch_channel_get_device_record(switch_channel_t *channel)
switch_mutex_t * dtmf_mutex
#define switch_core_hash_insert(_h, _k, _d)
static struct switch_device_state_table DEVICE_STATE_CHART[]
#define switch_core_session_locate(uuid_str)
Locate a session based on it's uuid.
int switch_channel_state_change_pending(switch_channel_t *channel)
switch_channel_state_t state
struct switch_caller_profile * hunt_caller_profile
#define SWITCH_B_SDP_VARIABLE
switch_call_cause_t switch_channel_get_cause_q850(switch_channel_t *channel)
#define switch_event_create(event, id)
Create a new event assuming it will not be custom event and therefore hiding the unused parameters...
switch_status_t switch_ivr_parse_signal_data(switch_core_session_t *session, switch_bool_t all, switch_bool_t only_session_thread)
uint32_t switch_channel_del_variable_prefix(switch_channel_t *channel, const char *prefix)
#define SWITCH_TEMP_HOLD_MUSIC_VARIABLE
#define switch_event_get_header(_e, _h)
#define switch_channel_set_flag(_c, _f)
switch_status_t switch_channel_set_name(switch_channel_t *channel, const char *name)
Assign a name to a given channel.
#define SWITCH_CHANNEL_NAME_VARIABLE
switch_call_cause_t cause
struct device_uuid_node_s * uuid_list
switch_call_direction_t switch_channel_direction(switch_channel_t *channel)
switch_app_log_t * switch_core_session_get_app_log(_In_ switch_core_session_t *session)
switch_mutex_t * thread_mutex
switch_call_cause_t switch_channel_cause_q850(switch_call_cause_t cause)
switch_status_t switch_queue_trypush(switch_queue_t *queue, void *data)
struct switch_channel_timetable * times
static void careful_set(switch_channel_t *channel, switch_channel_state_t *state, switch_channel_state_t val)
switch_caller_profile_t * switch_caller_profile_dup(_In_ switch_memory_pool_t *pool, _In_ switch_caller_profile_t *tocopy)
Duplicate an existing caller profile object.
char * switch_channel_build_param_string(switch_channel_t *channel, switch_caller_profile_t *caller_profile, const char *prefix)
#define SWITCH_CHANNEL_EXECUTE_ON_PRE_ANSWER_VARIABLE
const char * caller_id_number
switch_mutex_t * device_mutex
int switch_channel_add_state_handler(switch_channel_t *channel, const switch_state_handler_table_t *state_handler)
add a state handler table to a given channel
#define switch_core_session_alloc(_session, _memory)
Allocate memory from a session's pool.
switch_stack_t
Expression of how to stack a list.
#define switch_test_flag(obj, flag)
Test for the existance of a flag on an arbitary object.
switch_dtmf_source_t source
void switch_channel_clear_flag_recursive(switch_channel_t *channel, switch_channel_flag_t flag)
void switch_log_printf(_In_ switch_text_channel_t channel, _In_z_ const char *file, _In_z_ const char *func, _In_ int line, _In_opt_z_ const char *userdata, _In_ switch_log_level_t level, _In_z_ _Printf_format_string_ const char *fmt,...) PRINTF_FUNCTION(7
Write log data to the logging engine.
A table of settings and callbacks that define a paticular implementation of a codec.
void(* switch_device_state_function_t)(switch_core_session_t *session, switch_channel_callstate_t callstate, switch_device_record_t *drec)
unsigned int switch_core_session_started(_In_ switch_core_session_t *session)
switch_device_node_t * device_node
switch_channel_callstate_t switch_channel_get_callstate(switch_channel_t *channel)
switch_channel_state_t switch_channel_name_state(const char *name)
switch_status_t switch_ivr_transfer_recordings(switch_core_session_t *orig_session, switch_core_session_t *new_session)
switch_hold_record_t * hold_record
switch_device_stats_t last_stats
switch_caller_profile_t * switch_channel_get_origination_caller_profile(switch_channel_t *channel)
Retrieve the given channel's origination caller profile.
struct fspr_pool_t switch_memory_pool_t
#define switch_channel_up_nosig(_channel)
switch_status_t switch_channel_perform_ring_ready_value(switch_channel_t *channel, switch_ring_ready_t rv, const char *file, const char *func, int line)
#define SWITCH_CHANNEL_API_ON_MEDIA_VARIABLE
switch_status_t switch_queue_create(switch_queue_t **queue, unsigned int queue_capacity, switch_memory_pool_t *pool)
#define switch_core_session_strdup(_session, _todup)
Copy a string using memory allocation from a session's pool.
switch_hold_record_t * switch_channel_get_hold_record(switch_channel_t *channel)
void switch_event_destroy(switch_event_t **event)
Destroy an event.
switch_channel_callstate_t callstate
switch_time_t last_call_time
switch_status_t switch_channel_try_dtmf_lock(switch_channel_t *channel)
void switch_channel_set_direction(switch_channel_t *channel, switch_call_direction_t direction)
switch_caller_extension_t * switch_channel_get_queued_extension(switch_channel_t *channel)
switch_status_t switch_channel_get_log_tags(switch_channel_t *channel, switch_event_t **log_tags)
int32_t switch_core_session_ctl(switch_session_ctl_t cmd, void *val)
send a control message to the core
switch_status_t switch_channel_wait_for_flag(switch_channel_t *channel, switch_channel_flag_t want_flag, switch_bool_t pres, uint32_t to, switch_channel_t *super_channel)
void switch_channel_clear_flag(switch_channel_t *channel, switch_channel_flag_t flag)
Clear given flag(s) from a channel.
int switch_channel_test_app_flag_key(const char *key, switch_channel_t *channel, uint32_t flags)
char * switch_core_sprintf(_In_ switch_memory_pool_t *pool, _In_z_ _Printf_format_string_ const char *fmt,...)
printf-style style printing routine. The data is output to a string allocated from the pool ...
void switch_channel_transfer_to_extension(switch_channel_t *channel, switch_caller_extension_t *caller_extension)
uint8_t state_flags[CF_FLAG_MAX]
#define switch_channel_set_variable(_channel, _var, _val)
switch_time_t switch_time_now(void)
switch_status_t switch_channel_init(switch_channel_t *channel, switch_core_session_t *session, switch_channel_state_t state, switch_channel_flag_t flag)
Connect a newly allocated channel to a session object and setup it's initial state.
switch_status_t switch_ivr_generate_xml_cdr(switch_core_session_t *session, switch_xml_t *xml_cdr)
Generate an XML CDR report.
switch_caller_profile_t * switch_channel_get_caller_profile(switch_channel_t *channel)
Retrieve the given channel's caller profile.
switch_hash_t * device_hash
#define switch_core_session_kill_channel(session, sig)
Send a signal to a channel.
void switch_channel_release_device_record(switch_device_record_t **drecp)
char * switch_channel_get_name(switch_channel_t *channel)
Retrieve the name of a given channel.
switch_core_session_t * session
switch_status_t switch_channel_pass_callee_id(switch_channel_t *channel, switch_channel_t *other_channel)
switch_event_t * var_list
SWITCH_BEGIN_EXTERN_C char * switch_mprintf(const char *zFormat,...)
switch_status_t switch_channel_state_thread_trylock(switch_channel_t *channel)
#define switch_channel_media_up(_channel)
#define SWITCH_CHANNEL_API_ON_RING_VARIABLE
#define SWITCH_CHANNEL_CHANNEL_LOG(x)
const char * callee_id_name
switch_status_t switch_channel_execute_on_value(switch_channel_t *channel, const char *variable_value)
switch_status_t switch_channel_set_variable_strip_quotes_var_check(switch_channel_t *channel, const char *varname, const char *value, switch_bool_t var_check)
switch_bool_t switch_channel_clear_flag_partner(switch_channel_t *channel, switch_channel_flag_t flag)
Clears given flag(s) on a given channel's bridge partner.
switch_bool_t switch_core_session_in_thread(switch_core_session_t *session)
switch_call_cause_t hangup_cause
switch_memory_pool_t * switch_core_session_get_pool(_In_ switch_core_session_t *session)
Retrieve the memory pool from a session.
void switch_channel_perform_presence(switch_channel_t *channel, const char *rpid, const char *status, const char *id, const char *file, const char *func, int line)
Fire A presence event for the channel.
switch_status_t switch_channel_perform_mark_answered(switch_channel_t *channel, const char *file, const char *func, int line)
struct switch_device_state_binding_s * next
switch_event_header_t * headers
switch_status_t switch_channel_api_on(switch_channel_t *channel, const char *variable_prefix)
switch_status_t switch_channel_execute_on(switch_channel_t *channel, const char *variable_prefix)
struct switch_app_log * next
struct switch_caller_extension * caller_extension
switch_status_t switch_channel_dtmf_unlock(switch_channel_t *channel)
#define SWITCH_CHANNEL_API_ON_ANSWER_VARIABLE
switch_channel_callstate_t switch_channel_str2callstate(const char *str)
switch_status_t switch_core_session_thread_launch(_In_ switch_core_session_t *session)
Launch the session thread (state machine) on a given session.
switch_caller_profile_t * switch_channel_get_originator_caller_profile(switch_channel_t *channel)
Retrieve the given channel's originator caller profile.
switch_status_t switch_channel_set_timestamps(switch_channel_t *channel)
switch_memory_pool_t * pool
switch_status_t switch_channel_perform_acknowledge_call(switch_channel_t *channel, const char *file, const char *func, int line)
const char * switch_channel_cause2str(switch_call_cause_t cause)