a3c75996047b69fd78d081970a8caf723c6b2948
[lcr.git] / callchan.cpp
1 /*****************************************************************************\
2 **                                                                           **
3 ** PBX4Linux                                                                 **
4 **                                                                           **
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg                                              **
7 **                                                                           **
8 ** call functions for channel driver                                         **
9 **                                                                           **
10 \*****************************************************************************/ 
11
12 #include <stdio.h>
13 #include <string.h>
14 #include <stdlib.h>
15 //#include <unistd.h>
16 //#include <poll.h>
17 //#include <sys/types.h>
18 //#include <sys/stat.h>
19 //#include <fcntl.h>
20 #include "main.h"
21 //#define __u8 unsigned char
22 //#define __u16 unsigned short
23 //#define __u32 unsigned long
24 //#include "linux/isdnif.h"
25
26
27 /*
28  * constructor for a new call 
29  * the call will have a relation to the calling endpoint
30  */
31 CallChan::CallChan(class Endpoint *epoint) : Call(epoint)
32 {
33         if (!epoint)
34         {
35                 PERROR("software error, epoint is NULL.\n");
36                 exit(-1);
37         }
38
39         PDEBUG(DEBUG_CALL, "creating new call and connecting it to the endpoint.\n");
40
41         c_type = CALL_TYPE_ASTERISK;
42         c_epoint_id = epoint->ep_serial;
43
44         PDEBUG(DEBUG_CALL, "Constructor(new call)");
45 }
46
47
48 /*
49  * call descructor
50  */
51 CallChan::~CallChan()
52 {
53
54 }
55
56
57 /* release call from endpoint
58  * if the call has two relations, all relations are freed and the call will be
59  * destroyed 
60  */
61 void CallChan::release(unsigned long epoint_id, int hold, int location, int cause)
62 {
63         if (!epoint_id)
64         {
65                 PERROR("software error, epoint is NULL.\n");
66                 return;
67         }
68
69         c_epoint_id = 0;
70         
71         PDEBUG(DEBUG_CALL, "call_release(): ended.\n");
72 }
73
74
75 /* call process is called from the main loop
76  * it processes the current calling state.
77  * returns 0 if call nothing was done
78  */
79 int CallChan::handler(void)
80 {
81         return(0);
82 }
83
84 void CallChan::message_epoint(unsigned long epoint_id, int message_type, union parameter *param)
85 {
86 }
87