1 /*****************************************************************************\
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg **
10 \*****************************************************************************/
17 //#include <sys/types.h>
18 //#include <sys/stat.h>
21 //#define __u8 unsigned char
22 //#define __u16 unsigned short
23 //#define __u32 unsigned long
24 //#include "linux/isdnif.h"
26 unsigned long call_serial = 1; /* must be 1, because 0== no call */
30 class Call *call_first = NULL;
33 * find the call with call_id
35 class Call *find_call_id(unsigned long call_id)
37 class Call *call = call_first;
41 //printf("comparing: '%s' with '%s'\n", name, call->c_name);
42 if (call->c_serial == call_id)
52 * constructor for a new call
58 c_serial = call_serial++;
59 c_type = CALL_TYPE_NONE;
65 callp = &((*callp)->next);
77 class Call *cl, **clp;
91 FATAL("software error, call not in chain!\n");
92 *clp = cl->next; /* detach from chain */
97 /* epoint sends a message to a call
100 void Call::message_epoint(unsigned long epoint_id, int message_type, union parameter *param)
105 /* call process is called from the main loop
106 * it processes the current calling state.
107 * returns 0 if call nothing was done
109 int Call::handler(void)
114 /* free all call structures */
120 PDEBUG(DEBUG_CALL, "no more pending call(s), done!\n");
125 if (options.deb & DEBUG_CALL)
127 PDEBUG(DEBUG_CALL, "freeing pending call\n");