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
54 Call::Call(class Endpoint *epoint)
60 PERROR("software error, epoint is NULL.\n");
63 c_serial = call_serial++;
64 c_type = CALL_TYPE_NONE;
70 callp = &((*callp)->next);
82 class Call *cl, **clp;
97 PERROR("software error, call not in chain! exitting\n");
100 *clp = cl->next; /* detach from chain */
105 /* epoint sends a message to a call
108 void Call::message_epoint(unsigned long epoint_id, int message_type, union parameter *param)
113 /* call process is called from the main loop
114 * it processes the current calling state.
115 * returns 0 if call nothing was done
117 int Call::handler(void)
122 void Call::release(unsigned long epoint_id, int hold, int location, int cause)
126 /* free all call structures */
132 PDEBUG(DEBUG_CALL, "no more pending call(s), done!\n");
137 if (options.deb & DEBUG_CALL)
139 PDEBUG(DEBUG_CALL, "freeing pending call\n");