ftdm_channel_t *ftdmchan;
uint32_t write_error;
uint32_t read_error;
+ char network_peer_uuid[SWITCH_UUID_FORMATTED_LENGTH + 1];
+
};
/* private data attached to FTDM channels (only FXS for now) */
int argc = 0;
const char *var;
const char *dest_num = NULL, *callerid_num = NULL;
+ const char *network_peer_uuid = NULL;
ftdm_hunting_scheme_t hunting;
ftdm_usrmsg_t usrmsg;
if (session && globals.sip_headers) {
switch_channel_t *channel = switch_core_session_get_channel(session);
const char *sipvar;
+
+ network_peer_uuid = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-TransUUID");
+
sipvar = switch_channel_get_variable(channel, "sip_h_X-FreeTDM-CallerName");
if (sipvar) {
ftdm_set_string(caller_data.cid_name, sipvar);
goto fail;
}
+ if (network_peer_uuid) {
+ switch_core_session_t *network_peer = switch_core_session_locate(network_peer_uuid);
+ if (network_peer) {
+ const char *my_uuid = switch_core_session_get_uuid(*new_session);
+ private_t *peer_private = switch_core_session_get_private(network_peer);
+ switch_set_string(tech_pvt->network_peer_uuid, network_peer_uuid);
+ switch_set_string(peer_private->network_peer_uuid, my_uuid);
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Session %s is network-bridged with %s\n", my_uuid, network_peer_uuid);
+
+ switch_core_session_rwunlock(network_peer);
+ }
+ }
+
caller_profile = switch_caller_profile_clone(*new_session, outbound_profile);
caller_profile->destination_number = switch_core_strdup(caller_profile->pool, switch_str_nil(dest_num));
caller_profile->caller_id_number = switch_core_strdup(caller_profile->pool, switch_str_nil(callerid_num));
} else {
cause = SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
}
- goto fail;
+ goto fail;
}
return SWITCH_CAUSE_SUCCESS;
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-TransUUID", "%s",switch_core_session_get_uuid(session));
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 (sngss7_info->circuit->transparent_iam &&
sngss7_retrieve_iam(ftdmchan, &iam) == FTDM_SUCCESS) {
SS7_INFO_CHAN(ftdmchan,"[CIC:%d]Tx IAM (Transparent)\n", sngss7_info->circuit->cic);
+
+ /* Called Number information */
+ copy_cdPtyNum_to_sngss7(ftdmchan, &iam.cdPtyNum);
+
+ /* Redirecting Number */
+ copy_redirgNum_to_sngss7(ftdmchan, &iam.redirgNum);
+
+ /* Redirecting Information */
+ copy_redirgInfo_to_sngss7(ftdmchan, &iam.redirInfo);
} else {
/* Nature of Connection Indicators */
copy_natConInd_to_sngss7(ftdmchan, &iam.natConInd);