freetdm: ss7 - added support for NADI value in sip x-headers
This commit is contained in:
parent
5812c5fd53
commit
0ee84ea57b
|
@ -82,6 +82,9 @@ ftdm_status_t handle_con_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circ
|
|||
|
||||
sngss7_chan_data_t *sngss7_info = NULL;
|
||||
ftdm_channel_t *ftdmchan = NULL;
|
||||
char nadi[2];
|
||||
|
||||
memset(nadi, '\0', sizeof(nadi));
|
||||
|
||||
/* get the ftdmchan and ss7_chan_data from the circuit */
|
||||
if (extract_chan_data(circuit, &sngss7_info, &ftdmchan)) {
|
||||
|
@ -212,7 +215,8 @@ ftdm_status_t handle_con_ind(uint32_t suInstId, uint32_t spInstId, uint32_t circ
|
|||
}
|
||||
|
||||
/* add any special variables for the dialplan */
|
||||
/*ftdm_channel_add_var(ftdmchan, "ss7_stuff", "s");*/
|
||||
sprintf(nadi, "%d", siConEvnt->cgPtyNum.natAddrInd.val);
|
||||
ftdm_channel_add_var(ftdmchan, "ss7_nadi", nadi);
|
||||
|
||||
/* set the state of the channel to collecting...the rest is done by the chan monitor */
|
||||
ftdm_set_state_locked(ftdmchan, FTDM_CHANNEL_STATE_COLLECT);
|
||||
|
|
|
@ -73,8 +73,9 @@ void ft_to_sngss7_iam (ftdm_channel_t * ftdmchan)
|
|||
{
|
||||
SS7_FUNC_TRACE_ENTER (__FUNCTION__);
|
||||
|
||||
sngss7_chan_data_t *sngss7_info = ftdmchan->call_data;;
|
||||
SiConEvnt iam;
|
||||
sngss7_chan_data_t *sngss7_info = ftdmchan->call_data;;
|
||||
const char *nadi = NULL;
|
||||
SiConEvnt iam;
|
||||
|
||||
sngss7_info->suInstId = get_unique_id ();
|
||||
sngss7_info->spInstId = 0;
|
||||
|
@ -179,7 +180,17 @@ void ft_to_sngss7_iam (ftdm_channel_t * ftdmchan)
|
|||
|
||||
/* copy down the calling number information */
|
||||
copy_cgPtyNum_to_sngss7 (&ftdmchan->caller_data, &iam.cgPtyNum);
|
||||
|
||||
|
||||
/* check if the user would like a custom NADI value for the calling Pty Num */
|
||||
nadi = ftdm_channel_get_var(ftdmchan, "ss7_nadi");
|
||||
if ((nadi != NULL) && (nadi != "")) {
|
||||
SS7_DEBUG_CHAN(ftdmchan,"Found user supplied NADI value \"%s\"\n", nadi);
|
||||
iam.cgPtyNum.natAddrInd.val = atoi(nadi);
|
||||
} else {
|
||||
SS7_DEBUG_CHAN(ftdmchan,"No user supplied NADI value found, using \"3\" %s\n", " ");
|
||||
iam.cgPtyNum.natAddrInd.val = 0x03;
|
||||
}
|
||||
|
||||
sng_cc_con_request (sngss7_info->spId,
|
||||
sngss7_info->suInstId,
|
||||
sngss7_info->spInstId,
|
||||
|
|
Loading…
Reference in New Issue