mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-08 08:51:50 +00:00
dos2unix.
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@126 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
89046a6e5b
commit
96de29a23b
@ -94,98 +94,98 @@ int Q921Tx23Proc(L2TRUNK trunk, L2UCHAR *Msg, L2INT size)
|
|||||||
return trunk->Q921Tx23Proc(trunk->PrivateData23, Msg, size);
|
return trunk->Q921Tx23Proc(trunk->PrivateData23, Msg, size);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
|
||||||
|
|
||||||
Function: Q921TimeTick
|
|
||||||
|
|
||||||
Description: Called periodically from an external source to allow the
|
|
||||||
stack to process and maintain it's own timers.
|
|
||||||
|
|
||||||
Return Value: none
|
|
||||||
|
|
||||||
*****************************************************************************/
|
|
||||||
L2ULONG (*Q921GetTimeProc) ()=NULL; /* callback for func reading time in ms */
|
|
||||||
static L2ULONG tLast={0};
|
|
||||||
|
|
||||||
L2ULONG Q921GetTime()
|
|
||||||
{
|
|
||||||
L2ULONG tNow = 0;
|
|
||||||
if(Q921GetTimeProc != NULL)
|
|
||||||
{
|
|
||||||
tNow = Q921GetTimeProc();
|
|
||||||
if(tNow < tLast) /* wrapped */
|
|
||||||
{
|
|
||||||
/* TODO */
|
|
||||||
}
|
|
||||||
tLast = tNow;
|
|
||||||
}
|
|
||||||
return tNow;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Q921T200TimerStart(L2TRUNK trunk)
|
|
||||||
{
|
|
||||||
if (!trunk->T200) {
|
|
||||||
trunk->T200 = Q921GetTime() + trunk->T200Timeout;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Q921T200TimerStop(L2TRUNK trunk)
|
|
||||||
{
|
|
||||||
trunk->T200 = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Q921T200TimerReset(L2TRUNK trunk)
|
|
||||||
{
|
|
||||||
Q921T200TimerStop(trunk);
|
|
||||||
Q921T200TimerStart(trunk);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Q921T203TimerStart(L2TRUNK trunk)
|
/*****************************************************************************
|
||||||
{
|
|
||||||
if (!trunk->T203) {
|
Function: Q921TimeTick
|
||||||
trunk->T203 = Q921GetTime() + trunk->T203Timeout;
|
|
||||||
}
|
Description: Called periodically from an external source to allow the
|
||||||
}
|
stack to process and maintain it's own timers.
|
||||||
|
|
||||||
void Q921T203TimerStop(L2TRUNK trunk)
|
Return Value: none
|
||||||
{
|
|
||||||
trunk->T203 = 0;
|
*****************************************************************************/
|
||||||
}
|
L2ULONG (*Q921GetTimeProc) ()=NULL; /* callback for func reading time in ms */
|
||||||
|
static L2ULONG tLast={0};
|
||||||
void Q921T203TimerReset(L2TRUNK trunk)
|
|
||||||
{
|
L2ULONG Q921GetTime()
|
||||||
Q921T203TimerStop(trunk);
|
{
|
||||||
Q921T203TimerStart(trunk);
|
L2ULONG tNow = 0;
|
||||||
}
|
if(Q921GetTimeProc != NULL)
|
||||||
|
{
|
||||||
void Q921T200TimerExpire(L2TRUNK trunk)
|
tNow = Q921GetTimeProc();
|
||||||
{
|
if(tNow < tLast) /* wrapped */
|
||||||
(void)trunk;
|
{
|
||||||
}
|
/* TODO */
|
||||||
|
}
|
||||||
void Q921T203TimerExpire(L2TRUNK trunk)
|
tLast = tNow;
|
||||||
{
|
}
|
||||||
Q921T203TimerReset(trunk);
|
return tNow;
|
||||||
Q921SendRR(trunk, trunk->sapi, trunk->NetUser == Q921_TE ? 0 : 1, trunk->tei, 1);
|
}
|
||||||
}
|
|
||||||
|
void Q921T200TimerStart(L2TRUNK trunk)
|
||||||
void Q921TimerTick(L2TRUNK trunk)
|
{
|
||||||
{
|
if (!trunk->T200) {
|
||||||
L2ULONG tNow = Q921GetTime();
|
trunk->T200 = Q921GetTime() + trunk->T200Timeout;
|
||||||
if (trunk->T200 && tNow > trunk->T200) {
|
}
|
||||||
Q921T200TimerExpire(trunk);
|
}
|
||||||
}
|
|
||||||
if (trunk->T203 && tNow > trunk->T203) {
|
void Q921T200TimerStop(L2TRUNK trunk)
|
||||||
Q921T203TimerExpire(trunk);
|
{
|
||||||
}
|
trunk->T200 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Q921T200TimerReset(L2TRUNK trunk)
|
||||||
void Q921SetGetTimeCB(L2ULONG (*callback)())
|
{
|
||||||
{
|
Q921T200TimerStop(trunk);
|
||||||
Q921GetTimeProc = callback;
|
Q921T200TimerStart(trunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Q921T203TimerStart(L2TRUNK trunk)
|
||||||
|
{
|
||||||
|
if (!trunk->T203) {
|
||||||
|
trunk->T203 = Q921GetTime() + trunk->T203Timeout;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Q921T203TimerStop(L2TRUNK trunk)
|
||||||
|
{
|
||||||
|
trunk->T203 = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Q921T203TimerReset(L2TRUNK trunk)
|
||||||
|
{
|
||||||
|
Q921T203TimerStop(trunk);
|
||||||
|
Q921T203TimerStart(trunk);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Q921T200TimerExpire(L2TRUNK trunk)
|
||||||
|
{
|
||||||
|
(void)trunk;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Q921T203TimerExpire(L2TRUNK trunk)
|
||||||
|
{
|
||||||
|
Q921T203TimerReset(trunk);
|
||||||
|
Q921SendRR(trunk, trunk->sapi, trunk->NetUser == Q921_TE ? 0 : 1, trunk->tei, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Q921TimerTick(L2TRUNK trunk)
|
||||||
|
{
|
||||||
|
L2ULONG tNow = Q921GetTime();
|
||||||
|
if (trunk->T200 && tNow > trunk->T200) {
|
||||||
|
Q921T200TimerExpire(trunk);
|
||||||
|
}
|
||||||
|
if (trunk->T203 && tNow > trunk->T203) {
|
||||||
|
Q921T203TimerExpire(trunk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Q921SetGetTimeCB(L2ULONG (*callback)())
|
||||||
|
{
|
||||||
|
Q921GetTimeProc = callback;
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user