Add ability to restart PRI at Q.921 layer

git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@247 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Mark Spencer 2005-09-13 02:19:00 +00:00
parent 4bbe741b99
commit cfee7ff007
2 changed files with 13 additions and 0 deletions

View File

@ -487,6 +487,9 @@ extern int pri_hangup(struct pri *pri, q931_call *call, int cause);
#define PRI_DESTROYCALL #define PRI_DESTROYCALL
extern void pri_destroycall(struct pri *pri, q931_call *call); extern void pri_destroycall(struct pri *pri, q931_call *call);
#define PRI_RESTART
extern int pri_restart(struct pri *pri);
extern int pri_reset(struct pri *pri, int channel); extern int pri_reset(struct pri *pri, int channel);
/* Create a new call */ /* Create a new call */

10
pri.c
View File

@ -247,6 +247,16 @@ static struct pri *__pri_new(int fd, int node, int switchtype, struct pri *maste
return p; return p;
} }
int pri_restart(struct pri *pri)
{
/* Restart Q.921 layer */
if (pri) {
q921_reset(pri);
q921_start(pri, pri->localtype == PRI_CPE);
}
return 0;
}
struct pri *pri_new(int fd, int nodetype, int switchtype) struct pri *pri_new(int fd, int nodetype, int switchtype)
{ {
return __pri_new(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL); return __pri_new(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL);