New signaling module to handle PRI/BRI operations in chan_dahdi

This merge splits the PRI/BRI signaling logic out of chan_dahdi.c into
sig_pri.c. Functionality in theory should not change (mostly). A few trivial
changes were made in sig_analog with verbose messages and commenting.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
certified/1.8.6
Jeff Peeler 16 years ago
parent afa8db54a0
commit 5c7da226e4

@ -69,7 +69,7 @@ dist-clean::
rm -f h323/Makefile
$(if $(filter chan_iax2,$(EMBEDDED_MODS)),modules.link,chan_iax2.so): iax2-parser.o iax2-provision.o
$(if $(filter chan_dahdi,$(EMBEDDED_MODS)),modules.link,chan_dahdi.so): sig_analog.o
$(if $(filter chan_dahdi,$(EMBEDDED_MODS)),modules.link,chan_dahdi.so): sig_analog.o sig_pri.o
ifneq ($(filter chan_h323,$(EMBEDDED_MODS)),)
modules.link: h323/libchanh323.a

File diff suppressed because it is too large Load Diff

@ -774,12 +774,11 @@ int analog_call(struct analog_pvt *p, struct ast_channel *ast, char *rdest, int
p->lastcid_name[0] = '\0';
if (p->use_callerid) {
//p->callwaitcas = 0;
p->callwaitcas = 0;
p->cid.cid_name = p->lastcid_name;
p->cid.cid_num = p->lastcid_num;
}
ast_setstate(ast, AST_STATE_RINGING);
index = analog_get_index(ast, p, 0);
if (index > -1) {
@ -1087,9 +1086,7 @@ int analog_hangup(struct analog_pvt *p, struct ast_channel *ast)
analog_stop_callwait(p);
ast->tech_pvt = NULL;
if (option_verbose > 2) {
ast_verbose(VERBOSE_PREFIX_3 "Hanging up on '%s'\n", ast->name);
}
ast_verb(3, "Hanging up on '%s'\n", ast->name);
return 0;
}
@ -1557,8 +1554,7 @@ static void *__analog_ss_thread(void *data)
}
goto quit;
} else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_2 "Unknown extension '%s' in context '%s' requested\n", exten, chan->context);
ast_verb(3, "Unknown extension '%s' in context '%s' requested\n", exten, chan->context);
sleep(2);
res = analog_play_tone(p, index, ANALOG_TONE_INFO);
if (res < 0)
@ -1608,8 +1604,7 @@ static void *__analog_ss_thread(void *data)
if (getforward) {
/* Record this as the forwarding extension */
ast_copy_string(p->call_forward, exten, sizeof(p->call_forward));
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Setting call forward to '%s' on channel %d\n", p->call_forward, p->channel);
ast_verb(3, "Setting call forward to '%s' on channel %d\n", p->call_forward, p->channel);
res = analog_play_tone(p, index, ANALOG_TONE_DIALRECALL);
if (res)
break;
@ -1654,8 +1649,7 @@ static void *__analog_ss_thread(void *data)
ast_hangup(chan);
goto quit;
} else if (p->callwaiting && !strcmp(exten, "*70")) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Disabling call waiting on %s\n", chan->name);
ast_verb(3, "Disabling call waiting on %s\n", chan->name);
/* Disable call waiting if enabled */
p->callwaiting = 0;
res = analog_play_tone(p, index, ANALOG_TONE_DIALRECALL);
@ -1695,8 +1689,7 @@ static void *__analog_ss_thread(void *data)
goto quit;
}
} else if (!p->hidecallerid && !strcmp(exten, "*67")) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Disabling Caller*ID on %s\n", chan->name);
ast_verb(3, "Disabling Caller*ID on %s\n", chan->name);
/* Disable Caller*ID if enabled */
p->hidecallerid = 1;
if (chan->cid.cid_num)
@ -1723,13 +1716,10 @@ static void *__analog_ss_thread(void *data)
break;
} else if (!strcmp(exten, "*78")) {
/* Do not disturb */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Enabled DND on channel %d\n", p->channel);
#if 0
ast_verb(3, "Enabled DND on channel %d\n", p->channel);
manager_event(EVENT_FLAG_SYSTEM, "DNDState",
"Channel: %s/%d\r\n"
"Status: enabled\r\n", dahdi_chan_name, p->channel);
#endif
"Channel: DAHDI/%d\r\n"
"Status: enabled\r\n", p->channel);
res = analog_play_tone(p, index, ANALOG_TONE_DIALRECALL);
p->dnd = 1;
getforward = 0;
@ -1737,13 +1727,10 @@ static void *__analog_ss_thread(void *data)
len = 0;
} else if (!strcmp(exten, "*79")) {
/* Do not disturb */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Disabled DND on channel %d\n", p->channel);
#if 0
ast_verb(3, "Disabled DND on channel %d\n", p->channel);
manager_event(EVENT_FLAG_SYSTEM, "DNDState",
"Channel: %s/%d\r\n"
"Status: disabled\r\n", dahdi_chan_name, p->channel);
#endif
"Channel: DAHDI/%d\r\n"
"Status: disabled\r\n", p->channel);
res = analog_play_tone(p, index, ANALOG_TONE_DIALRECALL);
p->dnd = 0;
getforward = 0;
@ -1755,8 +1742,7 @@ static void *__analog_ss_thread(void *data)
memset(exten, 0, sizeof(exten));
len = 0;
} else if (p->cancallforward && !strcmp(exten, "*73")) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Cancelling call forwarding on channel %d\n", p->channel);
ast_verb(3, "Cancelling call forwarding on channel %d\n", p->channel);
res = analog_play_tone(p, index, ANALOG_TONE_DIALRECALL);
memset(p->call_forward, 0, sizeof(p->call_forward));
getforward = 0;
@ -1768,12 +1754,10 @@ static void *__analog_ss_thread(void *data)
/* This is a three way call, the main call being a real channel,
and we're parking the first call. */
ast_masq_park_call(ast_bridged_channel(p->subs[ANALOG_SUB_THREEWAY].owner), chan, 0, NULL);
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Parking call to '%s'\n", chan->name);
ast_verb(3, "Parking call to '%s'\n", chan->name);
break;
} else if (!ast_strlen_zero(p->lastcid_num) && !strcmp(exten, "*60")) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Blacklisting number %s\n", p->lastcid_num);
ast_verb(3, "Blacklisting number %s\n", p->lastcid_num);
res = ast_db_put("blacklist", p->lastcid_num, "1");
if (!res) {
res = analog_play_tone(p, index, ANALOG_TONE_DIALRECALL);
@ -1781,8 +1765,7 @@ static void *__analog_ss_thread(void *data)
len = 0;
}
} else if (p->hidecallerid && !strcmp(exten, "*82")) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Enabling Caller*ID on %s\n", chan->name);
ast_verb(3, "Enabling Caller*ID on %s\n", chan->name);
/* Enable Caller*ID if enabled */
p->hidecallerid = 0;
if (chan->cid.cid_num)
@ -2241,8 +2224,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
switch (res) {
#ifdef ANALOG_EVENT_EC_DISABLED
case ANALOG_EVENT_EC_DISABLED:
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Channel %d echo canceler disabled due to CED detection\n", p->channel);
ast_verb(3, "Channel %d echo canceler disabled due to CED detection\n", p->channel);
p->echocanon = 0;
break;
#endif
@ -2310,8 +2292,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
if (p->subs[ANALOG_SUB_CALLWAIT].owner) {
/* There's a call waiting call, so ring the phone, but make it unowned in the mean time */
analog_swap_subs(p, ANALOG_SUB_CALLWAIT, ANALOG_SUB_REAL);
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Channel %d still has (callwait) call, ringing phone\n", p->channel);
ast_verb(3, "Channel %d still has (callwait) call, ringing phone\n", p->channel);
analog_unalloc_sub(p, ANALOG_SUB_CALLWAIT);
analog_stop_callwait(p);
p->owner = NULL;
@ -2680,8 +2661,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
if (p->subs[ANALOG_SUB_THREEWAY].owner->cdr)
cdr3way = 1;
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Started three way call on channel %d\n", p->channel);
ast_verb(3, "Started three way call on channel %d\n", p->channel);
/* Start music on hold if appropriate */
if (ast_bridged_channel(p->subs[ANALOG_SUB_THREEWAY].owner)) {
ast_queue_control_data(p->subs[ANALOG_SUB_THREEWAY].owner, AST_CONTROL_HOLD,
@ -2703,8 +2683,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
p->owner = p->subs[ANALOG_SUB_REAL].owner;
}
/* Drop the last call and stop the conference */
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Dropping three-way call on %s\n", p->subs[ANALOG_SUB_THREEWAY].owner->name);
ast_verb(3, "Dropping three-way call on %s\n", p->subs[ANALOG_SUB_THREEWAY].owner->name);
ast_softhangup_nolock(p->subs[ANALOG_SUB_THREEWAY].owner, AST_SOFTHANGUP_DEV);
p->subs[ANALOG_SUB_REAL].inthreeway = 0;
p->subs[ANALOG_SUB_THREEWAY].inthreeway = 0;
@ -2724,8 +2703,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
if (p->subs[ANALOG_SUB_THREEWAY].owner->cdr)
cdr3way = 1;
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Building conference on call on %s and %s\n", p->subs[ANALOG_SUB_THREEWAY].owner->name, p->subs[ANALOG_SUB_REAL].owner->name);
ast_verb(3, "Building conference on call on %s and %s\n", p->subs[ANALOG_SUB_THREEWAY].owner->name, p->subs[ANALOG_SUB_REAL].owner->name);
/* Put them in the threeway, and flip */
p->subs[ANALOG_SUB_THREEWAY].inthreeway = 1;
p->subs[ANALOG_SUB_REAL].inthreeway = 1;
@ -2742,8 +2720,7 @@ static struct ast_frame *__analog_handle_event(struct analog_pvt *p, struct ast_
analog_play_tone(p, ANALOG_SUB_THREEWAY, ANALOG_TONE_RINGTONE);
}
} else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Dumping incomplete call on on %s\n", p->subs[ANALOG_SUB_THREEWAY].owner->name);
ast_verb(3, "Dumping incomplete call on on %s\n", p->subs[ANALOG_SUB_THREEWAY].owner->name);
analog_swap_subs(p, ANALOG_SUB_THREEWAY, ANALOG_SUB_REAL);
ast_softhangup_nolock(p->subs[ANALOG_SUB_THREEWAY].owner, AST_SOFTHANGUP_DEV);
p->owner = p->subs[ANALOG_SUB_REAL].owner;
@ -2938,8 +2915,7 @@ struct ast_frame *analog_exception(struct analog_pvt *p, struct ast_channel *ast
case ANALOG_EVENT_ONHOOK:
analog_set_echocanceller(p, 0);
if (p->owner) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Channel %s still has call, ringing phone\n", p->owner->name);
ast_verb(3, "Channel %s still has call, ringing phone\n", p->owner->name);
analog_ring(p);
analog_stop_callwait(p);
} else
@ -2962,8 +2938,7 @@ struct ast_frame *analog_exception(struct analog_pvt *p, struct ast_channel *ast
case ANALOG_EVENT_WINKFLASH:
gettimeofday(&p->flashtime, NULL);
if (p->owner) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Channel %d flashed to other channel %s\n", p->channel, p->owner->name);
ast_verb(3, "Channel %d flashed to other channel %s\n", p->channel, p->owner->name);
if (p->owner->_state != AST_STATE_UP) {
/* Answer if necessary */
usedindex = analog_get_index(p->owner, p, 0);

@ -248,12 +248,12 @@ struct analog_pvt {
/* XXX: All variables after this are internal */
unsigned int callwaiting:1;
unsigned int dialednone:1;
unsigned int dialing:1;
unsigned int dialing:1; /*!< TRUE if in the process of dialing digits or sending something */
unsigned int dnd:1;
unsigned int echobreak:1;
unsigned int hidecallerid:1;
unsigned int outgoing:1;
unsigned int pulsedial:1; /*!< whether a pulse dial phone is detected */
unsigned int pulsedial:1; /*!< TRUE if a pulsed digit was detected. (Pulse dial phone detected) */
char callwait_num[AST_MAX_EXTENSION];
char callwait_name[AST_MAX_EXTENSION];
@ -277,13 +277,13 @@ struct analog_pvt {
void *ss_astchan;
/* All variables after this are definitely going to be audited */
unsigned int inalarm:1; //
unsigned int unknown_alarm:1;//
unsigned int inalarm:1;
unsigned int unknown_alarm:1;
int callwaitcas;
#if 0
int ringt; //
int ringt;
int ringt_base;
#endif
};

File diff suppressed because it is too large Load Diff

@ -0,0 +1,257 @@
#ifndef _SIG_PRI_H
#define _SIG_PRI_H
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 1999 - 2009, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
/*! \file
*
* \brief Interface header for PRI signaling module
*
* \author Matthew Fredrickson <creslin@digium.com>
*/
#include "asterisk/channel.h"
#include "asterisk/frame.h"
#include <libpri.h>
#include <dahdi/user.h>
enum sig_pri_tone {
SIG_PRI_TONE_RINGTONE = 0,
SIG_PRI_TONE_STUTTER,
SIG_PRI_TONE_CONGESTION,
SIG_PRI_TONE_DIALTONE,
SIG_PRI_TONE_DIALRECALL,
SIG_PRI_TONE_INFO,
SIG_PRI_TONE_BUSY,
};
enum sig_pri_law {
SIG_PRI_DEFLAW = 0,
SIG_PRI_ULAW,
SIG_PRI_ALAW
};
struct sig_pri_pri;
struct sig_pri_callback {
/* Unlock the private in the signalling private structure. This is used for three way calling madness. */
void (* const unlock_private)(void *pvt);
/* Lock the private in the signalling private structure. ... */
void (* const lock_private)(void *pvt);
/* Function which is called back to handle any other DTMF up events that are received. Called by analog_handle_event. Why is this
* important to use, instead of just directly using events received before they are passed into the library? Because sometimes,
* (CWCID) the library absorbs DTMF events received. */
//void (* const handle_dtmfup)(void *pvt, struct ast_channel *ast, enum analog_sub analog_index, struct ast_frame **dest);
//int (* const dial_digits)(void *pvt, enum analog_sub sub, struct analog_dialoperation *dop);
int (* const play_tone)(void *pvt, enum sig_pri_tone tone);
int (* const set_echocanceller)(void *pvt, int enable);
int (* const train_echocanceller)(void *pvt);
struct ast_channel * (* const new_ast_channel)(void *pvt, int state, int startpbx, enum sig_pri_law law, int transfercapability, char *exten);
void (* const fixup_chans)(void *old_chan, void *new_chan);
/* Note: Called with PRI lock held */
void (* const handle_dchan_exception)(struct sig_pri_pri *pri, int index);
};
#define NUM_DCHANS 4 /*!< No more than 4 d-channels */
#define MAX_CHANNELS 672 /*!< No more than a DS3 per trunk group */
#define SIG_PRI DAHDI_SIG_CLEAR
#define SIG_BRI (0x2000000 | DAHDI_SIG_CLEAR)
#define SIG_BRI_PTMP (0X4000000 | DAHDI_SIG_CLEAR)
/* Overlap dialing option types */
#define DAHDI_OVERLAPDIAL_NONE 0
#define DAHDI_OVERLAPDIAL_OUTGOING 1
#define DAHDI_OVERLAPDIAL_INCOMING 2
#define DAHDI_OVERLAPDIAL_BOTH (DAHDI_OVERLAPDIAL_INCOMING|DAHDI_OVERLAPDIAL_OUTGOING)
#ifdef HAVE_PRI_SERVICE_MESSAGES
/*! \brief Persistent Service State */
#define SRVST_DBKEY "service-state"
/*! \brief The out-of-service SERVICE state */
#define SRVST_TYPE_OOS "O"
/*! \brief SRVST_INITIALIZED is used to indicate a channel being out-of-service
* The SRVST_INITIALIZED is mostly used maintain backwards compatibility but also may
* mean that the channel has not yet received a RESTART message. If a channel is
* out-of-service with this reason a RESTART message will result in the channel
* being put into service. */
#define SRVST_INITIALIZED 0
/*! \brief SRVST_NEAREND is used to indicate that the near end was put out-of-service */
#define SRVST_NEAREND (1 << 0)
/*! \brief SRVST_FAREND is used to indicate that the far end was taken out-of-service */
#define SRVST_FAREND (1 << 1)
/*! \brief SRVST_BOTH is used to indicate that both sides of the channel are out-of-service */
#define SRVST_BOTH (SRVST_NEAREND | SRVST_FAREND)
/*! \brief The AstDB family */
static const char dahdi_db[] = "dahdi/registry";
#endif
struct sig_pri_chan {
/* Options to be set by user */
unsigned int hidecallerid:1;
unsigned int hidecalleridname:1; /*!< Hide just the name not the number for legacy PBX use */
unsigned int immediate:1; /*!< Answer before getting digits? */
unsigned int inalarm:1;
unsigned int priexclusive:1; /*!< Whether or not to override and use exculsive mode for channel selection */
unsigned int priindication_oob:1;
unsigned int use_callerid:1; /*!< Whether or not to use caller id on this channel */
unsigned int use_callingpres:1; /*!< Whether to use the callingpres the calling switch sends */
char context[AST_MAX_CONTEXT];
int channel; /*!< Channel Number or CRV */
char mohinterpret[MAX_MUSICCLASS];
int stripmsd;
/* Options to be checked by user */
int cid_ani2; /*!< Automatic Number Identification number (Alternate PRI caller ID number) */
char cid_num[AST_MAX_EXTENSION];
int cid_ton; /*!< Type Of Number (TON) */
char cid_name[AST_MAX_EXTENSION];
char cid_ani[AST_MAX_EXTENSION];
char rdnis[AST_MAX_EXTENSION];
char dnid[AST_MAX_EXTENSION];
char exten[AST_MAX_EXTENSION];
int callingpres; /*!< The value of callling presentation that we're going to use when placing a PRI call */
char lastcid_num[AST_MAX_EXTENSION];
char lastcid_name[AST_MAX_EXTENSION];
/* Internal variables -- Don't touch */
/* Probably will need DS0 number, DS1 number, and a few other things */
char dialdest[256]; /* Queued up digits for overlap dialing. They will be sent out as information messages when setup ACK is received */
int mastertrunkgroup;
unsigned int alerting:1; /*!< TRUE if channel is alerting/ringing */
unsigned int alreadyhungup:1; /*!< TRUE if the call has already gone/hungup */
unsigned int isidlecall:1; /*!< TRUE if this is an idle call */
unsigned int proceeding:1; /*!< TRUE if call is in a proceeding state */
unsigned int progress:1; /*!< TRUE if the call has seen progress through the network */
unsigned int resetting:1; /*!< TRUE if this channel is being reset/restarted */
unsigned int setup_ack:1; /*!< TRUE if this channel has received a SETUP_ACKNOWLEDGE */
unsigned int outgoing:1;
unsigned int digital:1;
struct ast_channel *owner;
struct sig_pri_pri *pri;
q931_call *call; /*!< opaque libpri call control structure */
int prioffset; /*!< channel number in span */
int logicalspan; /*!< logical span number within trunk group */
struct sig_pri_callback *calls;
void *chan_pvt;
ast_mutex_t service_lock; /*!< Mutex for service messages */
};
struct sig_pri_pri {
/* Should be set by user */
int pritimers[PRI_MAX_TIMERS];
int overlapdial; /*!< In overlap dialing mode */
int qsigchannelmapping; /*!< QSIG channel mapping type */
int discardremoteholdretrieval; /*!< shall remote hold or remote retrieval notifications be discarded? */
int facilityenable; /*!< Enable facility IEs */
int dchan_logical_span[NUM_DCHANS]; /*!< Logical offset the DCHAN sits in */
int fds[NUM_DCHANS]; /*!< FD's for d-channels */
#ifdef HAVE_PRI_SERVICE_MESSAGES
unsigned int enable_service_message_support:1; /*!< enable SERVICE message support */
#endif
#ifdef HAVE_PRI_INBANDDISCONNECT
unsigned int inbanddisconnect:1; /*!< Should we support inband audio after receiving DISCONNECT? */
#endif
int dialplan; /*!< Dialing plan */
int localdialplan; /*!< Local dialing plan */
char internationalprefix[10]; /*!< country access code ('00' for european dialplans) */
char nationalprefix[10]; /*!< area access code ('0' for european dialplans) */
char localprefix[20]; /*!< area access code + area code ('0'+area code for european dialplans) */
char privateprefix[20]; /*!< for private dialplans */
char unknownprefix[20]; /*!< for unknown dialplans */
long resetinterval; /*!< Interval (in seconds) for resetting unused channels */
char idleext[AST_MAX_EXTENSION]; /*!< Where to idle extra calls */
char idlecontext[AST_MAX_CONTEXT]; /*!< What context to use for idle */
char idledial[AST_MAX_EXTENSION]; /*!< What to dial before dumping */
int minunused; /*!< Min # of channels to keep empty */
int minidle; /*!< Min # of "idling" calls to keep active */
int nodetype; /*!< Node type */
int switchtype; /*!< Type of switch to emulate */
int nsf; /*!< Network-Specific Facilities */
int trunkgroup; /*!< What our trunkgroup is */
int dchanavail[NUM_DCHANS]; /*!< Whether each channel is available */
int debug; /*!< set to true if to dump PRI event info (tested but never set) */
int span; /*!< span number put into user output messages */
int resetting; /*!< true if span is being reset/restarted */
int resetpos; /*!< current position during a reset (-1 if not started) */
int sig; /*!< ISDN signalling type (SIG_PRI, SIG_BRI, SIG_BRI_PTMP, etc...) */
/* Everything after here is internally set */
struct pri *dchans[NUM_DCHANS]; /*!< Actual d-channels */
struct pri *pri; /*!< Currently active D-channel */
int numchans; /*!< Num of channels we represent */
struct sig_pri_chan *pvts[MAX_CHANNELS]; /*!< Member channel pvt structs */
pthread_t master; /*!< Thread of master */
ast_mutex_t lock; /*!< Mutex */
time_t lastreset; /*!< time when unused channels were last reset */
struct sig_pri_callback *calls;
};
int sig_pri_call(struct sig_pri_chan *p, struct ast_channel *ast, char *rdest, int timeout, int layer1);
int sig_pri_hangup(struct sig_pri_chan *p, struct ast_channel *ast);
int sig_pri_indicate(struct sig_pri_chan *p, struct ast_channel *chan, int condition, const void *data, size_t datalen);
int sig_pri_answer(struct sig_pri_chan *p, struct ast_channel *ast);
int sig_pri_available(struct sig_pri_chan *p, int channelmatch, ast_group_t groupmatch, int *busy, int *channelmatched, int *groupmatched);
void sig_pri_init_pri(struct sig_pri_pri *pri);
/* If return 0, it means this function was able to handle it (pre setup digits). If non zero, the user of this
* functions should handle it normally (generate inband DTMF) */
int sig_pri_digit_begin(struct sig_pri_chan *pvt, struct ast_channel *ast, char digit);
int sig_pri_start_pri(struct sig_pri_pri *pri);
void sig_pri_chan_alarm_notify(struct sig_pri_chan *p, int noalarm);
void pri_event_alarm(struct sig_pri_pri *pri, int index, int before_start_pri);
void pri_event_noalarm(struct sig_pri_pri *pri, int index, int before_start_pri);
struct ast_channel *sig_pri_request(struct sig_pri_chan *p, enum sig_pri_law law);
struct sig_pri_chan *sig_pri_chan_new(void *pvt_data, struct sig_pri_callback *callback, struct sig_pri_pri *pri, int logicalspan, int channo);
int pri_is_up(struct sig_pri_pri *pri);
void sig_pri_cli_show_spans(int fd, int span, struct sig_pri_pri *pri);
void sig_pri_cli_show_span(int fd, int *dchannels, struct sig_pri_pri *pri);
int pri_send_keypad_facility_exec(struct sig_pri_chan *p, const char *digits);
int pri_send_callrerouting_facility_exec(struct sig_pri_chan *p, enum ast_channel_state chanstate, const char *destination, const char *original, const char *reason);
int pri_maintenance_bservice(struct pri *pri, struct sig_pri_chan *p, int changestatus);
#endif /* _SIG_PRI_H */
Loading…
Cancel
Save