Compare commits
3 Commits
1.4.12-bet
...
1.4.12-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db3ed3a439 | ||
|
|
b4621337b6 | ||
|
|
ecc75a52aa |
218
ChangeLog
218
ChangeLog
@@ -1,221 +1,3 @@
|
||||
2010-11-17 Leif Madsen <lmadsen@digium.com>
|
||||
|
||||
* libpri 1.4.12-beta3 released.
|
||||
|
||||
2010-11-12 02:31 +0000 [r2113] Richard Mudgett <rmudgett@digium.com>
|
||||
|
||||
* pri_internal.h, pri_q921.h, q921.c: Asterisk is getting a "No
|
||||
D-channels available!" warning message every 4 seconds. For PTP
|
||||
links, libpri generated the PRI_EVENT_DCHAN_DOWN event every time
|
||||
it failed to bring layer 2 up because the physical layer is down.
|
||||
For PTP links, made generate the
|
||||
PRI_EVENT_DCHAN_UP/PRI_EVENT_DCHAN_DOWN only when it enters/exits
|
||||
the Q.921 superstate consisting of states
|
||||
7(Q921_MULTI_FRAME_ESTABLISHED) and 8(Q921_TIMER_RECOVERY). Also
|
||||
changed the PTP link restart delay to be link specific instead of
|
||||
D channel specific because the GR-303 PTP switch types have more
|
||||
than one Q.921 link. (closes issue #17270) Reported by: jmls
|
||||
|
||||
2010-11-11 00:30 +0000 [r2109-2111] Richard Mudgett <rmudgett@digium.com>
|
||||
|
||||
* pri_internal.h, q921.c: SABME flood on backup D-channel in NFAS
|
||||
configuration. Made delay restarting the PTP layer 2 link by the
|
||||
T200 time instead of immediately. Q.921 does not specify any
|
||||
particular time to restart the layer 2 link. Q.921 leaves it up
|
||||
to the upper layers to decide when or if another attempt to bring
|
||||
layer 2 up is made. Earlier versions of libpri used the T200 time
|
||||
to restart the link. This is a reimplementaion of -r1878. (closes
|
||||
issue #18255) Reported by: bklang JIRA SWP-2508
|
||||
|
||||
* q921.c: Minor MDL handler changes. * Clear mdl_error in case we
|
||||
could not schedule the handler callback. * Change MDL handlers to
|
||||
not return the handled state since the caller did not care.
|
||||
|
||||
2010-11-05 20:05 +0000 [r2098-2105] Richard Mudgett <rmudgett@digium.com>
|
||||
|
||||
* pri.c, pri_internal.h, pri_q921.h, q921.c: Added TEI identity
|
||||
check feature to reclaim dead TEIs. This is the new feature
|
||||
portion of JIRA LIBPRI-51/SWP-2453.
|
||||
|
||||
* q921.c: Q.921 TEI assignment procedure corrections. * We should
|
||||
send the TEI identity denied message with TEI=127 when the TEI
|
||||
pool is exhausted. * We should remove our TEI if we see a TEI
|
||||
identity assign message assigning our TEI to someone else.
|
||||
|
||||
* pri_q921.h, q921.c: Convert TEI identity defines to enum and
|
||||
create 2str() function.
|
||||
|
||||
* pri_q921.h, q921.c: Remove unneeded struct
|
||||
q921_link.mdl_error_state member.
|
||||
|
||||
* q921.c: Remove all TEIs when NT PTMP starts. Remove all TEIs when
|
||||
a NT PTMP link is started and there are no other links to make
|
||||
sure there are no devices that think they have a TEI. A device
|
||||
may think it has a TEI if the upper layer program is restarted or
|
||||
the system reboots. This fixes the bug portion of JIRA
|
||||
LIBPRI-51/SWP-2453.
|
||||
|
||||
* q921.c: Mainly put space after switch and while keywords.
|
||||
|
||||
2010-11-02 19:11 +0000 [r2088] Richard Mudgett <rmudgett@digium.com>
|
||||
|
||||
* q921.c: B410P gets incoming call packets on ISDN but Asterisk
|
||||
doesn't see the call. The Cisco 1751 with VIC 2-BRI ports sends
|
||||
out SETUP messages on the broadcast TEI as if the BRI were PTMP
|
||||
even though it is configured for PTP mode. Make PTP mode also
|
||||
accept frames on SAPI=0, TEI=127 (Broadcast). (closes issue
|
||||
#18232) Reported by: lelio Patches: issue18232_v1.4.patch
|
||||
uploaded by rmudgett (license 664) Tested by: lelio
|
||||
|
||||
2010-10-21 18:00 +0000 [r2063-2079] Richard Mudgett <rmudgett@digium.com>
|
||||
|
||||
* doc/cc_ptmp_agent.fsm, pri_internal.h, q931.c,
|
||||
doc/cc_ptp_agent.fsm, doc/cc_qsig_agent.fsm, pri_cc.c,
|
||||
doc/cc_ptmp_agent_flattened.fsm, doc/cc_ptp_agent_flattened.fsm,
|
||||
doc/cc_qsig_agent_flattened.fsm: Fixes CC agents not
|
||||
automatically clearing if T309 clears the original call. Incoming
|
||||
calls with CC enabled will not automatically clear the CC offer
|
||||
record when the call is aborted by T309 processing. All CC agent
|
||||
FSM's have this problem (PTMP, PTP, and Q.SIG). To reproduce: 1)
|
||||
Place incoming call to Asterisk/libpri 2) Either before or after
|
||||
the call is answered, bring the ISDN link down. 3) T309
|
||||
processing, T309 timeout, or TEI removal will leave the CC agent
|
||||
FSM in the CC available state. The problem is indicated by the
|
||||
"cc report status" CLI command showing a status of CC offered to
|
||||
caller but it will never timeout. The FSM's can be manually
|
||||
cleared by using the "cc cancel all" or "cc cancel core" CLI
|
||||
commands. JIRA LIBPRI-46 JIRA SWP-2241
|
||||
|
||||
* pri.c, pri_internal.h: Partial support for dynamic interfaces
|
||||
with NFAS. To have some support for dynamic interfaces, the
|
||||
master NFAS D channel control structure will always exist even if
|
||||
it is abandoned/deleted by the upper layer. The master/slave
|
||||
pointers ensure that the correct master will be used.
|
||||
|
||||
* pri.c, pri_internal.h, pri_q921.h, pri_aoc.c, pri_q931.h, q921.c,
|
||||
q931.c, pri_facility.c, pri_cc.c, prisched.c: Extract the layer 2
|
||||
link structure out of struct pri. This completes the layer 2 link
|
||||
and Q.931 call control restructuring. Some code is now simplified
|
||||
since there is only one D channel control structure and the
|
||||
amount of allocated memory is reduced.
|
||||
|
||||
* pri.c, pri_internal.h, pri_q921.h, pri_q931.h, q921.c, q931.c,
|
||||
pri_facility.c: Restructure the Q.931 call record to layer 2 link
|
||||
association. This is in anticipation of extracting a layer 2 link
|
||||
structure out of struct pri. Also completes fixing timer value
|
||||
access for the rest of libpri. The timer access must always be on
|
||||
the D channel control structure (Master). May have fixed some
|
||||
events from timeouts not being passed to the upper layer. The
|
||||
timeout events must always be on the D channel control structure
|
||||
(Master).
|
||||
|
||||
* pri_q921.h, q921.c: Logically separate Q.921 TEI link processing
|
||||
from D channel control. This is in anticipation of extracting a
|
||||
layer 2 link structure out of struct pri. Also fixes Q.921 timer
|
||||
value access. The timer access must always be on the D channel
|
||||
control structure (Master).
|
||||
|
||||
2010-10-16 04:34 +0000 [r2015-2042] Richard Mudgett <rmudgett@digium.com>
|
||||
|
||||
* q921.c: Dump Q.931 message using the TEI value the message came
|
||||
in with.
|
||||
|
||||
* pri_internal.h, q931.c: Create two versions of call ptr verify.
|
||||
One gripes and one does not.
|
||||
|
||||
* q931.c: Crash when receiving an unknown/unsupported message type.
|
||||
Fix double free of a call record and the subsequent continued use
|
||||
of the freed call record when receiving an unsupported/unknown
|
||||
message type. (closes issue #17968) Reported by: gelo Patches:
|
||||
issue_17968_v1.4.patch uploaded by rmudgett (license 664)
|
||||
|
||||
* pri.c, pri_internal.h, pri_aoc.c, q931.c, pri_facility.c,
|
||||
pri_cc.c: Segfault in pri_schedule_del() - ctrl value is invalid.
|
||||
Validate the given call pointer in libpri API calls. If the call
|
||||
pointer is not an active call record then a complaint message is
|
||||
issued and the API call aborts. The call pointer is likely stale.
|
||||
This patch is defensive. More information is needed to figure out
|
||||
why Asterisk still has a call pointer during its hangup sequence.
|
||||
(closes issue #17522) (closes issue #18032) Reported by:
|
||||
schmoozecom Patches: issue_18032_v1.4.patch uploaded by rmudgett
|
||||
(license 664) Tested by: rmudgett
|
||||
|
||||
2010-10-07 04:00 +0000 [r2009] Tilghman Lesher <tlesher@digium.com>
|
||||
|
||||
* Makefile: Minor changes to make libpri build on Mac OS X
|
||||
|
||||
2010-09-16 21:24 +0000 [r2001] Russell Bryant <russell@digium.com>
|
||||
|
||||
* Makefile: Makefile tweaks to allow building for code coverage
|
||||
analysis.
|
||||
|
||||
2010-09-13 21:21 +0000 [r1982-1991] Richard Mudgett <rmudgett@digium.com>
|
||||
|
||||
* pri_q931.h, q921.c, q931.c: PRI links do not retain active calls
|
||||
if the link comes back before T309 expires. The DL-ESTABLISH
|
||||
confirm event was not passed from Q.921 to Q.931 so Q.931 never
|
||||
cancelled the T309 timer. Refactored q931_dl_tei_removal() and
|
||||
q931_dl_indication() into q931_dl_event() to allow the
|
||||
DL-ESTABLISH confirm/indication and DL-RELEASE confirm/indication
|
||||
events to be passed to Q.931.
|
||||
|
||||
* pri.c, pri_internal.h, pri_q931.h, q921.c, q931.c, prisched.c:
|
||||
BRI PTMP: Active channels not cleared when the interface goes
|
||||
down. If the connection to the terminal is lost while there are
|
||||
open channels on the interface, red alarm is reported, but the
|
||||
open channels are never cleared. Additionally, if you manually
|
||||
try to channel request hangup, Asterisk crashes. For PTMP, the
|
||||
T309 processing was not searching the call pool on the master
|
||||
control record. Additionally, for NT PTMP, the timeout events
|
||||
were not passed to the upper layer because the events were not
|
||||
put on the master control record where timer processing expects
|
||||
them. (closes issue #17865) Reported by: wimpy Patches:
|
||||
issue17865_v1.4.patch uploaded by rmudgett (license 664) Tested
|
||||
by: rmudgett, wimpy
|
||||
|
||||
2010-09-10 23:15 +0000 [r1976] Richard Mudgett <rmudgett@digium.com>
|
||||
|
||||
* doc/cc_ptmp_agent.fsm, doc/cc_ptmp_agent_flattened.fsm: Fix
|
||||
spelling error in PTMP agent FSM files.
|
||||
|
||||
2010-09-08 21:43 +0000 [r1958-1965] Richard Mudgett <rmudgett@digium.com>
|
||||
|
||||
* pri.c: Added more parameter checks to pri_set_timer() and
|
||||
pri_get_timer(). Made pri_dump_info_str() output a line for each
|
||||
Q.921 TEI Tx queue when LIBPRI_COUNTERS is defined.
|
||||
|
||||
* q921.c, q931.c: Made Q.921 delay events to Q.931 if the event
|
||||
could immediately generate response frames. Q.921 was passing a
|
||||
q931_dl_indication(up) event to Q.931 before it was finished
|
||||
processing the frame. The q931_dl_indication(up) event could
|
||||
immediately send STATUS messages in the Q.921 intermediate state
|
||||
that would then get stuck in the tx queue with an invalid N(S).
|
||||
Q.921 was passing i-frames to Q.931 before it was finished
|
||||
processing the frame. The i-frames could cause Q.931 to
|
||||
immediately generate a response message that may cause the peer
|
||||
to see the P/F bit as incorrect. Delayed passing
|
||||
q931_dl_indication(up) events and i-frames to Q.931 until Q.921
|
||||
has completed processing the frame event. (The Q.921 SDL diagrams
|
||||
were designed with this assumption.) (closes issue #17360)
|
||||
Reported by: shawkris Patches: issue17360_v1.4.patch uploaded by
|
||||
rmudgett (license 664) Tested by: shawkris, rmudgett
|
||||
|
||||
* q931.c: Prevent a CONNECT message from sending a CONNECT
|
||||
ACKNOWLEDGE in the wrong state. Filter the processing of the
|
||||
CONNECT message to prevent libpri from sending a CONNECT
|
||||
ACKNOWLEDGE when the call is in an inappropriate state. This can
|
||||
happen when we hang up an outgoing call after the other end has
|
||||
sent a CONNECT but before we have processed the CONNECT. (issue
|
||||
#17360) Reported by: shawkris Patches:
|
||||
issue17360_con_ack_v1.4.patch uploaded by rmudgett (license 664)
|
||||
|
||||
* q931.c: Balance curly braces in post_handle_q931_message().
|
||||
|
||||
2010-09-02 17:33 +0000 [r1955] Richard Mudgett <rmudgett@digium.com>
|
||||
|
||||
* pri.c: Don't crash in __pri_new_tei() if a GR303 subchannel
|
||||
creation fails.
|
||||
|
||||
2010-08-30 Leif Madsen <lmadsen@digium.com>
|
||||
|
||||
* libpri 1.4.12-beta2 released.
|
||||
|
||||
24
Makefile
24
Makefile
@@ -93,20 +93,12 @@ DYNAMIC_OBJS= \
|
||||
rose_qsig_mwi.lo \
|
||||
rose_qsig_name.lo \
|
||||
version.lo
|
||||
CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC $(ALERTING) $(LIBPRI_COUNTERS) $(LIBPRI_OPT) $(COVERAGE_CFLAGS)
|
||||
CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC $(ALERTING) $(LIBPRI_COUNTERS) $(LIBPRI_OPT)
|
||||
INSTALL_PREFIX=$(DESTDIR)
|
||||
INSTALL_BASE=/usr
|
||||
libdir?=$(INSTALL_BASE)/lib
|
||||
ifneq ($(findstring Darwin,$(OSARCH)),)
|
||||
SOFLAGS=-dynamic -bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
|
||||
ifeq ($(shell /usr/bin/sw_vers -productVersion | cut -c1-4),10.6)
|
||||
SOFLAGS+=/usr/lib/bundle1.o
|
||||
endif
|
||||
LDCONFIG=/usr/bin/true
|
||||
else
|
||||
SOFLAGS=-shared -Wl,-h$(DYNAMIC_LIBRARY) $(COVERAGE_LDFLAGS)
|
||||
LDCONFIG = /sbin/ldconfig
|
||||
endif
|
||||
SOFLAGS:=-Wl,-h$(DYNAMIC_LIBRARY)
|
||||
LDCONFIG = /sbin/ldconfig
|
||||
ifneq (,$(findstring X$(OSARCH)X, XLinuxX XGNU/kFreeBSDX XGNUX))
|
||||
LDCONFIG_FLAGS=-n
|
||||
else
|
||||
@@ -134,13 +126,7 @@ ifeq ($(PROC),sparc64)
|
||||
PROC=ultrasparc
|
||||
LIBPRI_OPT = -mtune=$(PROC) -O3 -pipe -fomit-frame-pointer -mcpu=v8
|
||||
else
|
||||
ifneq ($(CODE_COVERAGE),)
|
||||
LIBPRI_OPT=
|
||||
COVERAGE_CFLAGS=-ftest-coverage -fprofile-arcs
|
||||
COVERAGE_LDFLAGS=-ftest-coverage -fprofile-arcs
|
||||
else
|
||||
LIBPRI_OPT=-O2
|
||||
endif
|
||||
LIBPRI_OPT = -O2
|
||||
endif
|
||||
|
||||
ifeq ($(CPUARCH),i686)
|
||||
@@ -219,7 +205,7 @@ $(STATIC_LIBRARY): $(STATIC_OBJS)
|
||||
ranlib $(STATIC_LIBRARY)
|
||||
|
||||
$(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
|
||||
$(CC) $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
|
||||
$(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
|
||||
$(LDCONFIG) $(LDCONFIG_FLAGS) .
|
||||
ln -sf libpri.so.$(SONAME) libpri.so
|
||||
|
||||
|
||||
@@ -25,13 +25,7 @@ FSM CC_PTMP_Agent
|
||||
Action Send_CC_Available(Q931_DISCONNECT);
|
||||
Next_State CC_STATE_AVAILABLE;
|
||||
}
|
||||
Stimulus CC_EVENT_INTERNAL_CLEARING {
|
||||
Action Release_LinkID;
|
||||
Action Pass_Up_CC_Cancel;
|
||||
Next_State CC_STATE_IDLE;
|
||||
}
|
||||
Stimulus CC_EVENT_CANCEL {
|
||||
Action Release_LinkID;
|
||||
Next_State CC_STATE_IDLE;
|
||||
}
|
||||
}
|
||||
@@ -51,26 +45,22 @@ FSM CC_PTMP_Agent
|
||||
Action Pass_Up_CC_Request;
|
||||
Next_State CC_STATE_REQUESTED;
|
||||
}
|
||||
Stimulus CC_EVENT_INTERNAL_CLEARING {
|
||||
Action Stop_T_RETENTION;
|
||||
Action Start_T_RETENTION;
|
||||
}
|
||||
Stimulus CC_EVENT_TIMEOUT_T_RETENTION {
|
||||
Action Send_EraseCallLinkageID;
|
||||
Action Release_LinkID;
|
||||
Action Relese_LinkID;
|
||||
Action Pass_Up_CC_Cancel;
|
||||
Next_State CC_STATE_IDLE;
|
||||
}
|
||||
Stimulus CC_EVENT_CANCEL {
|
||||
Action Send_EraseCallLinkageID;
|
||||
Action Release_LinkID;
|
||||
Action Relese_LinkID;
|
||||
Next_State CC_STATE_IDLE;
|
||||
}
|
||||
}
|
||||
State CC_STATE_REQUESTED {
|
||||
Epilog {
|
||||
Action Send_EraseCallLinkageID;
|
||||
Action Release_LinkID;
|
||||
Action Relese_LinkID;
|
||||
}
|
||||
Stimulus CC_EVENT_CC_REQUEST_ACCEPT {
|
||||
Next_State CC_STATE_ACTIVATED;
|
||||
|
||||
@@ -20,14 +20,7 @@ FSM CC_PTMP_Agent
|
||||
Action Send_CC_Available(Q931_DISCONNECT);
|
||||
Next_State CC_STATE_AVAILABLE;
|
||||
}
|
||||
Stimulus CC_EVENT_INTERNAL_CLEARING {
|
||||
Action Release_LinkID;
|
||||
Action Pass_Up_CC_Cancel;
|
||||
Action Set_Selfdestruct;
|
||||
Next_State CC_STATE_IDLE;
|
||||
}
|
||||
Stimulus CC_EVENT_CANCEL {
|
||||
Action Release_LinkID;
|
||||
Action Set_Selfdestruct;
|
||||
Next_State CC_STATE_IDLE;
|
||||
}
|
||||
@@ -46,13 +39,9 @@ FSM CC_PTMP_Agent
|
||||
Action Stop_T_RETENTION;
|
||||
Next_State CC_STATE_REQUESTED;
|
||||
}
|
||||
Stimulus CC_EVENT_INTERNAL_CLEARING {
|
||||
Action Stop_T_RETENTION;
|
||||
Action Start_T_RETENTION;
|
||||
}
|
||||
Stimulus CC_EVENT_TIMEOUT_T_RETENTION {
|
||||
Action Send_EraseCallLinkageID;
|
||||
Action Release_LinkID;
|
||||
Action Relese_LinkID;
|
||||
Action Pass_Up_CC_Cancel;
|
||||
Action Stop_T_RETENTION;
|
||||
Action Set_Selfdestruct;
|
||||
@@ -60,7 +49,7 @@ FSM CC_PTMP_Agent
|
||||
}
|
||||
Stimulus CC_EVENT_CANCEL {
|
||||
Action Send_EraseCallLinkageID;
|
||||
Action Release_LinkID;
|
||||
Action Relese_LinkID;
|
||||
Action Stop_T_RETENTION;
|
||||
Action Set_Selfdestruct;
|
||||
Next_State CC_STATE_IDLE;
|
||||
@@ -69,7 +58,7 @@ FSM CC_PTMP_Agent
|
||||
State CC_STATE_REQUESTED {
|
||||
Stimulus CC_EVENT_CC_REQUEST_ACCEPT {
|
||||
Action Send_EraseCallLinkageID;
|
||||
Action Release_LinkID;
|
||||
Action Relese_LinkID;
|
||||
/* Start T_CCBS2 or T_CCNR2 depending upon CC mode. */
|
||||
Action Start_T_SUPERVISION;
|
||||
Action Reset_A_Status;
|
||||
@@ -78,7 +67,7 @@ FSM CC_PTMP_Agent
|
||||
}
|
||||
Stimulus CC_EVENT_CANCEL {
|
||||
Action Send_EraseCallLinkageID;
|
||||
Action Release_LinkID;
|
||||
Action Relese_LinkID;
|
||||
Action Set_Selfdestruct;
|
||||
Next_State CC_STATE_IDLE;
|
||||
}
|
||||
|
||||
@@ -25,10 +25,6 @@ FSM CC_PTP_Agent
|
||||
Action Send_CC_Available(Q931_DISCONNECT);
|
||||
Next_State CC_STATE_AVAILABLE;
|
||||
}
|
||||
Stimulus CC_EVENT_INTERNAL_CLEARING {
|
||||
Action Pass_Up_CC_Cancel;
|
||||
Next_State CC_STATE_IDLE;
|
||||
}
|
||||
Stimulus CC_EVENT_CANCEL {
|
||||
Next_State CC_STATE_IDLE;
|
||||
}
|
||||
@@ -57,10 +53,6 @@ FSM CC_PTP_Agent
|
||||
Action Stop_T_RETENTION;
|
||||
Next_State CC_STATE_REQUESTED;
|
||||
}
|
||||
Stimulus CC_EVENT_INTERNAL_CLEARING {
|
||||
Action Stop_T_RETENTION;
|
||||
Action Start_T_RETENTION;
|
||||
}
|
||||
Stimulus CC_EVENT_TIMEOUT_T_RETENTION {
|
||||
Action Pass_Up_CC_Cancel;
|
||||
Next_State CC_STATE_IDLE;
|
||||
|
||||
@@ -20,11 +20,6 @@ FSM CC_PTP_Agent
|
||||
Action Send_CC_Available(Q931_DISCONNECT);
|
||||
Next_State CC_STATE_AVAILABLE;
|
||||
}
|
||||
Stimulus CC_EVENT_INTERNAL_CLEARING {
|
||||
Action Pass_Up_CC_Cancel;
|
||||
Action Set_Selfdestruct;
|
||||
Next_State CC_STATE_IDLE;
|
||||
}
|
||||
Stimulus CC_EVENT_CANCEL {
|
||||
Action Set_Selfdestruct;
|
||||
Next_State CC_STATE_IDLE;
|
||||
@@ -51,10 +46,6 @@ FSM CC_PTP_Agent
|
||||
Action Stop_T_RETENTION;
|
||||
Next_State CC_STATE_REQUESTED;
|
||||
}
|
||||
Stimulus CC_EVENT_INTERNAL_CLEARING {
|
||||
Action Stop_T_RETENTION;
|
||||
Action Start_T_RETENTION;
|
||||
}
|
||||
Stimulus CC_EVENT_TIMEOUT_T_RETENTION {
|
||||
Action Pass_Up_CC_Cancel;
|
||||
Action Stop_T_RETENTION;
|
||||
|
||||
@@ -41,10 +41,6 @@ FSM CC_QSIG_Agent
|
||||
Action Send_Call_Proceeding;
|
||||
Next_State CC_STATE_REQUESTED;
|
||||
}
|
||||
Stimulus CC_EVENT_INTERNAL_CLEARING {
|
||||
Action Stop_T_RETENTION;
|
||||
Action Start_T_RETENTION;
|
||||
}
|
||||
Stimulus CC_EVENT_TIMEOUT_T_RETENTION {
|
||||
Action Pass_Up_CC_Cancel;
|
||||
Next_State CC_STATE_IDLE;
|
||||
|
||||
@@ -34,10 +34,6 @@ FSM CC_QSIG_Agent
|
||||
Action Stop_T_RETENTION;
|
||||
Next_State CC_STATE_REQUESTED;
|
||||
}
|
||||
Stimulus CC_EVENT_INTERNAL_CLEARING {
|
||||
Action Stop_T_RETENTION;
|
||||
Action Start_T_RETENTION;
|
||||
}
|
||||
Stimulus CC_EVENT_TIMEOUT_T_RETENTION {
|
||||
Action Pass_Up_CC_Cancel;
|
||||
Action Stop_T_RETENTION;
|
||||
|
||||
93
libpri-1.4.12-beta2-summary.html
Normal file
93
libpri-1.4.12-beta2-summary.html
Normal file
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - libpri-1.4.12-beta2</title></head>
|
||||
<body>
|
||||
<h1 align="center"><a name="top">Release Summary</a></h1>
|
||||
<h3 align="center">libpri-1.4.12-beta2</h3>
|
||||
<h3 align="center">Date: 2010-08-30</h3>
|
||||
<h3 align="center"><asteriskteam@digium.com></h3>
|
||||
<hr/>
|
||||
<h2 align="center">Table of Contents</h2>
|
||||
<ol>
|
||||
<li><a href="#summary">Summary</a></li>
|
||||
<li><a href="#contributors">Contributors</a></li>
|
||||
<li><a href="#issues">Closed Issues</a></li>
|
||||
<li><a href="#commits">Other Changes</a></li>
|
||||
<li><a href="#diffstat">Diffstat</a></li>
|
||||
</ol>
|
||||
<hr/>
|
||||
<a name="summary"><h2 align="center">Summary</h2></a>
|
||||
<center><a href="#top">[Back to Top]</a></center><br/><p>This release includes only bug fixes. The changes included were made only to address problems that have been identified in this release series. Users should be able to safely upgrade to this version if this release series is already in use. Users considering upgrading from a previous release series are strongly encouraged to review the UPGRADE.txt document as well as the CHANGES document for information about upgrading to this release series.</p>
|
||||
<p>The data in this summary reflects changes that have been made since the previous release, libpri-1.4.12-beta1.</p>
|
||||
<hr/>
|
||||
<a name="contributors"><h2 align="center">Contributors</h2></a>
|
||||
<center><a href="#top">[Back to Top]</a></center><br/><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were closed by commits that went into this release.</p>
|
||||
<table width="100%" border="0">
|
||||
<tr>
|
||||
<td width="33%"><h3>Coders</h3></td>
|
||||
<td width="33%"><h3>Testers</h3></td>
|
||||
<td width="33%"><h3>Reporters</h3></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
13 rmudgett<br/>
|
||||
1 alecdavis<br/>
|
||||
1 mattf<br/>
|
||||
</td>
|
||||
<td>
|
||||
1 jcovert<br/>
|
||||
1 rmudgett<br/>
|
||||
</td>
|
||||
<td>
|
||||
1 alecdavis<br/>
|
||||
1 jcovert<br/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr/>
|
||||
<a name="issues"><h2 align="center">Closed Issues</h2></a>
|
||||
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all issues from the issue tracker that were closed by changes that went into this release.</p>
|
||||
<h3>Category: General</h3><br/>
|
||||
<a href="https://issues.asterisk.org/view.php?id=16791">#16791</a>: [patch] q921_rnr_rx Q921_TIMER_RECOVERY SDL issue<br/>
|
||||
Revision: <a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1845">1845</a><br/>
|
||||
Reporter: alecdavis<br/>
|
||||
Coders: alecdavis<br/>
|
||||
<br/>
|
||||
<a href="https://issues.asterisk.org/view.php?id=17570">#17570</a>: [patch] ISDN BRI does not recover from line faults<br/>
|
||||
Revision: <a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1918">1918</a><br/>
|
||||
Reporter: jcovert<br/>
|
||||
Testers: jcovert, rmudgett<br/>
|
||||
Coders: rmudgett<br/>
|
||||
<br/>
|
||||
<hr/>
|
||||
<a name="commits"><h2 align="center">Commits Not Associated with an Issue</h2></a>
|
||||
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all changes that went into this release that did not directly close an issue from the issue tracker. The commits may have been marked as being related to an issue. If that is the case, the issue numbers are listed here, as well.</p>
|
||||
<table width="100%" border="1">
|
||||
<tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Summary</b></td><td><b>Issues Referenced</b></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1842">1842</a></td><td>rmudgett</td><td>Renamed local struct pri *pri variables to struct pri *ctrl in q921.c.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1848">1848</a></td><td>rmudgett</td><td>Improved Q.921/Q.931 debug output.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1852">1852</a></td><td>rmudgett</td><td>Learn (AGAIN!) why state 7 and state 8 transitions were suppressed.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1853">1853</a></td><td>rmudgett</td><td>No audio on inbound J1 calls.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1878">1878</a></td><td>mattf</td><td>Add silly fake MDL error Z for kicking L2 to reactivate if a DISC or DM is received in proper states on PTP links.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1883">1883</a></td><td>rmudgett</td><td>Don't silently fail to post our fake MDL-ERROR(Z).</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1884">1884</a></td><td>rmudgett</td><td>Added gripe check to rosetest for invalid operation and error codes.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1894">1894</a></td><td>rmudgett</td><td>Make pri_dump_event() only print the event name.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1904">1904</a></td><td>rmudgett</td><td>Add support to receive ECMA-164 2nd edition OID name ROSE messages.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1912">1912</a></td><td>rmudgett</td><td>Convert most references of Q931_MAX_TEI to use ARRAY_LEN().</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1923">1923</a></td><td>rmudgett</td><td>Q.921 improvements from comparing Q.921 SDL diagrams with implementation.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1928">1928</a></td><td>rmudgett</td><td>Q.921/Q.931 message debug output improvements.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1929">1929</a></td><td>rmudgett</td><td>Reduced fake MDL-ERROR (Z) message severity to be visible only when debugging enabled.</td>
|
||||
<td></td></tr></table>
|
||||
<hr/>
|
||||
<a name="diffstat"><h2 align="center">Diffstat Results</h2></a>
|
||||
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.</p>
|
||||
<pre>
|
||||
pri.c | 78 --
|
||||
q921.c | 2135 ++++++++++++++++++++++++++++++++++++-------------------------
|
||||
q931.c | 180 +++--
|
||||
rose.c | 45 +
|
||||
rosetest.c | 54 +
|
||||
5 files changed, 1550 insertions(+), 942 deletions(-)
|
||||
</pre><br/>
|
||||
<hr/>
|
||||
</body>
|
||||
</html>
|
||||
153
libpri-1.4.12-beta2-summary.txt
Normal file
153
libpri-1.4.12-beta2-summary.txt
Normal file
@@ -0,0 +1,153 @@
|
||||
Release Summary
|
||||
|
||||
libpri-1.4.12-beta2
|
||||
|
||||
Date: 2010-08-30
|
||||
|
||||
<asteriskteam@digium.com>
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Table of Contents
|
||||
|
||||
1. Summary
|
||||
2. Contributors
|
||||
3. Closed Issues
|
||||
4. Other Changes
|
||||
5. Diffstat
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Summary
|
||||
|
||||
[Back to Top]
|
||||
|
||||
This release includes only bug fixes. The changes included were made only
|
||||
to address problems that have been identified in this release series.
|
||||
Users should be able to safely upgrade to this version if this release
|
||||
series is already in use. Users considering upgrading from a previous
|
||||
release series are strongly encouraged to review the UPGRADE.txt document
|
||||
as well as the CHANGES document for information about upgrading to this
|
||||
release series.
|
||||
|
||||
The data in this summary reflects changes that have been made since the
|
||||
previous release, libpri-1.4.12-beta1.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Contributors
|
||||
|
||||
[Back to Top]
|
||||
|
||||
This table lists the people who have submitted code, those that have
|
||||
tested patches, as well as those that reported issues on the issue tracker
|
||||
that were resolved in this release. For coders, the number is how many of
|
||||
their patches (of any size) were committed into this release. For testers,
|
||||
the number is the number of times their name was listed as assisting with
|
||||
testing a patch. Finally, for reporters, the number is the number of
|
||||
issues that they reported that were closed by commits that went into this
|
||||
release.
|
||||
|
||||
Coders Testers Reporters
|
||||
13 rmudgett 1 jcovert 1 alecdavis
|
||||
1 alecdavis 1 rmudgett 1 jcovert
|
||||
1 mattf
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Closed Issues
|
||||
|
||||
[Back to Top]
|
||||
|
||||
This is a list of all issues from the issue tracker that were closed by
|
||||
changes that went into this release.
|
||||
|
||||
Category: General
|
||||
|
||||
#16791: [patch] q921_rnr_rx Q921_TIMER_RECOVERY SDL issue
|
||||
Revision: 1845
|
||||
Reporter: alecdavis
|
||||
Coders: alecdavis
|
||||
|
||||
#17570: [patch] ISDN BRI does not recover from line faults
|
||||
Revision: 1918
|
||||
Reporter: jcovert
|
||||
Testers: jcovert, rmudgett
|
||||
Coders: rmudgett
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Commits Not Associated with an Issue
|
||||
|
||||
[Back to Top]
|
||||
|
||||
This is a list of all changes that went into this release that did not
|
||||
directly close an issue from the issue tracker. The commits may have been
|
||||
marked as being related to an issue. If that is the case, the issue
|
||||
numbers are listed here, as well.
|
||||
|
||||
+------------------------------------------------------------------------+
|
||||
| Revision | Author | Summary | Issues |
|
||||
| | | | Referenced |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| | | Renamed local struct pri *pri | |
|
||||
| 1842 | rmudgett | variables to struct pri *ctrl in | |
|
||||
| | | q921.c. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 1848 | rmudgett | Improved Q.921/Q.931 debug output. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| | | Learn (AGAIN!) why state 7 and | |
|
||||
| 1852 | rmudgett | state 8 transitions were | |
|
||||
| | | suppressed. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 1853 | rmudgett | No audio on inbound J1 calls. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| | | Add silly fake MDL error Z for | |
|
||||
| 1878 | mattf | kicking L2 to reactivate if a DISC | |
|
||||
| | | or DM is received in proper states | |
|
||||
| | | on PTP links. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 1883 | rmudgett | Don't silently fail to post our | |
|
||||
| | | fake MDL-ERROR(Z). | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 1884 | rmudgett | Added gripe check to rosetest for | |
|
||||
| | | invalid operation and error codes. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 1894 | rmudgett | Make pri_dump_event() only print | |
|
||||
| | | the event name. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 1904 | rmudgett | Add support to receive ECMA-164 2nd | |
|
||||
| | | edition OID name ROSE messages. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 1912 | rmudgett | Convert most references of | |
|
||||
| | | Q931_MAX_TEI to use ARRAY_LEN(). | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| | | Q.921 improvements from comparing | |
|
||||
| 1923 | rmudgett | Q.921 SDL diagrams with | |
|
||||
| | | implementation. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 1928 | rmudgett | Q.921/Q.931 message debug output | |
|
||||
| | | improvements. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| | | Reduced fake MDL-ERROR (Z) message | |
|
||||
| 1929 | rmudgett | severity to be visible only when | |
|
||||
| | | debugging enabled. | |
|
||||
+------------------------------------------------------------------------+
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Diffstat Results
|
||||
|
||||
[Back to Top]
|
||||
|
||||
This is a summary of the changes to the source code that went into this
|
||||
release that was generated using the diffstat utility.
|
||||
|
||||
pri.c | 78 --
|
||||
q921.c | 2135 ++++++++++++++++++++++++++++++++++++-------------------------
|
||||
q931.c | 180 +++--
|
||||
rose.c | 45 +
|
||||
rosetest.c | 54 +
|
||||
5 files changed, 1550 insertions(+), 942 deletions(-)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
@@ -1,157 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Release Summary - libpri-1.4.12-beta3</title></head>
|
||||
<body>
|
||||
<h1 align="center"><a name="top">Release Summary</a></h1>
|
||||
<h3 align="center">libpri-1.4.12-beta3</h3>
|
||||
<h3 align="center">Date: 2010-11-17</h3>
|
||||
<h3 align="center"><asteriskteam@digium.com></h3>
|
||||
<hr/>
|
||||
<h2 align="center">Table of Contents</h2>
|
||||
<ol>
|
||||
<li><a href="#summary">Summary</a></li>
|
||||
<li><a href="#contributors">Contributors</a></li>
|
||||
<li><a href="#issues">Closed Issues</a></li>
|
||||
<li><a href="#commits">Other Changes</a></li>
|
||||
<li><a href="#diffstat">Diffstat</a></li>
|
||||
</ol>
|
||||
<hr/>
|
||||
<a name="summary"><h2 align="center">Summary</h2></a>
|
||||
<center><a href="#top">[Back to Top]</a></center><br/><p>This release includes only bug fixes. The changes included were made only to address problems that have been identified in this release series. Users should be able to safely upgrade to this version if this release series is already in use. Users considering upgrading from a previous release series are strongly encouraged to review the UPGRADE.txt document as well as the CHANGES document for information about upgrading to this release series.</p>
|
||||
<p>The data in this summary reflects changes that have been made since the previous release, libpri-1.4.12-beta2.</p>
|
||||
<hr/>
|
||||
<a name="contributors"><h2 align="center">Contributors</h2></a>
|
||||
<center><a href="#top">[Back to Top]</a></center><br/><p>This table lists the people who have submitted code, those that have tested patches, as well as those that reported issues on the issue tracker that were resolved in this release. For coders, the number is how many of their patches (of any size) were committed into this release. For testers, the number is the number of times their name was listed as assisting with testing a patch. Finally, for reporters, the number is the number of issues that they reported that were closed by commits that went into this release.</p>
|
||||
<table width="100%" border="0">
|
||||
<tr>
|
||||
<td width="33%"><h3>Coders</h3></td>
|
||||
<td width="33%"><h3>Testers</h3></td>
|
||||
<td width="33%"><h3>Reporters</h3></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
28 rmudgett<br/>
|
||||
1 russell<br/>
|
||||
1 tilghman<br/>
|
||||
</td>
|
||||
<td>
|
||||
4 rmudgett<br/>
|
||||
1 lelio<br/>
|
||||
1 shawkris<br/>
|
||||
1 wimpy<br/>
|
||||
</td>
|
||||
<td>
|
||||
1 bklang<br/>
|
||||
1 gelo<br/>
|
||||
1 jmls<br/>
|
||||
1 lelio<br/>
|
||||
1 schmoozecom<br/>
|
||||
1 shawkris<br/>
|
||||
1 wimpy<br/>
|
||||
1 wuwu<br/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr/>
|
||||
<a name="issues"><h2 align="center">Closed Issues</h2></a>
|
||||
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all issues from the issue tracker that were closed by changes that went into this release.</p>
|
||||
<h3>Category: Channels/chan_dahdi</h3><br/>
|
||||
<a href="https://issues.asterisk.org/view.php?id=17270">#17270</a>: getting warning message every 4 seconds<br/>
|
||||
Revision: <a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2113">2113</a><br/>
|
||||
Reporter: jmls<br/>
|
||||
Coders: rmudgett<br/>
|
||||
<br/>
|
||||
<h3>Category: General</h3><br/>
|
||||
<a href="https://issues.asterisk.org/view.php?id=17360">#17360</a>: [patch] LibPRI problem with restart of PBX processor (Testing SVN 1688)<br/>
|
||||
Revision: <a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1962">1962</a><br/>
|
||||
Reporter: shawkris<br/>
|
||||
Testers: shawkris, rmudgett<br/>
|
||||
Coders: rmudgett<br/>
|
||||
<br/>
|
||||
<a href="https://issues.asterisk.org/view.php?id=17522">#17522</a>: segfault in pri_schedule_del - ctrl invalid value<br/>
|
||||
Revision: <a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2015">2015</a><br/>
|
||||
Reporter: wuwu<br/>
|
||||
Testers: rmudgett<br/>
|
||||
Coders: rmudgett<br/>
|
||||
<br/>
|
||||
<a href="https://issues.asterisk.org/view.php?id=17865">#17865</a>: [patch] BRI NT ptmp: Active channels not cleard when i/f goes down<br/>
|
||||
Revision: <a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1982">1982</a><br/>
|
||||
Reporter: wimpy<br/>
|
||||
Testers: rmudgett, wimpy<br/>
|
||||
Coders: rmudgett<br/>
|
||||
<br/>
|
||||
<a href="https://issues.asterisk.org/view.php?id=17968">#17968</a>: [patch] Libpri crashes when receiving Message Type (100)<br/>
|
||||
Revision: <a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2021">2021</a><br/>
|
||||
Reporter: gelo<br/>
|
||||
Coders: rmudgett<br/>
|
||||
<br/>
|
||||
<a href="https://issues.asterisk.org/view.php?id=18032">#18032</a>: [patch] Asterisk is core dumping with LibPRI<br/>
|
||||
Revision: <a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2015">2015</a><br/>
|
||||
Reporter: schmoozecom<br/>
|
||||
Testers: rmudgett<br/>
|
||||
Coders: rmudgett<br/>
|
||||
<br/>
|
||||
<a href="https://issues.asterisk.org/view.php?id=18232">#18232</a>: [patch] B410P gets incoming call packets on ISDN but DAHDI doesn't generate the call in Asterisk<br/>
|
||||
Revision: <a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2088">2088</a><br/>
|
||||
Reporter: lelio<br/>
|
||||
Testers: lelio<br/>
|
||||
Coders: rmudgett<br/>
|
||||
<br/>
|
||||
<a href="https://issues.asterisk.org/view.php?id=18255">#18255</a>: SABME flood on backup D-channel in NFAS configuration<br/>
|
||||
Revision: <a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2111">2111</a><br/>
|
||||
Reporter: bklang<br/>
|
||||
Coders: rmudgett<br/>
|
||||
<br/>
|
||||
<hr/>
|
||||
<a name="commits"><h2 align="center">Commits Not Associated with an Issue</h2></a>
|
||||
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a list of all changes that went into this release that did not directly close an issue from the issue tracker. The commits may have been marked as being related to an issue. If that is the case, the issue numbers are listed here, as well.</p>
|
||||
<table width="100%" border="1">
|
||||
<tr><td><b>Revision</b></td><td><b>Author</b></td><td><b>Summary</b></td><td><b>Issues Referenced</b></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1955">1955</a></td><td>rmudgett</td><td>Don't crash in __pri_new_tei() if a GR303 subchannel creation fails.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1958">1958</a></td><td>rmudgett</td><td>Balance curly braces in post_handle_q931_message().</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1961">1961</a></td><td>rmudgett</td><td>Prevent a CONNECT message from sending a CONNECT ACKNOWLEDGE in the wrong state.</td>
|
||||
<td><a href="https://issues.asterisk.org/view.php?id=17360">#17360</a></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1965">1965</a></td><td>rmudgett</td><td>Added more parameter checks to pri_set_timer() and pri_get_timer().</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1976">1976</a></td><td>rmudgett</td><td>Fix spelling error in PTMP agent FSM files.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=1991">1991</a></td><td>rmudgett</td><td>PRI links do not retain active calls if the link comes back before T309 expires.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2001">2001</a></td><td>russell</td><td>Makefile tweaks to allow building for code coverage analysis.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2009">2009</a></td><td>tilghman</td><td>Minor changes to make libpri build on Mac OS X</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2027">2027</a></td><td>rmudgett</td><td>Create two versions of call ptr verify. One gripes and one does not.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2042">2042</a></td><td>rmudgett</td><td>Dump Q.931 message using the TEI value the message came in with.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2063">2063</a></td><td>rmudgett</td><td>Logically separate Q.921 TEI link processing from D channel control.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2070">2070</a></td><td>rmudgett</td><td>Restructure the Q.931 call record to layer 2 link association.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2077">2077</a></td><td>rmudgett</td><td>Extract the layer 2 link structure out of struct pri.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2078">2078</a></td><td>rmudgett</td><td>Partial support for dynamic interfaces with NFAS.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2079">2079</a></td><td>rmudgett</td><td>Fixes CC agents not automatically clearing if T309 clears the original call.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2098">2098</a></td><td>rmudgett</td><td>Mainly put space after switch and while keywords.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2101">2101</a></td><td>rmudgett</td><td>Remove all TEIs when NT PTMP starts.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2102">2102</a></td><td>rmudgett</td><td>Remove unneeded struct q921_link.mdl_error_state member.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2103">2103</a></td><td>rmudgett</td><td>Convert TEI identity defines to enum and create 2str() function.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2104">2104</a></td><td>rmudgett</td><td>Q.921 TEI assignment procedure corrections.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2105">2105</a></td><td>rmudgett</td><td>Added TEI identity check feature to reclaim dead TEIs.</td>
|
||||
<td></td></tr><tr><td><a href="http://svn.digium.com/view/libpri/branches/1.4?view=revision&revision=2109">2109</a></td><td>rmudgett</td><td>Minor MDL handler changes.</td>
|
||||
<td></td></tr></table>
|
||||
<hr/>
|
||||
<a name="diffstat"><h2 align="center">Diffstat Results</h2></a>
|
||||
<center><a href="#top">[Back to Top]</a></center><br/><p>This is a summary of the changes to the source code that went into this release that was generated using the diffstat utility.</p>
|
||||
<pre>
|
||||
Makefile | 24
|
||||
doc/cc_ptmp_agent.fsm | 16
|
||||
doc/cc_ptmp_agent_flattened.fsm | 19
|
||||
doc/cc_ptp_agent.fsm | 8
|
||||
doc/cc_ptp_agent_flattened.fsm | 9
|
||||
doc/cc_qsig_agent.fsm | 4
|
||||
doc/cc_qsig_agent_flattened.fsm | 4
|
||||
pri.c | 515 +++++++---
|
||||
pri_aoc.c | 25
|
||||
pri_cc.c | 82 -
|
||||
pri_facility.c | 40
|
||||
pri_internal.h | 134 +-
|
||||
pri_q921.h | 101 +-
|
||||
pri_q931.h | 17
|
||||
prisched.c | 38
|
||||
q921.c | 1988 ++++++++++++++++++++++++----------------
|
||||
q931.c | 788 +++++++++++----
|
||||
17 files changed, 2518 insertions(+), 1294 deletions(-)
|
||||
</pre><br/>
|
||||
<hr/>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,235 +0,0 @@
|
||||
Release Summary
|
||||
|
||||
libpri-1.4.12-beta3
|
||||
|
||||
Date: 2010-11-17
|
||||
|
||||
<asteriskteam@digium.com>
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Table of Contents
|
||||
|
||||
1. Summary
|
||||
2. Contributors
|
||||
3. Closed Issues
|
||||
4. Other Changes
|
||||
5. Diffstat
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Summary
|
||||
|
||||
[Back to Top]
|
||||
|
||||
This release includes only bug fixes. The changes included were made only
|
||||
to address problems that have been identified in this release series.
|
||||
Users should be able to safely upgrade to this version if this release
|
||||
series is already in use. Users considering upgrading from a previous
|
||||
release series are strongly encouraged to review the UPGRADE.txt document
|
||||
as well as the CHANGES document for information about upgrading to this
|
||||
release series.
|
||||
|
||||
The data in this summary reflects changes that have been made since the
|
||||
previous release, libpri-1.4.12-beta2.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Contributors
|
||||
|
||||
[Back to Top]
|
||||
|
||||
This table lists the people who have submitted code, those that have
|
||||
tested patches, as well as those that reported issues on the issue tracker
|
||||
that were resolved in this release. For coders, the number is how many of
|
||||
their patches (of any size) were committed into this release. For testers,
|
||||
the number is the number of times their name was listed as assisting with
|
||||
testing a patch. Finally, for reporters, the number is the number of
|
||||
issues that they reported that were closed by commits that went into this
|
||||
release.
|
||||
|
||||
Coders Testers Reporters
|
||||
28 rmudgett 4 rmudgett 1 bklang
|
||||
1 russell 1 lelio 1 gelo
|
||||
1 tilghman 1 shawkris 1 jmls
|
||||
1 wimpy 1 lelio
|
||||
1 schmoozecom
|
||||
1 shawkris
|
||||
1 wimpy
|
||||
1 wuwu
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Closed Issues
|
||||
|
||||
[Back to Top]
|
||||
|
||||
This is a list of all issues from the issue tracker that were closed by
|
||||
changes that went into this release.
|
||||
|
||||
Category: Channels/chan_dahdi
|
||||
|
||||
#17270: getting warning message every 4 seconds
|
||||
Revision: 2113
|
||||
Reporter: jmls
|
||||
Coders: rmudgett
|
||||
|
||||
Category: General
|
||||
|
||||
#17360: [patch] LibPRI problem with restart of PBX processor (Testing SVN
|
||||
1688)
|
||||
Revision: 1962
|
||||
Reporter: shawkris
|
||||
Testers: shawkris, rmudgett
|
||||
Coders: rmudgett
|
||||
|
||||
#17522: segfault in pri_schedule_del - ctrl invalid value
|
||||
Revision: 2015
|
||||
Reporter: wuwu
|
||||
Testers: rmudgett
|
||||
Coders: rmudgett
|
||||
|
||||
#17865: [patch] BRI NT ptmp: Active channels not cleard when i/f goes down
|
||||
Revision: 1982
|
||||
Reporter: wimpy
|
||||
Testers: rmudgett, wimpy
|
||||
Coders: rmudgett
|
||||
|
||||
#17968: [patch] Libpri crashes when receiving Message Type (100)
|
||||
Revision: 2021
|
||||
Reporter: gelo
|
||||
Coders: rmudgett
|
||||
|
||||
#18032: [patch] Asterisk is core dumping with LibPRI
|
||||
Revision: 2015
|
||||
Reporter: schmoozecom
|
||||
Testers: rmudgett
|
||||
Coders: rmudgett
|
||||
|
||||
#18232: [patch] B410P gets incoming call packets on ISDN but DAHDI doesn't
|
||||
generate the call in Asterisk
|
||||
Revision: 2088
|
||||
Reporter: lelio
|
||||
Testers: lelio
|
||||
Coders: rmudgett
|
||||
|
||||
#18255: SABME flood on backup D-channel in NFAS configuration
|
||||
Revision: 2111
|
||||
Reporter: bklang
|
||||
Coders: rmudgett
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Commits Not Associated with an Issue
|
||||
|
||||
[Back to Top]
|
||||
|
||||
This is a list of all changes that went into this release that did not
|
||||
directly close an issue from the issue tracker. The commits may have been
|
||||
marked as being related to an issue. If that is the case, the issue
|
||||
numbers are listed here, as well.
|
||||
|
||||
+------------------------------------------------------------------------+
|
||||
| Revision | Author | Summary | Issues |
|
||||
| | | | Referenced |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 1955 | rmudgett | Don't crash in __pri_new_tei() if a | |
|
||||
| | | GR303 subchannel creation fails. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 1958 | rmudgett | Balance curly braces in | |
|
||||
| | | post_handle_q931_message(). | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| | | Prevent a CONNECT message from | |
|
||||
| 1961 | rmudgett | sending a CONNECT ACKNOWLEDGE in | #17360 |
|
||||
| | | the wrong state. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| | | Added more parameter checks to | |
|
||||
| 1965 | rmudgett | pri_set_timer() and | |
|
||||
| | | pri_get_timer(). | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 1976 | rmudgett | Fix spelling error in PTMP agent | |
|
||||
| | | FSM files. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| | | PRI links do not retain active | |
|
||||
| 1991 | rmudgett | calls if the link comes back before | |
|
||||
| | | T309 expires. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2001 | russell | Makefile tweaks to allow building | |
|
||||
| | | for code coverage analysis. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2009 | tilghman | Minor changes to make libpri build | |
|
||||
| | | on Mac OS X | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| | | Create two versions of call ptr | |
|
||||
| 2027 | rmudgett | verify. One gripes and one does | |
|
||||
| | | not. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2042 | rmudgett | Dump Q.931 message using the TEI | |
|
||||
| | | value the message came in with. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2063 | rmudgett | Logically separate Q.921 TEI link | |
|
||||
| | | processing from D channel control. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2070 | rmudgett | Restructure the Q.931 call record | |
|
||||
| | | to layer 2 link association. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2077 | rmudgett | Extract the layer 2 link structure | |
|
||||
| | | out of struct pri. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2078 | rmudgett | Partial support for dynamic | |
|
||||
| | | interfaces with NFAS. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| | | Fixes CC agents not automatically | |
|
||||
| 2079 | rmudgett | clearing if T309 clears the | |
|
||||
| | | original call. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2098 | rmudgett | Mainly put space after switch and | |
|
||||
| | | while keywords. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2101 | rmudgett | Remove all TEIs when NT PTMP | |
|
||||
| | | starts. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2102 | rmudgett | Remove unneeded struct | |
|
||||
| | | q921_link.mdl_error_state member. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2103 | rmudgett | Convert TEI identity defines to | |
|
||||
| | | enum and create 2str() function. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2104 | rmudgett | Q.921 TEI assignment procedure | |
|
||||
| | | corrections. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2105 | rmudgett | Added TEI identity check feature to | |
|
||||
| | | reclaim dead TEIs. | |
|
||||
|----------+----------+-------------------------------------+------------|
|
||||
| 2109 | rmudgett | Minor MDL handler changes. | |
|
||||
+------------------------------------------------------------------------+
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Diffstat Results
|
||||
|
||||
[Back to Top]
|
||||
|
||||
This is a summary of the changes to the source code that went into this
|
||||
release that was generated using the diffstat utility.
|
||||
|
||||
Makefile | 24
|
||||
doc/cc_ptmp_agent.fsm | 16
|
||||
doc/cc_ptmp_agent_flattened.fsm | 19
|
||||
doc/cc_ptp_agent.fsm | 8
|
||||
doc/cc_ptp_agent_flattened.fsm | 9
|
||||
doc/cc_qsig_agent.fsm | 4
|
||||
doc/cc_qsig_agent_flattened.fsm | 4
|
||||
pri.c | 515 +++++++---
|
||||
pri_aoc.c | 25
|
||||
pri_cc.c | 82 -
|
||||
pri_facility.c | 40
|
||||
pri_internal.h | 134 +-
|
||||
pri_q921.h | 101 +-
|
||||
pri_q931.h | 17
|
||||
prisched.c | 38
|
||||
q921.c | 1988 ++++++++++++++++++++++++----------------
|
||||
q931.c | 788 +++++++++++----
|
||||
17 files changed, 2518 insertions(+), 1294 deletions(-)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
515
pri.c
515
pri.c
@@ -63,7 +63,6 @@ static const struct pri_timer_table pri_timer[] = {
|
||||
{ "N202", PRI_TIMER_N202, PRI_ALL_SWITCHES },
|
||||
{ "K", PRI_TIMER_K, PRI_ALL_SWITCHES },
|
||||
{ "T200", PRI_TIMER_T200, PRI_ALL_SWITCHES },
|
||||
{ "T201", PRI_TIMER_T201, PRI_ALL_SWITCHES },
|
||||
{ "T202", PRI_TIMER_T202, PRI_ALL_SWITCHES },
|
||||
{ "T203", PRI_TIMER_T203, PRI_ALL_SWITCHES },
|
||||
{ "T300", PRI_TIMER_T300, PRI_ALL_SWITCHES },
|
||||
@@ -166,25 +165,21 @@ static void pri_default_timers(struct pri *ctrl, int switchtype)
|
||||
ctrl->timers[PRI_TIMER_N200] = 3; /* Max numer of Q.921 retransmissions */
|
||||
ctrl->timers[PRI_TIMER_N202] = 3; /* Max numer of transmissions of the TEI identity request message */
|
||||
|
||||
if (ctrl->bri) {
|
||||
ctrl->timers[PRI_TIMER_K] = 1; /* Max number of outstanding I-frames */
|
||||
} else {
|
||||
ctrl->timers[PRI_TIMER_K] = 7; /* Max number of outstanding I-frames */
|
||||
}
|
||||
if (ctrl->bri == 1)
|
||||
ctrl->timers[PRI_TIMER_K] = 1; /* Max number of outstanding I-frames */
|
||||
else
|
||||
ctrl->timers[PRI_TIMER_K] = 7; /* Max number of outstanding I-frames */
|
||||
|
||||
ctrl->timers[PRI_TIMER_T200] = 1000; /* Time between SABME's */
|
||||
ctrl->timers[PRI_TIMER_T201] = ctrl->timers[PRI_TIMER_T200];/* Time between TEI Identity Checks (Default same as T200) */
|
||||
ctrl->timers[PRI_TIMER_T202] = 10 * 1000; /* Min time between transmission of TEI Identity request messages */
|
||||
ctrl->timers[PRI_TIMER_T203] = 10 * 1000; /* Max time without exchanging packets */
|
||||
|
||||
ctrl->timers[PRI_TIMER_T303] = 4 * 1000; /* Length between SETUP retransmissions and timeout */
|
||||
ctrl->timers[PRI_TIMER_T305] = 30 * 1000; /* Wait for DISCONNECT acknowledge */
|
||||
ctrl->timers[PRI_TIMER_T308] = 4 * 1000; /* Wait for RELEASE acknowledge */
|
||||
ctrl->timers[PRI_TIMER_T309] = 6 * 1000; /* Time to wait before clearing calls in case of D-channel transient event. Q.931 specifies 6-90 seconds */
|
||||
ctrl->timers[PRI_TIMER_T313] = 4 * 1000; /* Wait for CONNECT acknowledge, CPE side only */
|
||||
|
||||
ctrl->timers[PRI_TIMER_TM20] = 2500; /* Max time awaiting XID response - Q.921 Appendix IV */
|
||||
ctrl->timers[PRI_TIMER_NM20] = 3; /* Number of XID retransmits - Q.921 Appendix IV */
|
||||
ctrl->timers[PRI_TIMER_T303] = 4 * 1000; /* Length between SETUP retransmissions and timeout */
|
||||
ctrl->timers[PRI_TIMER_T309] = 6000; /* Time to wait before clearing calls in case of D-channel transient event. Q.931 specifies 6-90 seconds */
|
||||
|
||||
ctrl->timers[PRI_TIMER_T_HOLD] = 4 * 1000; /* Wait for HOLD request response. */
|
||||
ctrl->timers[PRI_TIMER_T_RETRIEVE] = 4 * 1000;/* Wait for RETRIEVE request response. */
|
||||
@@ -225,21 +220,20 @@ static void pri_default_timers(struct pri *ctrl, int switchtype)
|
||||
}
|
||||
}
|
||||
|
||||
int pri_set_timer(struct pri *ctrl, int timer, int value)
|
||||
int pri_set_timer(struct pri *pri, int timer, int value)
|
||||
{
|
||||
if (!ctrl || timer < 0 || PRI_MAX_TIMERS <= timer || value < 0) {
|
||||
if (timer < 0 || timer > PRI_MAX_TIMERS || value < 0)
|
||||
return -1;
|
||||
}
|
||||
ctrl->timers[timer] = value;
|
||||
|
||||
pri->timers[timer] = value;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int pri_get_timer(struct pri *ctrl, int timer)
|
||||
int pri_get_timer(struct pri *pri, int timer)
|
||||
{
|
||||
if (!ctrl || timer < 0 || PRI_MAX_TIMERS <= timer) {
|
||||
if (timer < 0 || timer > PRI_MAX_TIMERS)
|
||||
return -1;
|
||||
}
|
||||
return ctrl->timers[timer];
|
||||
return pri->timers[timer];
|
||||
}
|
||||
|
||||
int pri_set_service_message_support(struct pri *pri, int supportflag)
|
||||
@@ -288,265 +282,139 @@ static int __pri_write(struct pri *pri, void *buf, int buflen)
|
||||
return res;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Destroy the given link.
|
||||
*
|
||||
* \param link Q.921 link to destroy.
|
||||
*
|
||||
* \return Nothing
|
||||
*/
|
||||
void pri_link_destroy(struct q921_link *link)
|
||||
void __pri_free_tei(struct pri * p)
|
||||
{
|
||||
if (link) {
|
||||
if (p) {
|
||||
struct q931_call *call;
|
||||
|
||||
call = link->dummy_call;
|
||||
call = p->dummy_call;
|
||||
if (call) {
|
||||
pri_schedule_del(call->pri, call->retranstimer);
|
||||
call->retranstimer = 0;
|
||||
pri_call_apdu_queue_cleanup(call);
|
||||
}
|
||||
free(link);
|
||||
free(p->msg_line);
|
||||
free(p->sched.timer);
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \internal
|
||||
* \brief Initialize the layer 2 link structure.
|
||||
*
|
||||
* \param ctrl D channel controller.
|
||||
* \param link Q.921 link to initialize.
|
||||
* \param sapi SAPI new link is to use.
|
||||
* \param tei TEI new link is to use.
|
||||
*
|
||||
* \note It is assumed that the link has already been memset to zero.
|
||||
*
|
||||
* \return Nothing
|
||||
*/
|
||||
static void pri_link_init(struct pri *ctrl, struct q921_link *link, int sapi, int tei)
|
||||
struct pri *__pri_new_tei(int fd, int node, int switchtype, struct pri *master, pri_io_cb rd, pri_io_cb wr, void *userdata, int tei, int bri)
|
||||
{
|
||||
link->ctrl = ctrl;
|
||||
link->sapi = sapi;
|
||||
link->tei = tei;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Create a new layer 2 link.
|
||||
*
|
||||
* \param ctrl D channel controller.
|
||||
* \param sapi SAPI new link is to use.
|
||||
* \param tei TEI new link is to use.
|
||||
*
|
||||
* \retval link on success.
|
||||
* \retval NULL on error.
|
||||
*/
|
||||
struct q921_link *pri_link_new(struct pri *ctrl, int sapi, int tei)
|
||||
{
|
||||
struct link_dummy *dummy_link;
|
||||
struct q921_link *link;
|
||||
|
||||
switch (ctrl->switchtype) {
|
||||
case PRI_SWITCH_GR303_EOC:
|
||||
case PRI_SWITCH_GR303_TMC:
|
||||
link = calloc(1, sizeof(*link));
|
||||
if (!link) {
|
||||
return NULL;
|
||||
}
|
||||
dummy_link = NULL;
|
||||
break;
|
||||
default:
|
||||
dummy_link = calloc(1, sizeof(*dummy_link));
|
||||
if (!dummy_link) {
|
||||
return NULL;
|
||||
}
|
||||
link = &dummy_link->link;
|
||||
break;
|
||||
}
|
||||
|
||||
pri_link_init(ctrl, link, sapi, tei);
|
||||
if (dummy_link) {
|
||||
/* Initialize the dummy call reference call record. */
|
||||
link->dummy_call = &dummy_link->dummy_call;
|
||||
q931_init_call_record(link, link->dummy_call, Q931_DUMMY_CALL_REFERENCE);
|
||||
}
|
||||
|
||||
q921_start(link);
|
||||
|
||||
return link;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \internal
|
||||
* \brief Destroy the given D channel controller.
|
||||
*
|
||||
* \param ctrl D channel control to destroy.
|
||||
*
|
||||
* \return Nothing
|
||||
*/
|
||||
static void pri_ctrl_destroy(struct pri *ctrl)
|
||||
{
|
||||
if (ctrl) {
|
||||
struct q931_call *call;
|
||||
|
||||
if (ctrl->link.tei == Q921_TEI_GROUP
|
||||
&& ctrl->link.sapi == Q921_SAPI_LAYER2_MANAGEMENT
|
||||
&& ctrl->localtype == PRI_CPE) {
|
||||
/* This dummy call was borrowed from the specific TEI link. */
|
||||
call = NULL;
|
||||
} else {
|
||||
call = ctrl->link.dummy_call;
|
||||
}
|
||||
if (call) {
|
||||
pri_schedule_del(call->pri, call->retranstimer);
|
||||
call->retranstimer = 0;
|
||||
pri_call_apdu_queue_cleanup(call);
|
||||
}
|
||||
free(ctrl->msg_line);
|
||||
free(ctrl->sched.timer);
|
||||
free(ctrl);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \internal
|
||||
* \brief Create a new D channel control structure.
|
||||
*
|
||||
* \param fd D channel file descriptor if no callback functions supplied.
|
||||
* \param node Switch NET/CPE type
|
||||
* \param switchtype ISDN switch type
|
||||
* \param rd D channel read callback function
|
||||
* \param wr D channel write callback function
|
||||
* \param userdata Callback function parameter
|
||||
* \param tei TEI new link is to use.
|
||||
* \param bri TRUE if interface is BRI
|
||||
*
|
||||
* \retval ctrl on success.
|
||||
* \retval NULL on error.
|
||||
*/
|
||||
static struct pri *pri_ctrl_new(int fd, int node, int switchtype, pri_io_cb rd, pri_io_cb wr, void *userdata, int tei, int bri)
|
||||
{
|
||||
int create_dummy_call;
|
||||
struct d_ctrl_dummy *dummy_ctrl;
|
||||
struct pri *ctrl;
|
||||
struct pri *p;
|
||||
|
||||
switch (switchtype) {
|
||||
case PRI_SWITCH_GR303_EOC:
|
||||
case PRI_SWITCH_GR303_TMC:
|
||||
create_dummy_call = 0;
|
||||
case PRI_SWITCH_GR303_TMC_SWITCHING:
|
||||
case PRI_SWITCH_GR303_EOC_PATH:
|
||||
p = calloc(1, sizeof(*p));
|
||||
if (!p) {
|
||||
return NULL;
|
||||
}
|
||||
dummy_ctrl = NULL;
|
||||
break;
|
||||
default:
|
||||
if (bri && node == PRI_CPE && tei == Q921_TEI_GROUP) {
|
||||
/*
|
||||
* BRI TE PTMP will not use its own group dummy call record. It
|
||||
* will use the specific TEI dummy call instead.
|
||||
*/
|
||||
create_dummy_call = 0;
|
||||
} else {
|
||||
create_dummy_call = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (create_dummy_call) {
|
||||
dummy_ctrl = calloc(1, sizeof(*dummy_ctrl));
|
||||
if (!dummy_ctrl) {
|
||||
return NULL;
|
||||
}
|
||||
ctrl = &dummy_ctrl->ctrl;
|
||||
} else {
|
||||
ctrl = calloc(1, sizeof(*ctrl));
|
||||
if (!ctrl) {
|
||||
p = &dummy_ctrl->ctrl;
|
||||
break;
|
||||
}
|
||||
if (!master) {
|
||||
/* This is the master record. */
|
||||
p->msg_line = calloc(1, sizeof(*p->msg_line));
|
||||
if (!p->msg_line) {
|
||||
free(p);
|
||||
return NULL;
|
||||
}
|
||||
dummy_ctrl = NULL;
|
||||
}
|
||||
ctrl->msg_line = calloc(1, sizeof(*ctrl->msg_line));
|
||||
if (!ctrl->msg_line) {
|
||||
free(ctrl);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ctrl->bri = bri;
|
||||
ctrl->fd = fd;
|
||||
ctrl->read_func = rd;
|
||||
ctrl->write_func = wr;
|
||||
ctrl->userdata = userdata;
|
||||
ctrl->localtype = node;
|
||||
ctrl->switchtype = switchtype;
|
||||
ctrl->cref = 1;
|
||||
ctrl->nsf = PRI_NSF_NONE;
|
||||
ctrl->callpool = &ctrl->localpool;
|
||||
pri_default_timers(ctrl, switchtype);
|
||||
p->bri = bri;
|
||||
p->fd = fd;
|
||||
p->read_func = rd;
|
||||
p->write_func = wr;
|
||||
p->userdata = userdata;
|
||||
p->localtype = node;
|
||||
p->switchtype = switchtype;
|
||||
p->cref = 1;
|
||||
p->sapi = (tei == Q921_TEI_GROUP) ? Q921_SAPI_LAYER2_MANAGEMENT : Q921_SAPI_CALL_CTRL;
|
||||
p->tei = tei;
|
||||
p->nsf = PRI_NSF_NONE;
|
||||
p->protodisc = Q931_PROTOCOL_DISCRIMINATOR;
|
||||
p->master = master;
|
||||
p->callpool = &p->localpool;
|
||||
pri_default_timers(p, switchtype);
|
||||
if (master) {
|
||||
pri_set_debug(p, master->debug);
|
||||
pri_set_inbanddisconnect(p, master->acceptinbanddisconnect);
|
||||
if (master->sendfacility)
|
||||
pri_facility_enable(p);
|
||||
}
|
||||
#ifdef LIBPRI_COUNTERS
|
||||
ctrl->q921_rxcount = 0;
|
||||
ctrl->q921_txcount = 0;
|
||||
ctrl->q931_rxcount = 0;
|
||||
ctrl->q931_txcount = 0;
|
||||
p->q921_rxcount = 0;
|
||||
p->q921_txcount = 0;
|
||||
p->q931_rxcount = 0;
|
||||
p->q931_txcount = 0;
|
||||
#endif
|
||||
if (dummy_ctrl) {
|
||||
/* Initialize the dummy call reference call record. */
|
||||
dummy_ctrl->ctrl.dummy_call = &dummy_ctrl->dummy_call;
|
||||
q931_init_call_record(&dummy_ctrl->ctrl, dummy_ctrl->ctrl.dummy_call,
|
||||
Q931_DUMMY_CALL_REFERENCE);
|
||||
}
|
||||
switch (switchtype) {
|
||||
case PRI_SWITCH_GR303_EOC:
|
||||
ctrl->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
|
||||
pri_link_init(ctrl, &ctrl->link, Q921_SAPI_GR303_EOC, Q921_TEI_GR303_EOC_OPS);
|
||||
ctrl->link.next = pri_link_new(ctrl, Q921_SAPI_GR303_EOC, Q921_TEI_GR303_EOC_PATH);
|
||||
if (!ctrl->link.next) {
|
||||
pri_ctrl_destroy(ctrl);
|
||||
return NULL;
|
||||
p->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
|
||||
p->sapi = Q921_SAPI_GR303_EOC;
|
||||
p->tei = Q921_TEI_GR303_EOC_OPS;
|
||||
p->subchannel = __pri_new_tei(-1, node, PRI_SWITCH_GR303_EOC_PATH, p, NULL, NULL, NULL, Q921_TEI_GR303_EOC_PATH, 0);
|
||||
if (!p->subchannel) {
|
||||
free(p);
|
||||
p = NULL;
|
||||
}
|
||||
break;
|
||||
case PRI_SWITCH_GR303_TMC:
|
||||
ctrl->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
|
||||
pri_link_init(ctrl, &ctrl->link, Q921_SAPI_GR303_TMC_CALLPROC, Q921_TEI_GR303_TMC_CALLPROC);
|
||||
ctrl->link.next = pri_link_new(ctrl, Q921_SAPI_GR303_TMC_SWITCHING, Q921_TEI_GR303_TMC_SWITCHING);
|
||||
if (!ctrl->link.next) {
|
||||
pri_ctrl_destroy(ctrl);
|
||||
return NULL;
|
||||
p->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
|
||||
p->sapi = Q921_SAPI_GR303_TMC_CALLPROC;
|
||||
p->tei = Q921_TEI_GR303_TMC_CALLPROC;
|
||||
p->subchannel = __pri_new_tei(-1, node, PRI_SWITCH_GR303_TMC_SWITCHING, p, NULL, NULL, NULL, Q921_TEI_GR303_TMC_SWITCHING, 0);
|
||||
if (!p->subchannel) {
|
||||
free(p);
|
||||
p = NULL;
|
||||
}
|
||||
break;
|
||||
case PRI_SWITCH_GR303_TMC_SWITCHING:
|
||||
p->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
|
||||
p->sapi = Q921_SAPI_GR303_TMC_SWITCHING;
|
||||
p->tei = Q921_TEI_GR303_TMC_SWITCHING;
|
||||
break;
|
||||
case PRI_SWITCH_GR303_EOC_PATH:
|
||||
p->protodisc = GR303_PROTOCOL_DISCRIMINATOR;
|
||||
p->sapi = Q921_SAPI_GR303_EOC;
|
||||
p->tei = Q921_TEI_GR303_EOC_PATH;
|
||||
break;
|
||||
default:
|
||||
ctrl->protodisc = Q931_PROTOCOL_DISCRIMINATOR;
|
||||
pri_link_init(ctrl, &ctrl->link,
|
||||
(tei == Q921_TEI_GROUP) ? Q921_SAPI_LAYER2_MANAGEMENT : Q921_SAPI_CALL_CTRL,
|
||||
tei);
|
||||
break;
|
||||
}
|
||||
if (dummy_ctrl) {
|
||||
/* Initialize the dummy call reference call record. */
|
||||
ctrl->link.dummy_call = &dummy_ctrl->dummy_call;
|
||||
q931_init_call_record(&ctrl->link, ctrl->link.dummy_call,
|
||||
Q931_DUMMY_CALL_REFERENCE);
|
||||
}
|
||||
|
||||
if (ctrl->link.tei == Q921_TEI_GROUP && ctrl->link.sapi == Q921_SAPI_LAYER2_MANAGEMENT
|
||||
&& ctrl->localtype == PRI_CPE) {
|
||||
ctrl->link.next = pri_link_new(ctrl, Q921_SAPI_CALL_CTRL, Q921_TEI_PRI);
|
||||
if (!ctrl->link.next) {
|
||||
pri_ctrl_destroy(ctrl);
|
||||
if (p->tei == Q921_TEI_GROUP && p->sapi == Q921_SAPI_LAYER2_MANAGEMENT && p->localtype == PRI_CPE) {
|
||||
p->subchannel = __pri_new_tei(-1, p->localtype, p->switchtype, p, NULL, NULL, NULL, Q921_TEI_PRI, 1);
|
||||
if (!p->subchannel) {
|
||||
free(p);
|
||||
return NULL;
|
||||
}
|
||||
/*
|
||||
* Make the group link use the just created specific TEI link
|
||||
* dummy call instead. It makes no sense for TE PTMP interfaces
|
||||
* to broadcast messages on the dummy call or to broadcast any
|
||||
* messages for that matter.
|
||||
*/
|
||||
ctrl->link.dummy_call = ctrl->link.next->dummy_call;
|
||||
} else {
|
||||
q921_start(&ctrl->link);
|
||||
}
|
||||
|
||||
return ctrl;
|
||||
} else
|
||||
q921_start(p);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
void pri_call_set_useruser(q931_call *c, const char *userchars)
|
||||
{
|
||||
/*
|
||||
* There is a slight risk here if c is actually stale. However,
|
||||
* if it is stale then it is better to catch it here than to
|
||||
* write with it.
|
||||
*/
|
||||
if (!userchars || !pri_is_call_valid(NULL, c)) {
|
||||
return;
|
||||
}
|
||||
libpri_copy_string(c->useruserinfo, userchars, sizeof(c->useruserinfo));
|
||||
if (userchars)
|
||||
libpri_copy_string(c->useruserinfo, userchars, sizeof(c->useruserinfo));
|
||||
}
|
||||
|
||||
void pri_sr_set_useruser(struct pri_sr *sr, const char *userchars)
|
||||
@@ -569,15 +437,15 @@ int pri_restart(struct pri *pri)
|
||||
|
||||
struct pri *pri_new(int fd, int nodetype, int switchtype)
|
||||
{
|
||||
return pri_ctrl_new(fd, nodetype, switchtype, __pri_read, __pri_write, NULL, Q921_TEI_PRI, 0);
|
||||
return __pri_new_tei(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL, Q921_TEI_PRI, 0);
|
||||
}
|
||||
|
||||
struct pri *pri_new_bri(int fd, int ptpmode, int nodetype, int switchtype)
|
||||
{
|
||||
if (ptpmode)
|
||||
return pri_ctrl_new(fd, nodetype, switchtype, __pri_read, __pri_write, NULL, Q921_TEI_PRI, 1);
|
||||
return __pri_new_tei(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL, Q921_TEI_PRI, 1);
|
||||
else
|
||||
return pri_ctrl_new(fd, nodetype, switchtype, __pri_read, __pri_write, NULL, Q921_TEI_GROUP, 1);
|
||||
return __pri_new_tei(fd, nodetype, switchtype, NULL, __pri_read, __pri_write, NULL, Q921_TEI_GROUP, 1);
|
||||
}
|
||||
|
||||
struct pri *pri_new_cb(int fd, int nodetype, int switchtype, pri_io_cb io_read, pri_io_cb io_write, void *userdata)
|
||||
@@ -586,7 +454,7 @@ struct pri *pri_new_cb(int fd, int nodetype, int switchtype, pri_io_cb io_read,
|
||||
io_read = __pri_read;
|
||||
if (!io_write)
|
||||
io_write = __pri_write;
|
||||
return pri_ctrl_new(fd, nodetype, switchtype, io_read, io_write, userdata, Q921_TEI_PRI, 0);
|
||||
return __pri_new_tei(fd, nodetype, switchtype, NULL, io_read, io_write, userdata, Q921_TEI_PRI, 0);
|
||||
}
|
||||
|
||||
struct pri *pri_new_bri_cb(int fd, int ptpmode, int nodetype, int switchtype, pri_io_cb io_read, pri_io_cb io_write, void *userdata)
|
||||
@@ -598,9 +466,9 @@ struct pri *pri_new_bri_cb(int fd, int ptpmode, int nodetype, int switchtype, pr
|
||||
io_write = __pri_write;
|
||||
}
|
||||
if (ptpmode) {
|
||||
return pri_ctrl_new(fd, nodetype, switchtype, io_read, io_write, userdata, Q921_TEI_PRI, 1);
|
||||
return __pri_new_tei(fd, nodetype, switchtype, NULL, io_read, io_write, userdata, Q921_TEI_PRI, 1);
|
||||
} else {
|
||||
return pri_ctrl_new(fd, nodetype, switchtype, io_read, io_write, userdata, Q921_TEI_GROUP, 1);
|
||||
return __pri_new_tei(fd, nodetype, switchtype, NULL, io_read, io_write, userdata, Q921_TEI_GROUP, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -746,12 +614,16 @@ void pri_set_debug(struct pri *pri, int debug)
|
||||
if (!pri)
|
||||
return;
|
||||
pri->debug = debug;
|
||||
if (pri->subchannel)
|
||||
pri_set_debug(pri->subchannel, debug);
|
||||
}
|
||||
|
||||
int pri_get_debug(struct pri *pri)
|
||||
{
|
||||
if (!pri)
|
||||
return -1;
|
||||
if (pri->subchannel)
|
||||
return pri_get_debug(pri->subchannel);
|
||||
return pri->debug;
|
||||
}
|
||||
|
||||
@@ -760,93 +632,87 @@ 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)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
if (!pri || !call)
|
||||
return -1;
|
||||
}
|
||||
return q931_alerting(pri, call, channel, info);
|
||||
}
|
||||
|
||||
int pri_proceeding(struct pri *pri, q931_call *call, int channel, int info)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
if (!pri || !call)
|
||||
return -1;
|
||||
}
|
||||
return q931_call_proceeding(pri, call, channel, info);
|
||||
}
|
||||
|
||||
int pri_progress_with_cause(struct pri *pri, q931_call *call, int channel, int info, int cause)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
if (!pri || !call)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return q931_call_progress_with_cause(pri, call, channel, info, cause);
|
||||
}
|
||||
|
||||
int pri_progress(struct pri *pri, q931_call *call, int channel, int info)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
if (!pri || !call)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return q931_call_progress(pri, call, channel, info);
|
||||
}
|
||||
|
||||
int pri_information(struct pri *pri, q931_call *call, char digit)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
if (!pri || !call)
|
||||
return -1;
|
||||
}
|
||||
return q931_information(pri, call, digit);
|
||||
}
|
||||
|
||||
int pri_keypad_facility(struct pri *pri, q931_call *call, const char *digits)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call) || !digits || !digits[0]) {
|
||||
if (!pri || !call || !digits || !digits[0])
|
||||
return -1;
|
||||
}
|
||||
|
||||
return q931_keypad_facility(pri, call, digits);
|
||||
}
|
||||
|
||||
int pri_notify(struct pri *pri, q931_call *call, int channel, int info)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
if (!pri || !call)
|
||||
return -1;
|
||||
}
|
||||
return q931_notify(pri, call, channel, info);
|
||||
}
|
||||
|
||||
void pri_destroycall(struct pri *pri, q931_call *call)
|
||||
{
|
||||
if (pri && pri_is_call_valid(pri, call)) {
|
||||
if (pri && call)
|
||||
q931_destroycall(pri, call);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int pri_need_more_info(struct pri *pri, q931_call *call, int channel, int nonisdn)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
if (!pri || !call)
|
||||
return -1;
|
||||
}
|
||||
return q931_setup_ack(pri, call, channel, nonisdn);
|
||||
}
|
||||
|
||||
int pri_answer(struct pri *pri, q931_call *call, int channel, int nonisdn)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
if (!pri || !call)
|
||||
return -1;
|
||||
}
|
||||
return q931_connect(pri, call, channel, nonisdn);
|
||||
}
|
||||
|
||||
int pri_connect_ack(struct pri *ctrl, q931_call *call, int channel)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
return q931_connect_acknowledge(ctrl, call, channel);
|
||||
@@ -855,6 +721,7 @@ int pri_connect_ack(struct pri *ctrl, q931_call *call, int channel)
|
||||
void pri_connect_ack_enable(struct pri *ctrl, int enable)
|
||||
{
|
||||
if (ctrl) {
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->manual_connect_ack = enable ? 1 : 0;
|
||||
}
|
||||
}
|
||||
@@ -951,7 +818,7 @@ int pri_connected_line_update(struct pri *ctrl, q931_call *call, const struct pr
|
||||
unsigned idx;
|
||||
struct q931_call *subcall;
|
||||
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1017,7 +884,7 @@ int pri_redirecting_update(struct pri *ctrl, q931_call *call, const struct pri_p
|
||||
unsigned idx;
|
||||
struct q931_call *subcall;
|
||||
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1167,17 +1034,15 @@ void pri_status_req_rsp(struct pri *ctrl, int invoke_id, int status)
|
||||
/* deprecated routines, use pri_hangup */
|
||||
int pri_release(struct pri *pri, q931_call *call, int cause)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
if (!pri || !call)
|
||||
return -1;
|
||||
}
|
||||
return q931_release(pri, call, cause);
|
||||
}
|
||||
|
||||
int pri_disconnect(struct pri *pri, q931_call *call, int cause)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
if (!pri || !call)
|
||||
return -1;
|
||||
}
|
||||
return q931_disconnect(pri, call, cause);
|
||||
}
|
||||
#endif
|
||||
@@ -1186,14 +1051,8 @@ int pri_channel_bridge(q931_call *call1, q931_call *call2)
|
||||
{
|
||||
struct q931_call *winner;
|
||||
|
||||
/*
|
||||
* There is a slight risk here if call1 or call2 is actually
|
||||
* stale. However, if they are stale then it is better to catch
|
||||
* it here than to write with these pointers.
|
||||
*/
|
||||
if (!pri_is_call_valid(NULL, call1) || !pri_is_call_valid(NULL, call2)) {
|
||||
if (!call1 || !call2)
|
||||
return -1;
|
||||
}
|
||||
|
||||
winner = q931_find_winning_call(call1);
|
||||
if (!winner) {
|
||||
@@ -1253,15 +1112,15 @@ int pri_channel_bridge(q931_call *call1, q931_call *call2)
|
||||
void pri_hangup_fix_enable(struct pri *ctrl, int enable)
|
||||
{
|
||||
if (ctrl) {
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->hangup_fix_enabled = enable ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
int pri_hangup(struct pri *pri, q931_call *call, int cause)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
if (!pri || !call)
|
||||
return -1;
|
||||
}
|
||||
if (cause == -1)
|
||||
/* normal clear cause */
|
||||
cause = PRI_CAUSE_NORMAL_CLEARING;
|
||||
@@ -1339,10 +1198,8 @@ int pri_mwi_activate(struct pri *pri, q931_call *c, char *caller, int callerplan
|
||||
int calledplan)
|
||||
{
|
||||
struct pri_sr req;
|
||||
|
||||
if (!pri || !pri_is_call_valid(pri, c)) {
|
||||
if (!pri || !c)
|
||||
return -1;
|
||||
}
|
||||
|
||||
pri_sr_init(&req);
|
||||
pri_sr_set_connection_call_independent(&req);
|
||||
@@ -1361,10 +1218,8 @@ int pri_mwi_deactivate(struct pri *pri, q931_call *c, char *caller, int callerpl
|
||||
int calledplan)
|
||||
{
|
||||
struct pri_sr req;
|
||||
|
||||
if (!pri || !pri_is_call_valid(pri, c)) {
|
||||
if (!pri || !c)
|
||||
return -1;
|
||||
}
|
||||
|
||||
pri_sr_init(&req);
|
||||
pri_sr_set_connection_call_independent(&req);
|
||||
@@ -1381,9 +1236,8 @@ int pri_mwi_deactivate(struct pri *pri, q931_call *c, char *caller, int callerpl
|
||||
|
||||
int pri_setup(struct pri *pri, q931_call *c, struct pri_sr *req)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, c)) {
|
||||
if (!pri || !c)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return q931_setup(pri, c, req);
|
||||
}
|
||||
@@ -1393,11 +1247,8 @@ int pri_call(struct pri *pri, q931_call *c, int transmode, int channel, int excl
|
||||
int calledplan, int ulayer1)
|
||||
{
|
||||
struct pri_sr req;
|
||||
|
||||
if (!pri || !pri_is_call_valid(pri, c)) {
|
||||
if (!pri || !c)
|
||||
return -1;
|
||||
}
|
||||
|
||||
pri_sr_init(&req);
|
||||
pri_sr_set_caller(&req, caller, callername, callerplan, callerpres);
|
||||
pri_sr_set_called(&req, called, calledplan, 0);
|
||||
@@ -1438,6 +1289,9 @@ void pri_message(struct pri *ctrl, const char *fmt, ...)
|
||||
int added_length;
|
||||
va_list ap;
|
||||
|
||||
if (ctrl) {
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
}
|
||||
if (!ctrl || !ctrl->msg_line) {
|
||||
/* Just have to do it the old way. */
|
||||
va_start(ap, fmt);
|
||||
@@ -1499,7 +1353,7 @@ void pri_error(struct pri *pri, const char *fmt, ...)
|
||||
vsnprintf(tmp, sizeof(tmp), fmt, ap);
|
||||
va_end(ap);
|
||||
if (__pri_error)
|
||||
__pri_error(pri, tmp);
|
||||
__pri_error(pri ? PRI_MASTER(pri) : NULL, tmp);
|
||||
else
|
||||
fputs(tmp, stderr);
|
||||
}
|
||||
@@ -1565,7 +1419,6 @@ char *pri_dump_info_str(struct pri *ctrl)
|
||||
size_t used;
|
||||
#ifdef LIBPRI_COUNTERS
|
||||
struct q921_frame *f;
|
||||
struct q921_link *link;
|
||||
unsigned q921outstanding;
|
||||
#endif
|
||||
unsigned idx;
|
||||
@@ -1592,14 +1445,13 @@ char *pri_dump_info_str(struct pri *ctrl)
|
||||
used = pri_snprintf(buf, used, buf_size, "Q931 TX: %d\n", ctrl->q931_txcount);
|
||||
used = pri_snprintf(buf, used, buf_size, "Q921 RX: %d\n", ctrl->q921_rxcount);
|
||||
used = pri_snprintf(buf, used, buf_size, "Q921 TX: %d\n", ctrl->q921_txcount);
|
||||
for (link = &ctrl->link; link; link = link->next) {
|
||||
q921outstanding = 0;
|
||||
for (f = link->tx_queue; f; f = f->next) {
|
||||
++q921outstanding;
|
||||
}
|
||||
used = pri_snprintf(buf, used, buf_size, "Q921 Outstanding: %u (TEI=%d)\n",
|
||||
q921outstanding, link->tei);
|
||||
q921outstanding = 0;
|
||||
f = ctrl->txqueue;
|
||||
while (f) {
|
||||
q921outstanding++;
|
||||
f = f->next;
|
||||
}
|
||||
used = pri_snprintf(buf, used, buf_size, "Q921 Outstanding: %u\n", q921outstanding);
|
||||
#endif
|
||||
#if 0
|
||||
used = pri_snprintf(buf, used, buf_size, "Window Length: %d/%d\n",
|
||||
@@ -1619,7 +1471,7 @@ char *pri_dump_info_str(struct pri *ctrl)
|
||||
enum PRI_TIMERS_AND_COUNTERS tmr;
|
||||
|
||||
tmr = pri_timer[idx].number;
|
||||
if (0 <= ctrl->timers[tmr]) {
|
||||
if (0 <= ctrl->timers[tmr] || tmr == PRI_TIMER_T309) {
|
||||
used = pri_snprintf(buf, used, buf_size, " %s: %d\n",
|
||||
pri_timer[idx].name, ctrl->timers[tmr]);
|
||||
}
|
||||
@@ -1635,59 +1487,18 @@ char *pri_dump_info_str(struct pri *ctrl)
|
||||
|
||||
int pri_get_crv(struct pri *pri, q931_call *call, int *callmode)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
return -1;
|
||||
}
|
||||
return q931_call_getcrv(pri, call, callmode);
|
||||
}
|
||||
|
||||
int pri_set_crv(struct pri *pri, q931_call *call, int crv, int callmode)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call)) {
|
||||
return -1;
|
||||
}
|
||||
return q931_call_setcrv(pri, call, crv, callmode);
|
||||
}
|
||||
|
||||
void pri_enslave(struct pri *master, struct pri *slave)
|
||||
{
|
||||
if (!master || !slave) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (slave->master) {
|
||||
struct pri *swp;
|
||||
|
||||
/* The slave already has a master */
|
||||
if (master->master || master->slave) {
|
||||
/* The new master has a master or it already has slaves. */
|
||||
return;
|
||||
}
|
||||
|
||||
/* Swap master and slave. */
|
||||
swp = master;
|
||||
master = slave;
|
||||
slave = master;
|
||||
}
|
||||
|
||||
/*
|
||||
* To have some support for dynamic interfaces, the master NFAS
|
||||
* D channel control structure will always exist even if it is
|
||||
* abandoned/deleted by the upper layer. The master/slave
|
||||
* pointers ensure that the correct master will be used.
|
||||
*/
|
||||
|
||||
master = PRI_NFAS_MASTER(master);
|
||||
master->nfas = 1;
|
||||
slave->nfas = 1;
|
||||
slave->callpool = &master->localpool;
|
||||
|
||||
/* Link the slave to the master on the end of the master's list. */
|
||||
slave->master = master;
|
||||
slave->slave = NULL;
|
||||
for (; master->slave; master = master->slave) {
|
||||
}
|
||||
master->slave = slave;
|
||||
if (master && slave)
|
||||
slave->callpool = &master->localpool;
|
||||
}
|
||||
|
||||
struct pri_sr *pri_sr_new(void)
|
||||
@@ -1819,6 +1630,7 @@ void pri_sr_set_keypad_digits(struct pri_sr *sr, const char *keypad_digits)
|
||||
void pri_transfer_enable(struct pri *ctrl, int enable)
|
||||
{
|
||||
if (ctrl) {
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->transfer_support = enable ? 1 : 0;
|
||||
}
|
||||
}
|
||||
@@ -1826,13 +1638,14 @@ void pri_transfer_enable(struct pri *ctrl, int enable)
|
||||
void pri_hold_enable(struct pri *ctrl, int enable)
|
||||
{
|
||||
if (ctrl) {
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->hold_support = enable ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
int pri_hold(struct pri *ctrl, q931_call *call)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
return q931_send_hold(ctrl, call);
|
||||
@@ -1840,7 +1653,7 @@ int pri_hold(struct pri *ctrl, q931_call *call)
|
||||
|
||||
int pri_hold_ack(struct pri *ctrl, q931_call *call)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
return q931_send_hold_ack(ctrl, call);
|
||||
@@ -1848,7 +1661,7 @@ int pri_hold_ack(struct pri *ctrl, q931_call *call)
|
||||
|
||||
int pri_hold_rej(struct pri *ctrl, q931_call *call, int cause)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
return q931_send_hold_rej(ctrl, call, cause);
|
||||
@@ -1856,7 +1669,7 @@ int pri_hold_rej(struct pri *ctrl, q931_call *call, int cause)
|
||||
|
||||
int pri_retrieve(struct pri *ctrl, q931_call *call, int channel)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
return q931_send_retrieve(ctrl, call, channel);
|
||||
@@ -1864,7 +1677,7 @@ int pri_retrieve(struct pri *ctrl, q931_call *call, int channel)
|
||||
|
||||
int pri_retrieve_ack(struct pri *ctrl, q931_call *call, int channel)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
return q931_send_retrieve_ack(ctrl, call, channel);
|
||||
@@ -1872,7 +1685,7 @@ int pri_retrieve_ack(struct pri *ctrl, q931_call *call, int channel)
|
||||
|
||||
int pri_retrieve_rej(struct pri *ctrl, q931_call *call, int cause)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
return q931_send_retrieve_rej(ctrl, call, cause);
|
||||
@@ -1880,9 +1693,8 @@ int pri_retrieve_rej(struct pri *ctrl, q931_call *call, int cause)
|
||||
|
||||
int pri_callrerouting_facility(struct pri *pri, q931_call *call, const char *dest, const char* original, const char* reason)
|
||||
{
|
||||
if (!pri || !pri_is_call_valid(pri, call) || !dest) {
|
||||
if (!pri || !call || !dest)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return qsig_cf_callrerouting(pri, call, dest, original, reason);
|
||||
}
|
||||
@@ -1890,6 +1702,7 @@ int pri_callrerouting_facility(struct pri *pri, q931_call *call, const char *des
|
||||
void pri_reroute_enable(struct pri *ctrl, int enable)
|
||||
{
|
||||
if (ctrl) {
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->deflection_support = enable ? 1 : 0;
|
||||
}
|
||||
}
|
||||
@@ -1900,7 +1713,7 @@ int pri_reroute_call(struct pri *ctrl, q931_call *call, const struct pri_party_i
|
||||
struct q931_party_id local_caller;
|
||||
struct q931_party_redirecting reroute;
|
||||
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call) || !deflection) {
|
||||
if (!ctrl || !call || !deflection) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1941,6 +1754,7 @@ int pri_reroute_call(struct pri *ctrl, q931_call *call, const struct pri_party_i
|
||||
void pri_cc_enable(struct pri *ctrl, int enable)
|
||||
{
|
||||
if (ctrl) {
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->cc_support = enable ? 1 : 0;
|
||||
}
|
||||
}
|
||||
@@ -1948,6 +1762,7 @@ void pri_cc_enable(struct pri *ctrl, int enable)
|
||||
void pri_cc_recall_mode(struct pri *ctrl, int mode)
|
||||
{
|
||||
if (ctrl) {
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->cc.option.recall_mode = mode ? 1 : 0;
|
||||
}
|
||||
}
|
||||
@@ -1955,6 +1770,7 @@ void pri_cc_recall_mode(struct pri *ctrl, int mode)
|
||||
void pri_cc_retain_signaling_req(struct pri *ctrl, int signaling_retention)
|
||||
{
|
||||
if (ctrl && 0 <= signaling_retention && signaling_retention < 3) {
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->cc.option.signaling_retention_req = signaling_retention;
|
||||
}
|
||||
}
|
||||
@@ -1962,6 +1778,7 @@ void pri_cc_retain_signaling_req(struct pri *ctrl, int signaling_retention)
|
||||
void pri_cc_retain_signaling_rsp(struct pri *ctrl, int signaling_retention)
|
||||
{
|
||||
if (ctrl) {
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->cc.option.signaling_retention_rsp = signaling_retention ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
25
pri_aoc.c
25
pri_aoc.c
@@ -212,7 +212,7 @@ void aoc_etsi_aoc_request(struct pri *ctrl, q931_call *call, const struct rose_m
|
||||
struct pri_subcommand *subcmd;
|
||||
int request;
|
||||
|
||||
if (!ctrl->aoc_support) {
|
||||
if (!PRI_MASTER(ctrl)->aoc_support) {
|
||||
send_facility_error(ctrl, call, invoke->invoke_id, ROSE_ERROR_Gen_NotSubscribed);
|
||||
return;
|
||||
}
|
||||
@@ -439,7 +439,7 @@ void aoc_etsi_aoc_s_currency(struct pri *ctrl, const struct rose_msg_invoke *inv
|
||||
{
|
||||
struct pri_subcommand *subcmd;
|
||||
|
||||
if (!ctrl->aoc_support) {
|
||||
if (!PRI_MASTER(ctrl)->aoc_support) {
|
||||
return;
|
||||
}
|
||||
subcmd = q931_alloc_subcommand(ctrl);
|
||||
@@ -470,7 +470,7 @@ void aoc_etsi_aoc_s_special_arrangement(struct pri *ctrl, const struct rose_msg_
|
||||
{
|
||||
struct pri_subcommand *subcmd;
|
||||
|
||||
if (!ctrl->aoc_support) {
|
||||
if (!PRI_MASTER(ctrl)->aoc_support) {
|
||||
return;
|
||||
}
|
||||
subcmd = q931_alloc_subcommand(ctrl);
|
||||
@@ -535,7 +535,7 @@ void aoc_etsi_aoc_d_currency(struct pri *ctrl, const struct rose_msg_invoke *inv
|
||||
{
|
||||
struct pri_subcommand *subcmd;
|
||||
|
||||
if (!ctrl->aoc_support) {
|
||||
if (!PRI_MASTER(ctrl)->aoc_support) {
|
||||
return;
|
||||
}
|
||||
subcmd = q931_alloc_subcommand(ctrl);
|
||||
@@ -577,7 +577,7 @@ void aoc_etsi_aoc_d_charging_unit(struct pri *ctrl, const struct rose_msg_invoke
|
||||
{
|
||||
struct pri_subcommand *subcmd;
|
||||
|
||||
if (!ctrl->aoc_support) {
|
||||
if (!PRI_MASTER(ctrl)->aoc_support) {
|
||||
return;
|
||||
}
|
||||
subcmd = q931_alloc_subcommand(ctrl);
|
||||
@@ -760,7 +760,7 @@ void aoc_etsi_aoc_e_currency(struct pri *ctrl, q931_call *call, const struct ros
|
||||
{
|
||||
struct pri_subcommand *subcmd;
|
||||
|
||||
if (!ctrl->aoc_support) {
|
||||
if (!PRI_MASTER(ctrl)->aoc_support) {
|
||||
return;
|
||||
}
|
||||
subcmd = q931_alloc_subcommand(ctrl);
|
||||
@@ -828,7 +828,7 @@ void aoc_etsi_aoc_e_charging_unit(struct pri *ctrl, q931_call *call, const struc
|
||||
}
|
||||
}
|
||||
|
||||
if (!ctrl->aoc_support) {
|
||||
if (!PRI_MASTER(ctrl)->aoc_support) {
|
||||
return;
|
||||
}
|
||||
subcmd = q931_alloc_subcommand(ctrl);
|
||||
@@ -869,6 +869,7 @@ void aoc_etsi_aoc_e_charging_unit(struct pri *ctrl, q931_call *call, const struc
|
||||
void pri_aoc_events_enable(struct pri *ctrl, int enable)
|
||||
{
|
||||
if (ctrl) {
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->aoc_support = enable ? 1 : 0;
|
||||
}
|
||||
}
|
||||
@@ -1609,7 +1610,7 @@ static int aoc_e_encode(struct pri *ctrl, q931_call *call, const struct pri_subc
|
||||
|
||||
int pri_aoc_de_request_response_send(struct pri *ctrl, q931_call *call, int response, int invoke_id)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1628,7 +1629,7 @@ int pri_aoc_de_request_response_send(struct pri *ctrl, q931_call *call, int resp
|
||||
|
||||
int pri_aoc_s_request_response_send(struct pri *ctrl, q931_call *call, int invoke_id, const struct pri_subcmd_aoc_s *aoc_s)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1691,7 +1692,7 @@ int aoc_charging_request_send(struct pri *ctrl, q931_call *call, enum PRI_AOC_RE
|
||||
|
||||
int pri_aoc_s_send(struct pri *ctrl, q931_call *call, const struct pri_subcmd_aoc_s *aoc_s)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1710,7 +1711,7 @@ int pri_aoc_s_send(struct pri *ctrl, q931_call *call, const struct pri_subcmd_ao
|
||||
|
||||
int pri_aoc_d_send(struct pri *ctrl, q931_call *call, const struct pri_subcmd_aoc_d *aoc_d)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1728,7 +1729,7 @@ int pri_aoc_d_send(struct pri *ctrl, q931_call *call, const struct pri_subcmd_ao
|
||||
|
||||
int pri_aoc_e_send(struct pri *ctrl, q931_call *call, const struct pri_subcmd_aoc_e *aoc_e)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
82
pri_cc.c
82
pri_cc.c
@@ -61,6 +61,7 @@ struct pri_cc_record *pri_cc_find_by_reference(struct pri *ctrl, unsigned refere
|
||||
{
|
||||
struct pri_cc_record *cc_record;
|
||||
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
for (cc_record = ctrl->cc.pool; cc_record; cc_record = cc_record->next) {
|
||||
if (cc_record->ccbs_reference_id == reference_id) {
|
||||
/* Found the record */
|
||||
@@ -84,6 +85,7 @@ struct pri_cc_record *pri_cc_find_by_linkage(struct pri *ctrl, unsigned linkage_
|
||||
{
|
||||
struct pri_cc_record *cc_record;
|
||||
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
for (cc_record = ctrl->cc.pool; cc_record; cc_record = cc_record->next) {
|
||||
if (cc_record->call_linkage_id == linkage_id) {
|
||||
/* Found the record */
|
||||
@@ -108,6 +110,7 @@ static struct pri_cc_record *pri_cc_find_by_id(struct pri *ctrl, long cc_id)
|
||||
{
|
||||
struct pri_cc_record *cc_record;
|
||||
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
for (cc_record = ctrl->cc.pool; cc_record; cc_record = cc_record->next) {
|
||||
if (cc_record->record_id == cc_id) {
|
||||
/* Found the record */
|
||||
@@ -231,6 +234,7 @@ struct pri_cc_record *pri_cc_find_by_addressing(struct pri *ctrl, const struct q
|
||||
struct q931_party_address addr_a;
|
||||
struct q931_party_address addr_b;
|
||||
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
addr_a = *party_a;
|
||||
addr_b = *party_b;
|
||||
for (cc_record = ctrl->cc.pool; cc_record; cc_record = cc_record->next) {
|
||||
@@ -262,6 +266,7 @@ static int pri_cc_new_reference_id(struct pri *ctrl)
|
||||
long reference_id;
|
||||
long first_id;
|
||||
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->cc.last_reference_id = (ctrl->cc.last_reference_id + 1) & 0x7F;
|
||||
reference_id = ctrl->cc.last_reference_id;
|
||||
first_id = reference_id;
|
||||
@@ -293,6 +298,7 @@ static int pri_cc_new_linkage_id(struct pri *ctrl)
|
||||
long linkage_id;
|
||||
long first_id;
|
||||
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->cc.last_linkage_id = (ctrl->cc.last_linkage_id + 1) & 0x7F;
|
||||
linkage_id = ctrl->cc.last_linkage_id;
|
||||
first_id = linkage_id;
|
||||
@@ -324,6 +330,7 @@ static long pri_cc_new_id(struct pri *ctrl)
|
||||
long record_id;
|
||||
long first_id;
|
||||
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
record_id = ++ctrl->cc.last_record_id;
|
||||
first_id = record_id;
|
||||
while (pri_cc_find_by_id(ctrl, record_id)) {
|
||||
@@ -379,6 +386,7 @@ static void pri_cc_delete_record(struct pri *ctrl, struct pri_cc_record *doomed)
|
||||
}
|
||||
pri_cc_disassociate_signaling_link(doomed);
|
||||
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
for (prev = &ctrl->cc.pool, current = ctrl->cc.pool; current;
|
||||
prev = ¤t->next, current = current->next) {
|
||||
if (current == doomed) {
|
||||
@@ -405,6 +413,7 @@ struct pri_cc_record *pri_cc_new_record(struct pri *ctrl, q931_call *call)
|
||||
struct pri_cc_record *cc_record;
|
||||
long record_id;
|
||||
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
record_id = pri_cc_new_id(ctrl);
|
||||
if (record_id < 0) {
|
||||
return NULL;
|
||||
@@ -415,7 +424,7 @@ struct pri_cc_record *pri_cc_new_record(struct pri *ctrl, q931_call *call)
|
||||
}
|
||||
|
||||
/* Initialize the new record */
|
||||
cc_record->ctrl = ctrl;
|
||||
cc_record->master = ctrl;
|
||||
cc_record->record_id = record_id;
|
||||
cc_record->call_linkage_id = CC_PTMP_INVALID_ID;/* So it will never be found this way */
|
||||
cc_record->ccbs_reference_id = CC_PTMP_INVALID_ID;/* So it will never be found this way */
|
||||
@@ -966,7 +975,7 @@ static unsigned char *enc_qsig_cc_request(struct pri *ctrl,
|
||||
|
||||
//msg.args.qsig.CcbsRequest.can_retain_service = 0;
|
||||
|
||||
switch (ctrl->cc.option.signaling_retention_req) {
|
||||
switch (PRI_MASTER(ctrl)->cc.option.signaling_retention_req) {
|
||||
case 0:/* Want release signaling link. */
|
||||
cc_record->option.retain_signaling_link = 0;
|
||||
|
||||
@@ -1945,6 +1954,7 @@ static unsigned char *enc_etsi_ptmp_cc_interrogate_rsp_general(struct pri *ctrl,
|
||||
struct q931_party_number party_a_number;
|
||||
const struct pri_cc_record *cc_record;
|
||||
unsigned char *new_pos;
|
||||
struct pri *master;
|
||||
unsigned idx;
|
||||
|
||||
pos = facility_encode_header(ctrl, pos, end, NULL);
|
||||
@@ -1956,7 +1966,8 @@ static unsigned char *enc_etsi_ptmp_cc_interrogate_rsp_general(struct pri *ctrl,
|
||||
msg.invoke_id = invoke->invoke_id;
|
||||
msg.operation = invoke->operation;
|
||||
|
||||
msg.args.etsi.CCBSInterrogate.recall_mode = ctrl->cc.option.recall_mode;
|
||||
master = PRI_MASTER(ctrl);
|
||||
msg.args.etsi.CCBSInterrogate.recall_mode = master->cc.option.recall_mode;
|
||||
|
||||
/* Convert the given party A number. */
|
||||
q931_party_number_init(&party_a_number);
|
||||
@@ -1968,7 +1979,7 @@ static unsigned char *enc_etsi_ptmp_cc_interrogate_rsp_general(struct pri *ctrl,
|
||||
|
||||
/* Build the CallDetails list. */
|
||||
idx = 0;
|
||||
for (cc_record = ctrl->cc.pool; cc_record; cc_record = cc_record->next) {
|
||||
for (cc_record = master->cc.pool; cc_record; cc_record = cc_record->next) {
|
||||
if (cc_record->ccbs_reference_id == CC_PTMP_INVALID_ID
|
||||
|| (!cc_record->is_ccnr) != (invoke->operation == ROSE_ETSI_CCBSInterrogate)) {
|
||||
/*
|
||||
@@ -2076,7 +2087,7 @@ int pri_cc_interrogate_rsp(struct pri *ctrl, q931_call *call, const struct rose_
|
||||
{
|
||||
int encode_result;
|
||||
|
||||
if (!ctrl->cc_support) {
|
||||
if (!PRI_MASTER(ctrl)->cc_support) {
|
||||
/* Call completion is disabled. */
|
||||
return send_facility_error(ctrl, call, invoke->invoke_id,
|
||||
ROSE_ERROR_Gen_NotSubscribed);
|
||||
@@ -2123,7 +2134,7 @@ void pri_cc_ptmp_request(struct pri *ctrl, q931_call *call, const struct rose_ms
|
||||
{
|
||||
struct pri_cc_record *cc_record;
|
||||
|
||||
if (!ctrl->cc_support) {
|
||||
if (!PRI_MASTER(ctrl)->cc_support) {
|
||||
/* Call completion is disabled. */
|
||||
send_facility_error(ctrl, call, invoke->invoke_id,
|
||||
ROSE_ERROR_Gen_NotSubscribed);
|
||||
@@ -2180,7 +2191,7 @@ void pri_cc_ptp_request(struct pri *ctrl, q931_call *call, int msgtype, const st
|
||||
/* Ignore CC request message since it did not come in on the correct message. */
|
||||
return;
|
||||
}
|
||||
if (!ctrl->cc_support) {
|
||||
if (!PRI_MASTER(ctrl)->cc_support) {
|
||||
/* Call completion is disabled. */
|
||||
rose_error_msg_encode(ctrl, call, Q931_ANY_MESSAGE, invoke->invoke_id,
|
||||
ROSE_ERROR_Gen_NotSubscribed);
|
||||
@@ -2259,6 +2270,7 @@ void pri_cc_ptp_request(struct pri *ctrl, q931_call *call, int msgtype, const st
|
||||
*/
|
||||
void pri_cc_qsig_request(struct pri *ctrl, q931_call *call, int msgtype, const struct rose_msg_invoke *invoke)
|
||||
{
|
||||
struct pri *master;
|
||||
struct pri_cc_record *cc_record;
|
||||
struct q931_party_address party_a;
|
||||
struct q931_party_address party_b;
|
||||
@@ -2267,7 +2279,8 @@ void pri_cc_qsig_request(struct pri *ctrl, q931_call *call, int msgtype, const s
|
||||
/* Ignore CC request message since it did not come in on the correct message. */
|
||||
return;
|
||||
}
|
||||
if (!ctrl->cc_support) {
|
||||
master = PRI_MASTER(ctrl);
|
||||
if (!master->cc_support) {
|
||||
/* Call completion is disabled. */
|
||||
rose_error_msg_encode(ctrl, call, Q931_ANY_MESSAGE, invoke->invoke_id,
|
||||
ROSE_ERROR_QSIG_LongTermRejection);
|
||||
@@ -2289,7 +2302,7 @@ void pri_cc_qsig_request(struct pri *ctrl, q931_call *call, int msgtype, const s
|
||||
rose_copy_subaddress_to_q931(ctrl, &party_b.subaddress,
|
||||
&invoke->args.qsig.CcbsRequest.subaddr_b);
|
||||
|
||||
cc_record = pri_cc_find_by_addressing(ctrl, &party_a, &party_b,
|
||||
cc_record = pri_cc_find_by_addressing(master, &party_a, &party_b,
|
||||
invoke->args.qsig.CcbsRequest.q931ie.length,
|
||||
invoke->args.qsig.CcbsRequest.q931ie.contents);
|
||||
if (!cc_record || cc_record->state != CC_STATE_AVAILABLE) {
|
||||
@@ -2308,7 +2321,7 @@ void pri_cc_qsig_request(struct pri *ctrl, q931_call *call, int msgtype, const s
|
||||
} else {
|
||||
/* The originator does not care. Do how we are configured. */
|
||||
cc_record->option.retain_signaling_link =
|
||||
ctrl->cc.option.signaling_retention_rsp;
|
||||
master->cc.option.signaling_retention_rsp;
|
||||
}
|
||||
if (!cc_record->party_a.number.valid || cc_record->party_a.number.str[0] == '\0') {
|
||||
/*
|
||||
@@ -2613,9 +2626,6 @@ static const char *pri_cc_fsm_event_str(enum CC_EVENTS event)
|
||||
case CC_EVENT_CANCEL:
|
||||
str = "CC_EVENT_CANCEL";
|
||||
break;
|
||||
case CC_EVENT_INTERNAL_CLEARING:
|
||||
str = "CC_EVENT_INTERNAL_CLEARING";
|
||||
break;
|
||||
case CC_EVENT_SIGNALING_GONE:
|
||||
str = "CC_EVENT_SIGNALING_GONE";
|
||||
break;
|
||||
@@ -2795,7 +2805,7 @@ static void pri_cc_timeout_t_retention(void *data)
|
||||
struct pri_cc_record *cc_record = data;
|
||||
|
||||
cc_record->t_retention = 0;
|
||||
q931_cc_timeout(cc_record->ctrl, cc_record, CC_EVENT_TIMEOUT_T_RETENTION);
|
||||
q931_cc_timeout(cc_record->master, cc_record, CC_EVENT_TIMEOUT_T_RETENTION);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -2847,7 +2857,7 @@ static void pri_cc_timeout_extended_t_ccbs1(void *data)
|
||||
struct pri_cc_record *cc_record = data;
|
||||
|
||||
cc_record->fsm.ptmp.extended_t_ccbs1 = 0;
|
||||
q931_cc_timeout(cc_record->ctrl, cc_record, CC_EVENT_TIMEOUT_EXTENDED_T_CCBS1);
|
||||
q931_cc_timeout(cc_record->master, cc_record, CC_EVENT_TIMEOUT_EXTENDED_T_CCBS1);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -2901,7 +2911,7 @@ static void pri_cc_timeout_t_supervision(void *data)
|
||||
struct pri_cc_record *cc_record = data;
|
||||
|
||||
cc_record->t_supervision = 0;
|
||||
q931_cc_timeout(cc_record->ctrl, cc_record, CC_EVENT_TIMEOUT_T_SUPERVISION);
|
||||
q931_cc_timeout(cc_record->master, cc_record, CC_EVENT_TIMEOUT_T_SUPERVISION);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -2981,7 +2991,7 @@ static void pri_cc_timeout_t_recall(void *data)
|
||||
struct pri_cc_record *cc_record = data;
|
||||
|
||||
cc_record->t_recall = 0;
|
||||
q931_cc_timeout(cc_record->ctrl, cc_record, CC_EVENT_TIMEOUT_T_RECALL);
|
||||
q931_cc_timeout(cc_record->master, cc_record, CC_EVENT_TIMEOUT_T_RECALL);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -3745,7 +3755,7 @@ static void pri_cc_indirect_status_rsp_a(void *data)
|
||||
struct pri_cc_record *cc_record = data;
|
||||
|
||||
cc_record->t_indirect = 0;
|
||||
q931_cc_indirect(cc_record->ctrl, cc_record, pri_cc_fill_status_rsp_a);
|
||||
q931_cc_indirect(cc_record->master, cc_record, pri_cc_fill_status_rsp_a);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -3894,7 +3904,7 @@ static void pri_cc_indirect_status_a(void *data)
|
||||
struct pri_cc_record *cc_record = data;
|
||||
|
||||
cc_record->t_indirect = 0;
|
||||
q931_cc_indirect(cc_record->ctrl, cc_record, pri_cc_fill_status_a);
|
||||
q931_cc_indirect(cc_record->master, cc_record, pri_cc_fill_status_a);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -4251,7 +4261,7 @@ static void pri_cc_post_hangup_signaling(void *data)
|
||||
struct pri_cc_record *cc_record = data;
|
||||
|
||||
cc_record->t_indirect = 0;
|
||||
q931_cc_timeout(cc_record->ctrl, cc_record, CC_EVENT_HANGUP_SIGNALING);
|
||||
q931_cc_timeout(cc_record->master, cc_record, CC_EVENT_HANGUP_SIGNALING);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -4354,14 +4364,7 @@ static void pri_cc_fsm_ptmp_agent_pend_avail(struct pri *ctrl, q931_call *call,
|
||||
pri_cc_act_send_cc_available(ctrl, cc_record, call, Q931_DISCONNECT);
|
||||
cc_record->state = CC_STATE_AVAILABLE;
|
||||
break;
|
||||
case CC_EVENT_INTERNAL_CLEARING:
|
||||
pri_cc_act_release_link_id(ctrl, cc_record);
|
||||
pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
|
||||
pri_cc_act_set_self_destruct(ctrl, cc_record);
|
||||
cc_record->state = CC_STATE_IDLE;
|
||||
break;
|
||||
case CC_EVENT_CANCEL:
|
||||
pri_cc_act_release_link_id(ctrl, cc_record);
|
||||
pri_cc_act_set_self_destruct(ctrl, cc_record);
|
||||
cc_record->state = CC_STATE_IDLE;
|
||||
break;
|
||||
@@ -4394,10 +4397,6 @@ static void pri_cc_fsm_ptmp_agent_avail(struct pri *ctrl, q931_call *call, struc
|
||||
pri_cc_act_stop_t_retention(ctrl, cc_record);
|
||||
cc_record->state = CC_STATE_REQUESTED;
|
||||
break;
|
||||
case CC_EVENT_INTERNAL_CLEARING:
|
||||
pri_cc_act_stop_t_retention(ctrl, cc_record);
|
||||
pri_cc_act_start_t_retention(ctrl, cc_record);
|
||||
break;
|
||||
case CC_EVENT_TIMEOUT_T_RETENTION:
|
||||
pri_cc_act_send_erase_call_linkage_id(ctrl, cc_record);
|
||||
pri_cc_act_release_link_id(ctrl, cc_record);
|
||||
@@ -5289,11 +5288,6 @@ static void pri_cc_fsm_ptp_agent_pend_avail(struct pri *ctrl, q931_call *call, s
|
||||
pri_cc_act_send_cc_available(ctrl, cc_record, call, Q931_DISCONNECT);
|
||||
cc_record->state = CC_STATE_AVAILABLE;
|
||||
break;
|
||||
case CC_EVENT_INTERNAL_CLEARING:
|
||||
pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
|
||||
pri_cc_act_set_self_destruct(ctrl, cc_record);
|
||||
cc_record->state = CC_STATE_IDLE;
|
||||
break;
|
||||
case CC_EVENT_CANCEL:
|
||||
pri_cc_act_set_self_destruct(ctrl, cc_record);
|
||||
cc_record->state = CC_STATE_IDLE;
|
||||
@@ -5334,10 +5328,6 @@ static void pri_cc_fsm_ptp_agent_avail(struct pri *ctrl, q931_call *call, struct
|
||||
pri_cc_act_stop_t_retention(ctrl, cc_record);
|
||||
cc_record->state = CC_STATE_REQUESTED;
|
||||
break;
|
||||
case CC_EVENT_INTERNAL_CLEARING:
|
||||
pri_cc_act_stop_t_retention(ctrl, cc_record);
|
||||
pri_cc_act_start_t_retention(ctrl, cc_record);
|
||||
break;
|
||||
case CC_EVENT_TIMEOUT_T_RETENTION:
|
||||
pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
|
||||
pri_cc_act_stop_t_retention(ctrl, cc_record);
|
||||
@@ -5937,10 +5927,6 @@ static void pri_cc_fsm_qsig_agent_avail(struct pri *ctrl, q931_call *call, struc
|
||||
pri_cc_act_stop_t_retention(ctrl, cc_record);
|
||||
cc_record->state = CC_STATE_REQUESTED;
|
||||
break;
|
||||
case CC_EVENT_INTERNAL_CLEARING:
|
||||
pri_cc_act_stop_t_retention(ctrl, cc_record);
|
||||
pri_cc_act_start_t_retention(ctrl, cc_record);
|
||||
break;
|
||||
case CC_EVENT_TIMEOUT_T_RETENTION:
|
||||
pri_cc_act_pass_up_cc_cancel(ctrl, cc_record);
|
||||
pri_cc_act_stop_t_retention(ctrl, cc_record);
|
||||
@@ -6817,7 +6803,7 @@ long pri_cc_available(struct pri *ctrl, q931_call *call)
|
||||
struct pri_cc_record *cc_record;
|
||||
long cc_id;
|
||||
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
if (call->cc.record) {
|
||||
@@ -6864,7 +6850,7 @@ long pri_cc_available(struct pri *ctrl, q931_call *call)
|
||||
break;
|
||||
}
|
||||
cc_record->call_linkage_id = linkage_id;
|
||||
cc_record->signaling = ctrl->link.dummy_call;
|
||||
cc_record->signaling = PRI_MASTER(ctrl)->dummy_call;
|
||||
} else {
|
||||
cc_record = pri_cc_new_record(ctrl, call);
|
||||
if (!cc_record) {
|
||||
@@ -6908,7 +6894,7 @@ void pri_cc_qsig_determine_available(struct pri *ctrl, q931_call *call)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ctrl->cc_support) {
|
||||
if (!PRI_MASTER(ctrl)->cc_support) {
|
||||
/*
|
||||
* Blocking the cc-available event effectively
|
||||
* disables call completion for outgoing calls.
|
||||
@@ -7825,7 +7811,7 @@ int pri_cc_call(struct pri *ctrl, long cc_id, q931_call *call, struct pri_sr *re
|
||||
{
|
||||
struct pri_cc_record *cc_record;
|
||||
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call) || !req) {
|
||||
if (!ctrl || !call || !req) {
|
||||
return -1;
|
||||
}
|
||||
cc_record = pri_cc_find_by_id(ctrl, cc_id);
|
||||
|
||||
@@ -1859,7 +1859,7 @@ int pri_mwi_indicate(struct pri *ctrl, const struct pri_party_id *mailbox,
|
||||
if (!BRI_NT_PTMP(ctrl)) {
|
||||
return -1;
|
||||
}
|
||||
call = ctrl->link.dummy_call;
|
||||
call = PRI_MASTER(ctrl)->dummy_call;
|
||||
if (!call) {
|
||||
return -1;
|
||||
}
|
||||
@@ -2556,9 +2556,8 @@ static int etsi_ect_link_id_rsp(enum APDU_CALLBACK_REASON reason, struct pri *ct
|
||||
|
||||
switch (reason) {
|
||||
case APDU_CALLBACK_REASON_MSG_RESULT:
|
||||
call_2 = apdu->response.user.ptr;
|
||||
if (!q931_is_call_valid(ctrl, call_2)) {
|
||||
/* Call is no longer present. */
|
||||
call_2 = q931_find_call(ctrl, apdu->response.user.value);
|
||||
if (!call_2) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2637,7 +2636,7 @@ int etsi_initiate_transfer(struct pri *ctrl, q931_call *call_1, q931_call *call_
|
||||
response.invoke_id = ctrl->last_invoke;
|
||||
response.timeout_time = ctrl->timers[PRI_TIMER_T_RESPONSE];
|
||||
response.callback = etsi_ect_link_id_rsp;
|
||||
response.user.ptr = call_2;
|
||||
response.user.value = call_2->cr;
|
||||
|
||||
/* Remember that if we queue a facility IE for a facility message we
|
||||
* have to explicitly send the facility message ourselves */
|
||||
@@ -3633,7 +3632,7 @@ int pri_rerouting_rsp(struct pri *ctrl, q931_call *call, int invoke_id, enum PRI
|
||||
{
|
||||
enum rose_error_code rose_err;
|
||||
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -3674,7 +3673,7 @@ int pri_rerouting_rsp(struct pri *ctrl, q931_call *call, int invoke_id, enum PRI
|
||||
|
||||
int pri_transfer_rsp(struct pri *ctrl, q931_call *call, int invoke_id, int is_successful)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -3805,7 +3804,7 @@ static int rose_mcid_req_encode(struct pri *ctrl, q931_call *call)
|
||||
|
||||
int pri_mcid_req_send(struct pri *ctrl, q931_call *call)
|
||||
{
|
||||
if (!ctrl || !pri_is_call_valid(ctrl, call)) {
|
||||
if (!ctrl || !call) {
|
||||
return -1;
|
||||
}
|
||||
if (call->cc.originated) {
|
||||
@@ -3825,6 +3824,7 @@ int pri_mcid_req_send(struct pri *ctrl, q931_call *call)
|
||||
void pri_mcid_enable(struct pri *ctrl, int enable)
|
||||
{
|
||||
if (ctrl) {
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
ctrl->mcid_support = enable ? 1 : 0;
|
||||
}
|
||||
}
|
||||
@@ -3881,7 +3881,7 @@ void rose_handle_reject(struct pri *ctrl, q931_call *call, int msgtype, q931_ie
|
||||
* Look for the original invocation message on the
|
||||
* broadcast dummy call reference call first.
|
||||
*/
|
||||
orig_call = ctrl->link.dummy_call;
|
||||
orig_call = PRI_MASTER(ctrl)->dummy_call;
|
||||
if (orig_call) {
|
||||
apdu = pri_call_apdu_find(orig_call, reject->invoke_id);
|
||||
}
|
||||
@@ -3965,7 +3965,7 @@ void rose_handle_error(struct pri *ctrl, q931_call *call, int msgtype, q931_ie *
|
||||
* Look for the original invocation message on the
|
||||
* broadcast dummy call reference call first.
|
||||
*/
|
||||
orig_call = ctrl->link.dummy_call;
|
||||
orig_call = PRI_MASTER(ctrl)->dummy_call;
|
||||
if (orig_call) {
|
||||
apdu = pri_call_apdu_find(orig_call, error->invoke_id);
|
||||
}
|
||||
@@ -4041,7 +4041,7 @@ void rose_handle_result(struct pri *ctrl, q931_call *call, int msgtype, q931_ie
|
||||
* Look for the original invocation message on the
|
||||
* broadcast dummy call reference call first.
|
||||
*/
|
||||
orig_call = ctrl->link.dummy_call;
|
||||
orig_call = PRI_MASTER(ctrl)->dummy_call;
|
||||
if (orig_call) {
|
||||
apdu = pri_call_apdu_find(orig_call, result->invoke_id);
|
||||
}
|
||||
@@ -4098,7 +4098,7 @@ void rose_handle_invoke(struct pri *ctrl, q931_call *call, int msgtype, q931_ie
|
||||
break;
|
||||
#endif /* Not handled yet */
|
||||
case ROSE_ETSI_CallDeflection:
|
||||
if (!ctrl->deflection_support) {
|
||||
if (!PRI_MASTER(ctrl)->deflection_support) {
|
||||
send_facility_error(ctrl, call, invoke->invoke_id,
|
||||
ROSE_ERROR_Gen_NotSubscribed);
|
||||
break;
|
||||
@@ -4166,7 +4166,7 @@ void rose_handle_invoke(struct pri *ctrl, q931_call *call, int msgtype, q931_ie
|
||||
&deflection);
|
||||
break;
|
||||
case ROSE_ETSI_CallRerouting:
|
||||
if (!ctrl->deflection_support) {
|
||||
if (!PRI_MASTER(ctrl)->deflection_support) {
|
||||
send_facility_error(ctrl, call, invoke->invoke_id,
|
||||
ROSE_ERROR_Gen_NotSubscribed);
|
||||
break;
|
||||
@@ -4364,7 +4364,7 @@ void rose_handle_invoke(struct pri *ctrl, q931_call *call, int msgtype, q931_ie
|
||||
break;
|
||||
#endif /* Not handled yet */
|
||||
case ROSE_ETSI_EctExecute:
|
||||
if (!ctrl->transfer_support) {
|
||||
if (!PRI_MASTER(ctrl)->transfer_support) {
|
||||
send_facility_error(ctrl, call, invoke->invoke_id,
|
||||
ROSE_ERROR_Gen_NotSubscribed);
|
||||
break;
|
||||
@@ -4389,7 +4389,7 @@ void rose_handle_invoke(struct pri *ctrl, q931_call *call, int msgtype, q931_ie
|
||||
break;
|
||||
#endif /* Not handled yet */
|
||||
case ROSE_ETSI_EctLinkIdRequest:
|
||||
if (!ctrl->transfer_support) {
|
||||
if (!PRI_MASTER(ctrl)->transfer_support) {
|
||||
send_facility_error(ctrl, call, invoke->invoke_id,
|
||||
ROSE_ERROR_Gen_ResourceUnavailable);
|
||||
break;
|
||||
@@ -4429,7 +4429,7 @@ void rose_handle_invoke(struct pri *ctrl, q931_call *call, int msgtype, q931_ie
|
||||
break;
|
||||
#endif /* defined(STATUS_REQUEST_PLACE_HOLDER) */
|
||||
case ROSE_ETSI_CallInfoRetain:
|
||||
if (!ctrl->cc_support) {
|
||||
if (!PRI_MASTER(ctrl)->cc_support) {
|
||||
/*
|
||||
* Blocking the cc-available event effectively
|
||||
* disables call completion for outgoing calls.
|
||||
@@ -4444,7 +4444,7 @@ void rose_handle_invoke(struct pri *ctrl, q931_call *call, int msgtype, q931_ie
|
||||
if (!cc_record) {
|
||||
break;
|
||||
}
|
||||
cc_record->signaling = ctrl->link.dummy_call;
|
||||
cc_record->signaling = PRI_MASTER(ctrl)->dummy_call;
|
||||
/*
|
||||
* Since we received this facility, we will not be allocating any
|
||||
* reference and linkage id's.
|
||||
@@ -4644,7 +4644,7 @@ void rose_handle_invoke(struct pri *ctrl, q931_call *call, int msgtype, q931_ie
|
||||
pri_cc_event(ctrl, call, cc_record, CC_EVENT_REMOTE_USER_FREE);
|
||||
break;
|
||||
case ROSE_ETSI_CCBS_T_Available:
|
||||
if (!ctrl->cc_support) {
|
||||
if (!PRI_MASTER(ctrl)->cc_support) {
|
||||
/*
|
||||
* Blocking the cc-available event effectively
|
||||
* disables call completion for outgoing calls.
|
||||
@@ -4668,7 +4668,7 @@ void rose_handle_invoke(struct pri *ctrl, q931_call *call, int msgtype, q931_ie
|
||||
/* Don't even dignify this with a response. */
|
||||
break;
|
||||
}
|
||||
if (!ctrl->mcid_support) {
|
||||
if (!PRI_MASTER(ctrl)->mcid_support) {
|
||||
send_facility_error(ctrl, call, invoke->invoke_id,
|
||||
ROSE_ERROR_Gen_NotSubscribed);
|
||||
break;
|
||||
@@ -4876,7 +4876,7 @@ void rose_handle_invoke(struct pri *ctrl, q931_call *call, int msgtype, q931_ie
|
||||
break;
|
||||
#endif /* Not handled yet */
|
||||
case ROSE_QSIG_CallRerouting:
|
||||
if (!ctrl->deflection_support) {
|
||||
if (!PRI_MASTER(ctrl)->deflection_support) {
|
||||
send_facility_error(ctrl, call, invoke->invoke_id,
|
||||
ROSE_ERROR_Gen_NotSubscribed);
|
||||
break;
|
||||
|
||||
134
pri_internal.h
134
pri_internal.h
@@ -76,10 +76,8 @@ struct pri {
|
||||
void *userdata;
|
||||
/*! Accumulated pri_message() line. (Valid in master record only) */
|
||||
struct pri_msg_line *msg_line;
|
||||
/*! NFAS master/primary channel if appropriate */
|
||||
struct pri *master;
|
||||
/*! Next NFAS slaved D channel if appropriate */
|
||||
struct pri *slave;
|
||||
struct pri *subchannel; /* Sub-channel if appropriate */
|
||||
struct pri *master; /* Master channel if appropriate */
|
||||
struct {
|
||||
/*! Dynamically allocated array of timers that can grow as needed. */
|
||||
struct pri_sched *timer;
|
||||
@@ -95,9 +93,9 @@ struct pri {
|
||||
int localtype; /* Local network type (unknown, network, cpe) */
|
||||
int remotetype; /* Remote network type (unknown, network, cpe) */
|
||||
|
||||
int protodisc; /* Layer 3 protocol discriminator */
|
||||
|
||||
unsigned int nfas:1;/* TRUE if this D channel is involved with an NFAS group */
|
||||
int sapi;
|
||||
int tei;
|
||||
int protodisc;
|
||||
unsigned int bri:1;
|
||||
unsigned int acceptinbanddisconnect:1; /* Should we allow inband progress after DISCONNECT? */
|
||||
unsigned int sendfacility:1;
|
||||
@@ -113,27 +111,57 @@ struct pri {
|
||||
unsigned int manual_connect_ack:1;/* TRUE if the CONNECT_ACKNOWLEDGE is sent with API call */
|
||||
unsigned int mcid_support:1;/* TRUE if the upper layer supports MCID */
|
||||
|
||||
/*! Layer 2 link control for D channel. */
|
||||
struct q921_link link;
|
||||
/*! T201 TEI Identity Check timer. */
|
||||
int t201_timer;
|
||||
/*! Number of times T201 has expired. */
|
||||
int t201_expirycnt;
|
||||
/* MDL variables */
|
||||
int mdl_error;
|
||||
int mdl_error_state;
|
||||
int mdl_timer;
|
||||
int mdl_free_me;
|
||||
|
||||
/* Q.921 State */
|
||||
int q921_state;
|
||||
int RC;
|
||||
int peer_rx_busy:1;
|
||||
int own_rx_busy:1;
|
||||
int acknowledge_pending:1;
|
||||
int reject_exception:1;
|
||||
|
||||
int v_s; /* Next N(S) for transmission */
|
||||
int v_a; /* Last acknowledged frame */
|
||||
int v_r; /* Next frame expected to be received */
|
||||
|
||||
int cref; /* Next call reference value */
|
||||
|
||||
int l3initiated;
|
||||
|
||||
/* Various timers */
|
||||
int t203_timer; /* Max idle time */
|
||||
int t202_timer;
|
||||
int n202_counter;
|
||||
int ri;
|
||||
int t200_timer; /* T-200 retransmission timer */
|
||||
/* All ISDN Timer values */
|
||||
int timers[PRI_MAX_TIMERS];
|
||||
|
||||
/* Used by scheduler */
|
||||
struct timeval tv;
|
||||
int schedev;
|
||||
pri_event ev; /* Static event thingy */
|
||||
/*! Subcommands for static event thingy. */
|
||||
struct pri_subcommands subcmds;
|
||||
|
||||
/* Q.921 Re-transmission queue */
|
||||
struct q921_frame *txqueue;
|
||||
|
||||
/* Q.931 calls */
|
||||
struct q931_call **callpool;
|
||||
struct q931_call *localpool;
|
||||
q931_call **callpool;
|
||||
q931_call *localpool;
|
||||
|
||||
/*!
|
||||
* \brief Q.931 Dummy call reference call associated with this TEI.
|
||||
* \note If present then this call is allocated as part of the
|
||||
* D channel control structure.
|
||||
*/
|
||||
q931_call *dummy_call;
|
||||
|
||||
#ifdef LIBPRI_COUNTERS
|
||||
/* q921/q931 packet counters */
|
||||
@@ -341,6 +369,10 @@ struct pri_sr {
|
||||
int aoc_charging_request;
|
||||
};
|
||||
|
||||
/* Internal switch types */
|
||||
#define PRI_SWITCH_GR303_EOC_PATH 19
|
||||
#define PRI_SWITCH_GR303_TMC_SWITCHING 20
|
||||
|
||||
#define Q931_MAX_TEI 8
|
||||
|
||||
/*! \brief Incoming call transfer states. */
|
||||
@@ -415,10 +447,9 @@ struct decoded_bc {
|
||||
|
||||
/* q931_call datastructure */
|
||||
struct q931_call {
|
||||
struct pri *pri; /* D channel controller (master) */
|
||||
struct q921_link *link; /* Q.921 link associated with this call. */
|
||||
struct q931_call *next;
|
||||
struct pri *pri; /* PRI */
|
||||
int cr; /* Call Reference */
|
||||
q931_call *next;
|
||||
/* Slotmap specified (bitmap of channels 31/24-1) (Channel Identifier IE) (-1 means not specified) */
|
||||
int slotmap;
|
||||
/* An explicit channel (Channel Identifier IE) (-1 means not specified) */
|
||||
@@ -559,7 +590,7 @@ struct q931_call {
|
||||
int is_link_id_valid;
|
||||
|
||||
/* Bridged call info */
|
||||
struct q931_call *bridged_call; /* Pointer to other leg of bridged call (Used by Q.SIG when eliminating tromboned calls) */
|
||||
q931_call *bridged_call; /* Pointer to other leg of bridged call (Used by Q.SIG when eliminating tromboned calls) */
|
||||
|
||||
int changestatus; /* SERVICE message changestatus */
|
||||
int reversecharge; /* Reverse charging indication:
|
||||
@@ -668,8 +699,6 @@ enum CC_EVENTS {
|
||||
CC_EVENT_LINK_CANCEL,
|
||||
/*! Tear down CC request from upper layer. */
|
||||
CC_EVENT_CANCEL,
|
||||
/*! Abnormal clearing of original call. (T309 processing/T309 timeout/TEI removal) */
|
||||
CC_EVENT_INTERNAL_CLEARING,
|
||||
/*! Received message indicating tear down of CC signaling link completed. */
|
||||
CC_EVENT_SIGNALING_GONE,
|
||||
/*! Delayed hangup request for the signaling link to allow subcmd events to be passed up. */
|
||||
@@ -715,8 +744,8 @@ enum CC_PARTY_A_AVAILABILITY {
|
||||
struct pri_cc_record {
|
||||
/*! Next call-completion record in the list */
|
||||
struct pri_cc_record *next;
|
||||
/*! D channel control structure. */
|
||||
struct pri *ctrl;
|
||||
/*! Master D channel control structure. */
|
||||
struct pri *master;
|
||||
/*! Original call that is offered CC availability. (NULL if no longer exists.) */
|
||||
struct q931_call *original_call;
|
||||
/*!
|
||||
@@ -852,35 +881,11 @@ struct d_ctrl_dummy {
|
||||
struct q931_call dummy_call;
|
||||
};
|
||||
|
||||
/*! Layer 2 link control structure with associated dummy call reference record. */
|
||||
struct link_dummy {
|
||||
/*! Layer 2 control structure. Must be first in the structure. */
|
||||
struct q921_link link;
|
||||
/*! Dummy call reference call record. */
|
||||
struct q931_call dummy_call;
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief Check if the given call ptr is valid and gripe if not.
|
||||
*
|
||||
* \param ctrl D channel controller.
|
||||
* \param call Q.931 call leg.
|
||||
*
|
||||
* \retval TRUE if call ptr is valid.
|
||||
* \retval FALSE if call ptr is invalid.
|
||||
*/
|
||||
#define pri_is_call_valid(ctrl, call) \
|
||||
q931_is_call_valid_gripe(ctrl, call, __PRETTY_FUNCTION__, __LINE__)
|
||||
|
||||
int q931_is_call_valid(struct pri *ctrl, struct q931_call *call);
|
||||
int q931_is_call_valid_gripe(struct pri *ctrl, struct q931_call *call, const char *func_name, unsigned long func_line);
|
||||
|
||||
extern int pri_schedule_event(struct pri *pri, int ms, void (*function)(void *data), void *data);
|
||||
|
||||
extern pri_event *pri_schedule_run(struct pri *pri);
|
||||
|
||||
extern void pri_schedule_del(struct pri *pri, int ev);
|
||||
int pri_schedule_check(struct pri *ctrl, int id, void (*function)(void *data), void *data);
|
||||
|
||||
extern pri_event *pri_mkerror(struct pri *pri, char *errstr);
|
||||
|
||||
@@ -889,10 +894,10 @@ void pri_error(struct pri *ctrl, const char *fmt, ...) __attribute__((format(pri
|
||||
|
||||
void libpri_copy_string(char *dst, const char *src, size_t size);
|
||||
|
||||
void pri_link_destroy(struct q921_link *link);
|
||||
struct q921_link *pri_link_new(struct pri *ctrl, int sapi, int tei);
|
||||
struct pri *__pri_new_tei(int fd, int node, int switchtype, struct pri *master, pri_io_cb rd, pri_io_cb wr, void *userdata, int tei, int bri);
|
||||
void __pri_free_tei(struct pri *p);
|
||||
|
||||
void q931_init_call_record(struct q921_link *link, struct q931_call *call, int cr);
|
||||
void q931_init_call_record(struct pri *ctrl, struct q931_call *call, int cr);
|
||||
|
||||
void pri_sr_init(struct pri_sr *req);
|
||||
|
||||
@@ -962,13 +967,13 @@ int q931_cc_timeout(struct pri *ctrl, struct pri_cc_record *cc_record, enum CC_E
|
||||
void q931_cc_indirect(struct pri *ctrl, struct pri_cc_record *cc_record, void (*func)(struct pri *ctrl, q931_call *call, struct pri_cc_record *cc_record));
|
||||
|
||||
/*!
|
||||
* \brief Get the NFAS master PRI control structure.
|
||||
* \brief Get the master PRI control structure.
|
||||
*
|
||||
* \param ctrl D channel controller.
|
||||
*
|
||||
* \return NFAS master PRI control structure.
|
||||
* \return Master PRI control structure.
|
||||
*/
|
||||
static inline struct pri *PRI_NFAS_MASTER(struct pri *ctrl)
|
||||
static inline struct pri *PRI_MASTER(struct pri *ctrl)
|
||||
{
|
||||
while (ctrl->master) {
|
||||
ctrl = ctrl->master;
|
||||
@@ -988,8 +993,10 @@ static inline int BRI_NT_PTMP(const struct pri *ctrl)
|
||||
{
|
||||
struct pri *my_ctrl = (struct pri *) ctrl;
|
||||
|
||||
/* Check master control structure */
|
||||
my_ctrl = PRI_MASTER(my_ctrl);
|
||||
return my_ctrl->bri && my_ctrl->localtype == PRI_NETWORK
|
||||
&& my_ctrl->link.tei == Q921_TEI_GROUP;
|
||||
&& my_ctrl->tei == Q921_TEI_GROUP;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1004,8 +1011,10 @@ static inline int BRI_TE_PTMP(const struct pri *ctrl)
|
||||
{
|
||||
struct pri *my_ctrl = (struct pri *) ctrl;
|
||||
|
||||
/* Check master control structure */
|
||||
my_ctrl = PRI_MASTER(my_ctrl);
|
||||
return my_ctrl->bri && my_ctrl->localtype == PRI_CPE
|
||||
&& my_ctrl->link.tei == Q921_TEI_GROUP;
|
||||
&& my_ctrl->tei == Q921_TEI_GROUP;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1020,6 +1029,8 @@ static inline int NT_MODE(const struct pri *ctrl)
|
||||
{
|
||||
struct pri *my_ctrl = (struct pri *) ctrl;
|
||||
|
||||
/* Check master control structure */
|
||||
my_ctrl = PRI_MASTER(my_ctrl);
|
||||
return my_ctrl->localtype == PRI_NETWORK;
|
||||
}
|
||||
|
||||
@@ -1035,6 +1046,8 @@ static inline int TE_MODE(const struct pri *ctrl)
|
||||
{
|
||||
struct pri *my_ctrl = (struct pri *) ctrl;
|
||||
|
||||
/* Check master control structure */
|
||||
my_ctrl = PRI_MASTER(my_ctrl);
|
||||
return my_ctrl->localtype == PRI_CPE;
|
||||
}
|
||||
|
||||
@@ -1050,7 +1063,9 @@ static inline int PTP_MODE(const struct pri *ctrl)
|
||||
{
|
||||
struct pri *my_ctrl = (struct pri *) ctrl;
|
||||
|
||||
return my_ctrl->link.tei == Q921_TEI_PRI;
|
||||
/* Check master control structure */
|
||||
my_ctrl = PRI_MASTER(my_ctrl);
|
||||
return my_ctrl->tei == Q921_TEI_PRI;
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -1065,7 +1080,9 @@ static inline int PTMP_MODE(const struct pri *ctrl)
|
||||
{
|
||||
struct pri *my_ctrl = (struct pri *) ctrl;
|
||||
|
||||
return my_ctrl->link.tei == Q921_TEI_GROUP;
|
||||
/* Check master control structure */
|
||||
my_ctrl = PRI_MASTER(my_ctrl);
|
||||
return my_ctrl->tei == Q921_TEI_GROUP;
|
||||
}
|
||||
|
||||
#define Q931_DUMMY_CALL_REFERENCE -1
|
||||
@@ -1077,13 +1094,14 @@ static inline int PTMP_MODE(const struct pri *ctrl)
|
||||
* \retval TRUE if given call is a dummy call.
|
||||
* \retval FALSE otherwise.
|
||||
*/
|
||||
static inline int q931_is_dummy_call(const struct q931_call *call)
|
||||
static inline int q931_is_dummy_call(const q931_call *call)
|
||||
{
|
||||
return (call->cr == Q931_DUMMY_CALL_REFERENCE) ? 1 : 0;
|
||||
}
|
||||
|
||||
static inline short get_invokeid(struct pri *ctrl)
|
||||
{
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
return ++ctrl->last_invoke;
|
||||
}
|
||||
|
||||
|
||||
101
pri_q921.h
101
pri_q921.h
@@ -57,8 +57,6 @@
|
||||
#define Q921_TEI_GR303_EOC_OPS 4
|
||||
#define Q921_TEI_GR303_TMC_SWITCHING 0
|
||||
#define Q921_TEI_GR303_TMC_CALLPROC 0
|
||||
#define Q921_TEI_AUTO_FIRST 64
|
||||
#define Q921_TEI_AUTO_LAST 126
|
||||
|
||||
#define Q921_SAPI_CALL_CTRL 0
|
||||
#define Q921_SAPI_GR303_EOC 1
|
||||
@@ -71,16 +69,13 @@
|
||||
#define Q921_SAPI_LAYER2_MANAGEMENT 63
|
||||
|
||||
|
||||
/*! Q.921 TEI management message type */
|
||||
enum q921_tei_identity {
|
||||
Q921_TEI_IDENTITY_REQUEST = 1,
|
||||
Q921_TEI_IDENTITY_ASSIGNED = 2,
|
||||
Q921_TEI_IDENTITY_DENIED = 3,
|
||||
Q921_TEI_IDENTITY_CHECK_REQUEST = 4,
|
||||
Q921_TEI_IDENTITY_CHECK_RESPONSE = 5,
|
||||
Q921_TEI_IDENTITY_REMOVE = 6,
|
||||
Q921_TEI_IDENTITY_VERIFY = 7,
|
||||
};
|
||||
#define Q921_TEI_IDENTITY_REQUEST 1
|
||||
#define Q921_TEI_IDENTITY_ASSIGNED 2
|
||||
#define Q921_TEI_IDENTITY_DENIED 3
|
||||
#define Q921_TEI_IDENTITY_CHECK_REQUEST 4
|
||||
#define Q921_TEI_IDENTITY_CHECK_RESPONSE 5
|
||||
#define Q921_TEI_IDENTITY_REMOVE 6
|
||||
#define Q921_TEI_IDENTITY_VERIFY 7
|
||||
|
||||
typedef struct q921_header {
|
||||
#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
@@ -185,82 +180,6 @@ typedef enum q921_state {
|
||||
Q921_TIMER_RECOVERY = 8,
|
||||
} q921_state;
|
||||
|
||||
/*! TEI identity check procedure states. */
|
||||
enum q921_tei_check_state {
|
||||
/*! Not participating in the TEI check procedure. */
|
||||
Q921_TEI_CHECK_NONE,
|
||||
/*! No reply to TEI check received. */
|
||||
Q921_TEI_CHECK_DEAD,
|
||||
/*! Reply to TEI check received in current poll. */
|
||||
Q921_TEI_CHECK_REPLY,
|
||||
/*! No reply to current TEI check poll received. A previous poll got a reply. */
|
||||
Q921_TEI_CHECK_DEAD_REPLY,
|
||||
};
|
||||
|
||||
/*! \brief Q.921 link controller structure */
|
||||
struct q921_link {
|
||||
/*! Next Q.921 link in the chain. */
|
||||
struct q921_link *next;
|
||||
/*! D channel controller associated with this link. */
|
||||
struct pri *ctrl;
|
||||
|
||||
/*!
|
||||
* \brief Q.931 Dummy call reference call associated with this TEI.
|
||||
*
|
||||
* \note If present then this call is allocated with the D
|
||||
* channel control structure or the link control structure
|
||||
* unless this is the TE PTMP broadcast TEI or a GR303 link.
|
||||
*/
|
||||
struct q931_call *dummy_call;
|
||||
|
||||
/*! Q.921 Re-transmission queue */
|
||||
struct q921_frame *tx_queue;
|
||||
|
||||
/*! Q.921 State */
|
||||
enum q921_state state;
|
||||
|
||||
/*! TEI identity check procedure state. */
|
||||
enum q921_tei_check_state tei_check;
|
||||
|
||||
/*! Service Access Profile Identifier (SAPI) of this link */
|
||||
int sapi;
|
||||
/*! Terminal Endpoint Identifier (TEI) of this link */
|
||||
int tei;
|
||||
/*! TEI assignment random indicator. */
|
||||
int ri;
|
||||
|
||||
/*! V(A) - Next I-frame sequence number needing ack */
|
||||
int v_a;
|
||||
/*! V(S) - Next I-frame sequence number to send */
|
||||
int v_s;
|
||||
/*! V(R) - Next I-frame sequence number expected to receive */
|
||||
int v_r;
|
||||
|
||||
/* Various timers */
|
||||
|
||||
/*! T-200 retransmission timer */
|
||||
int t200_timer;
|
||||
/*! Retry Count (T200) */
|
||||
int RC;
|
||||
int t202_timer;
|
||||
int n202_counter;
|
||||
/*! Max idle time */
|
||||
int t203_timer;
|
||||
/*! PTP restart delay timer */
|
||||
int restart_timer;
|
||||
|
||||
/* MDL variables */
|
||||
int mdl_timer;
|
||||
int mdl_error;
|
||||
unsigned int mdl_free_me:1;
|
||||
|
||||
unsigned int peer_rx_busy:1;
|
||||
unsigned int own_rx_busy:1;
|
||||
unsigned int acknowledge_pending:1;
|
||||
unsigned int reject_exception:1;
|
||||
unsigned int l3_initiated:1;
|
||||
};
|
||||
|
||||
static inline int Q921_ADD(int a, int b)
|
||||
{
|
||||
return (a + b) % 128;
|
||||
@@ -270,15 +189,15 @@ static inline int Q921_ADD(int a, int b)
|
||||
extern void q921_dump(struct pri *pri, q921_h *h, int len, int showraw, int txrx);
|
||||
|
||||
/* Bring up the D-channel */
|
||||
void q921_start(struct q921_link *link);
|
||||
extern void q921_start(struct pri *pri);
|
||||
|
||||
//extern void q921_reset(struct pri *pri, int reset_iqueue);
|
||||
|
||||
extern pri_event *q921_receive(struct pri *pri, q921_h *h, int len);
|
||||
|
||||
int q921_transmit_iframe(struct q921_link *link, void *buf, int len, int cr);
|
||||
extern int q921_transmit_iframe(struct pri *pri, int tei, void *buf, int len, int cr);
|
||||
|
||||
int q921_transmit_uiframe(struct q921_link *link, void *buf, int len);
|
||||
extern int q921_transmit_uiframe(struct pri *pri, void *buf, int len);
|
||||
|
||||
extern pri_event *q921_dchannel_up(struct pri *pri);
|
||||
|
||||
|
||||
17
pri_q931.h
17
pri_q931.h
@@ -450,11 +450,13 @@ enum Q931_RANKED_CALL_STATE {
|
||||
|
||||
extern int maintenance_service(struct pri *pri, int span, int channel, int changestatus);
|
||||
|
||||
extern int maintenance_service_ack(struct pri *pri, q931_call *call);
|
||||
|
||||
|
||||
/* Q.SIG specific */
|
||||
#define QSIG_IE_TRANSIT_COUNT 0x31
|
||||
|
||||
int q931_receive(struct q921_link *link, q931_h *h, int len);
|
||||
extern int q931_receive(struct pri *pri, int tei, q931_h *h, int len);
|
||||
|
||||
extern int q931_alerting(struct pri *pri, q931_call *call, int channel, int info);
|
||||
|
||||
@@ -489,7 +491,8 @@ extern int q931_call_getcrv(struct pri *pri, q931_call *call, int *callmode);
|
||||
|
||||
extern int q931_call_setcrv(struct pri *pri, q931_call *call, int crv, int callmode);
|
||||
|
||||
struct q931_call *q931_new_call(struct pri *ctrl);
|
||||
struct q931_call *q931_find_call(struct pri *ctrl, int cr);
|
||||
struct q931_call *q931_new_call(struct pri *pri);
|
||||
|
||||
extern int q931_setup(struct pri *pri, q931_call *c, struct pri_sr *req);
|
||||
|
||||
@@ -499,15 +502,7 @@ void q931_dump(struct pri *ctrl, int tei, q931_h *h, int len, int txrx);
|
||||
|
||||
void q931_destroycall(struct pri *pri, q931_call *c);
|
||||
|
||||
enum Q931_DL_EVENT {
|
||||
Q931_DL_EVENT_NONE,
|
||||
Q931_DL_EVENT_DL_ESTABLISH_IND,
|
||||
Q931_DL_EVENT_DL_ESTABLISH_CONFIRM,
|
||||
Q931_DL_EVENT_DL_RELEASE_IND,
|
||||
Q931_DL_EVENT_DL_RELEASE_CONFIRM,
|
||||
Q931_DL_EVENT_TEI_REMOVAL,
|
||||
};
|
||||
void q931_dl_event(struct q921_link *link, enum Q931_DL_EVENT event);
|
||||
extern void q931_dl_indication(struct pri *pri, int event);
|
||||
|
||||
int q931_send_hold(struct pri *ctrl, struct q931_call *call);
|
||||
int q931_send_hold_ack(struct pri *ctrl, struct q931_call *call);
|
||||
|
||||
38
prisched.c
38
prisched.c
@@ -112,6 +112,9 @@ int pri_schedule_event(struct pri *ctrl, int ms, void (*function)(void *data), v
|
||||
unsigned x;
|
||||
struct timeval tv;
|
||||
|
||||
/* Scheduling runs on master channels only */
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
|
||||
max_used = ctrl->sched.max_used;
|
||||
for (x = 0; x < max_used; ++x) {
|
||||
if (!ctrl->sched.timer[x].callback) {
|
||||
@@ -153,6 +156,9 @@ struct timeval *pri_schedule_next(struct pri *ctrl)
|
||||
struct timeval *closest = NULL;
|
||||
unsigned x;
|
||||
|
||||
/* Scheduling runs on master channels only */
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
|
||||
/* Scan the scheduled timer slots backwards so we can update the max_used value. */
|
||||
for (x = ctrl->sched.max_used; x--;) {
|
||||
if (ctrl->sched.timer[x].callback) {
|
||||
@@ -190,6 +196,9 @@ static pri_event *__pri_schedule_run(struct pri *ctrl, struct timeval *tv)
|
||||
void (*callback)(void *);
|
||||
void *data;
|
||||
|
||||
/* Scheduling runs on master channels only */
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
|
||||
max_used = ctrl->sched.max_used;
|
||||
for (x = 0; x < max_used; ++x) {
|
||||
if (ctrl->sched.timer[x].callback
|
||||
@@ -237,6 +246,9 @@ pri_event *pri_schedule_run(struct pri *ctrl)
|
||||
*/
|
||||
void pri_schedule_del(struct pri *ctrl, int id)
|
||||
{
|
||||
/* Scheduling runs on master channels only */
|
||||
ctrl = PRI_MASTER(ctrl);
|
||||
|
||||
if (0 < id && id <= ctrl->sched.num_slots) {
|
||||
ctrl->sched.timer[id - 1].callback = NULL;
|
||||
} else if (id) {
|
||||
@@ -244,29 +256,3 @@ void pri_schedule_del(struct pri *ctrl, int id)
|
||||
ctrl->sched.num_slots);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Is the scheduled event this callback.
|
||||
*
|
||||
* \param ctrl D channel controller.
|
||||
* \param id Scheduled event id to check.
|
||||
* 0 is a disabled/unscheduled event id.
|
||||
* 1 - MAX_SCHED is a valid event id.
|
||||
* \param function Callback function to call when timeout.
|
||||
* \param data Value to give callback function when timeout.
|
||||
*
|
||||
* \return TRUE if scheduled event has the callback.
|
||||
*/
|
||||
int pri_schedule_check(struct pri *ctrl, int id, void (*function)(void *data), void *data)
|
||||
{
|
||||
if (0 < id && id <= ctrl->sched.num_slots) {
|
||||
if (ctrl->sched.timer[id - 1].callback == function
|
||||
&& ctrl->sched.timer[id - 1].data == data) {
|
||||
return 1;
|
||||
}
|
||||
} else if (id) {
|
||||
pri_error(ctrl, "Asked to check sched id %d??? num_slots=%d\n", id,
|
||||
ctrl->sched.num_slots);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user