Add support to enable/disable facility IE Supplementary Services

git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@217 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Matthew Fredrickson 2005-05-12 14:48:00 +00:00
parent 3803535593
commit 8205ce358a
4 changed files with 20 additions and 0 deletions

View File

@ -411,6 +411,10 @@ extern void pri_set_debug(struct pri *pri, int debug);
/* Get debug parameters on PRI -- see above debug definitions */ /* Get debug parameters on PRI -- see above debug definitions */
extern int pri_get_debug(struct pri *pri); extern int pri_get_debug(struct pri *pri);
#define PRI_FACILITY_ENABLE
/* Enable transmission support of Facility IEs on the pri */
extern void pri_facility_enable(struct pri *pri);
/* Run PRI on the given D-channel, taking care of any events that /* Run PRI on the given D-channel, taking care of any events that
need to be handled. If block is set, it will block until an event need to be handled. If block is set, it will block until an event
occurs which needs to be handled */ occurs which needs to be handled */

10
pri.c
View File

@ -400,6 +400,16 @@ int pri_get_debug(struct pri *pri)
return pri->debug; return pri->debug;
} }
void pri_facility_enable(struct pri *pri)
{
if (!pri)
return;
pri->sendfacility = 1;
if (pri->subchannel)
pri_facility_enable(pri->subchannel);
return;
}
int pri_acknowledge(struct pri *pri, q931_call *call, int channel, int info) int pri_acknowledge(struct pri *pri, q931_call *call, int channel, int info)
{ {
if (!pri || !call) if (!pri || !call)

View File

@ -1237,8 +1237,13 @@ extern int pri_call_apdu_queue_cleanup(q931_call *call)
extern int pri_call_add_standard_apdus(struct pri *pri, q931_call *call) extern int pri_call_add_standard_apdus(struct pri *pri, q931_call *call)
{ {
if (!pri->sendfacility)
return 0;
if (pri->switchtype == PRI_SWITCH_QSIG) { /* For Q.SIG it does network and cpe operations */ if (pri->switchtype == PRI_SWITCH_QSIG) { /* For Q.SIG it does network and cpe operations */
/* FIXME: Presumably, it should only send on a redirect */
rose_diverting_leg_information2_encode(pri, call); rose_diverting_leg_information2_encode(pri, call);
add_callername_facility_ies(pri, call, 1);
} }
if (pri->localtype == PRI_NETWORK) { if (pri->localtype == PRI_NETWORK) {

View File

@ -108,6 +108,7 @@ struct pri {
#endif #endif
unsigned char last_invoke; /* Last ROSE invoke ID */ unsigned char last_invoke; /* Last ROSE invoke ID */
unsigned char sendfacility;
}; };
struct pri_sr { struct pri_sr {