switch_mutex_t *mutex;
analog_option_t analog_options;
switch_hash_t *ss7_configs;
+ int sip_headers;
} globals;
/* private data attached to each fs session */
switch_channel_set_variable(channel, "freetdm_span_name", ftdm_channel_get_span_name(sigmsg->channel));
switch_channel_set_variable_printf(channel, "freetdm_span_number", "%d", spanid);
switch_channel_set_variable_printf(channel, "freetdm_chan_number", "%d", chanid);
+ if (globals.sip_headers) {
+ switch_channel_set_variable(channel, "sip_h_X-FreeTDM-SpanName", ftdm_channel_get_span_name(sigmsg->channel));
+ switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-SpanNumber", "%d", spanid);
+ switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-ChanNumber", "%d", chanid);
+ }
if (channel_caller_data->raw_data_len) {
switch_channel_set_variable_printf(channel, "freetdm_custom_call_data", "%s", channel_caller_data->raw_data);
}
globals.debug = atoi(val);
} else if (!strcasecmp(var, "hold-music")) {
switch_set_string(globals.hold_music, val);
+ } else if (!strcasecmp(var, "sip-headers")) {
+ globals.sip_headers = switch_true(val);
} else if (!strcasecmp(var, "enable-analog-option")) {
globals.analog_options = enable_analog_option(val, globals.analog_options);
}