freetdm: ss7 - CPC
This commit is contained in:
parent
95f2d6de0d
commit
32bf306af5
|
@ -1608,9 +1608,11 @@ ftdm_status_t ftdm_channel_from_event(ftdm_sigmsg_t *sigmsg, switch_core_session
|
|||
switch_channel_set_variable_printf(channel, "freetdm_chan_number", "%d", chanid);
|
||||
switch_channel_set_variable_printf(channel, "freetdm_bearer_capability", "%d", channel_caller_data->bearer_capability);
|
||||
switch_channel_set_variable_printf(channel, "freetdm_bearer_layer1", "%d", channel_caller_data->bearer_layer1);
|
||||
switch_channel_set_variable_printf(channel, "freetdm_calling_party_category", ftdm_calling_party_category2str(channel_caller_data->cpc));
|
||||
switch_channel_set_variable_printf(channel, "screening_ind", ftdm_screening2str(channel_caller_data->screen));
|
||||
switch_channel_set_variable_printf(channel, "presentation_ind", ftdm_presentation2str(channel_caller_data->pres));
|
||||
|
||||
|
||||
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);
|
||||
|
@ -1676,7 +1678,7 @@ ftdm_status_t ftdm_channel_from_event(ftdm_sigmsg_t *sigmsg, switch_core_session
|
|||
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-GN-NumInComp", "%d", var_value);
|
||||
}
|
||||
} /* End - var_value = ftdm_sigmsg_get_var(sigmsg, "ss7_gn_digits"); */
|
||||
|
||||
|
||||
var_value = ftdm_sigmsg_get_var(sigmsg, "freetdm_calling_party_category");
|
||||
if (!ftdm_strlen_zero(var_value)) {
|
||||
switch_channel_set_variable_printf(channel, "sip_h_X-FreeTDM-CPC", "%d", var_value);
|
||||
|
|
|
@ -462,28 +462,24 @@ ftdm_status_t copy_redirgNum_from_sngss7(ftdm_channel_t *ftdmchan, SiRedirNum *r
|
|||
|
||||
ftdm_status_t copy_cgPtyCat_to_sngss7(ftdm_channel_t *ftdmchan, SiCgPtyCat *cgPtyCat)
|
||||
{
|
||||
const char* val = NULL;
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
|
||||
cgPtyCat->eh.pres = PRSNT_NODEF;
|
||||
cgPtyCat->cgPtyCat.pres = PRSNT_NODEF;
|
||||
|
||||
val = ftdm_usrmsg_get_var(ftdmchan->usrmsg, "calling_party_category");
|
||||
if (!ftdm_strlen_zero(val)) {
|
||||
cgPtyCat->cgPtyCat.val = get_trillium_val(cpc_codes, ftdm_str2ftdm_calling_party_category(val), CAT_ORD);
|
||||
} else {
|
||||
cgPtyCat->cgPtyCat.val = CAT_ORD; /* ordinary suscriber */
|
||||
}
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Calling Party Category:0x%x\n", cgPtyCat->cgPtyCat.val);
|
||||
cgPtyCat->cgPtyCat.val = get_trillium_val(cpc_codes, caller_data->cpc, CAT_ORD);
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Calling Party Category:0x%x\n",cgPtyCat->cgPtyCat.val);
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t copy_cgPtyCat_from_sngss7(ftdm_channel_t *ftdmchan, SiCgPtyCat *cgPtyCat)
|
||||
{
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
|
||||
if (cgPtyCat->eh.pres == PRSNT_NODEF &&
|
||||
cgPtyCat->cgPtyCat.pres == PRSNT_NODEF) {
|
||||
|
||||
sngss7_add_var((sngss7_chan_data_t*)ftdmchan->call_data, "calling_party_category",
|
||||
ftdm_calling_party_category2str(get_ftdm_val(cpc_codes, cgPtyCat->cgPtyCat.val, FTDM_CPC_UNKNOWN)));
|
||||
|
||||
caller_data->cpc = get_ftdm_val(cpc_codes, cgPtyCat->cgPtyCat.val, FTDM_CPC_UNKNOWN);
|
||||
ftdm_log_chan(ftdmchan, FTDM_LOG_DEBUG, "Calling Party Category:0x%x\n", cgPtyCat->cgPtyCat.val);
|
||||
}
|
||||
return FTDM_SUCCESS;
|
||||
|
|
Loading…
Reference in New Issue