From 0127e9bf47bddd6d9945da623b309ce47e4f9ab2 Mon Sep 17 00:00:00 2001 From: Matteo Brancaleoni Date: Mon, 8 Jun 2015 14:37:16 +0200 Subject: [PATCH] FS-7620 Correctly set calling number presentation and screening fields. --- .../src/ftmod/ftmod_libpri/ftmod_libpri.c | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c index a57d892627..e1fbc40fb6 100644 --- a/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c +++ b/libs/freetdm/src/ftmod/ftmod_libpri/ftmod_libpri.c @@ -1915,6 +1915,38 @@ static int on_ring(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_event ftdm_set_string(caller_data->dnis.digits, (char *)pevent->ring.callednum); ftdm_set_string(caller_data->rdnis.digits, (char *)pevent->ring.redirectingnum); + if (pevent->ring.callingpres == PRES_ALLOWED_USER_NUMBER_NOT_SCREENED) { + caller_data->pres = FTDM_PRES_ALLOWED; + caller_data->screen = FTDM_SCREENING_NOT_SCREENED; + } else if (pevent->ring.callingpres == PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN) { + caller_data->pres = FTDM_PRES_ALLOWED; + caller_data->screen = FTDM_SCREENING_VERIFIED_PASSED; + } else if (pevent->ring.callingpres == PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN) { + caller_data->pres = FTDM_PRES_ALLOWED; + caller_data->screen = FTDM_SCREENING_VERIFIED_FAILED; + } else if (pevent->ring.callingpres == PRES_ALLOWED_NETWORK_NUMBER) { + caller_data->pres = FTDM_PRES_ALLOWED; + caller_data->screen = FTDM_SCREENING_NETWORK_PROVIDED; + } else if (pevent->ring.callingpres == PRES_PROHIB_USER_NUMBER_NOT_SCREENED) { + caller_data->pres = FTDM_PRES_RESTRICTED; + caller_data->screen = FTDM_SCREENING_NOT_SCREENED; + } else if (pevent->ring.callingpres == PRES_PROHIB_USER_NUMBER_PASSED_SCREEN) { + caller_data->pres = FTDM_PRES_RESTRICTED; + caller_data->screen = FTDM_SCREENING_VERIFIED_PASSED; + } else if (pevent->ring.callingpres == PRES_PROHIB_USER_NUMBER_FAILED_SCREEN) { + caller_data->pres = FTDM_PRES_RESTRICTED; + caller_data->screen = FTDM_SCREENING_VERIFIED_FAILED; + } else if (pevent->ring.callingpres == PRES_PROHIB_NETWORK_NUMBER) { + caller_data->pres = FTDM_PRES_RESTRICTED; + caller_data->screen = FTDM_SCREENING_NETWORK_PROVIDED; + } else if (pevent->ring.callingpres == PRES_NUMBER_NOT_AVAILABLE) { + caller_data->pres = FTDM_PRES_NOT_AVAILABLE; + caller_data->screen = FTDM_SCREENING_NETWORK_PROVIDED; + } else { + caller_data->pres = FTDM_PRES_INVALID; + caller_data->screen = FTDM_SCREENING_INVALID; + } + if (pevent->ring.callingplanani != -1) { caller_data->ani.type = pevent->ring.callingplanani >> 4; caller_data->ani.plan = pevent->ring.callingplanani & 0x0F;