1 /*****************************************************************************/
2 /* */
3 /* ICEI.CC */
4 /* */
5 /* (C) 1996 Ullrich von Bassewitz */
6 /* Wacholderweg 14 */
7 /* D-70597 Stuttgart */
8 /* EMail: uz@ibb.schwaben.com */
9 /* */
10 /*****************************************************************************/
11
12
13
14 // $Id$
15 //
16 // $Log$
17 //
18 //
19
20
21
22 // This is an interface module to connect other software to ESTIC. All
23 // important information regarding the Istec is routed through the event
24 // handler below. Just fill in your code...
25
26
27
28 #include "event.h"
29 #include "str.h"
30
31 #include "icevents.h"
32 #include "devstate.h"
33 #include "iccli.h"
34
35
36
37 /*****************************************************************************/
38 /* class ExternalInterface */
39 /*****************************************************************************/
40
41
42
43 class ExternalInterface: public EventHandler {
44
45 public:
46 virtual void HandleEvent (Event& E);
47 // Handle incoming events.
48
49 };
50
51
52
HandleEvent(Event & E)53 void ExternalInterface::HandleEvent (Event& E)
54 {
55 // Switch on the type of event
56 switch (E.What) {
57
58 case evInit:
59 // This event is posted if the initialization of ESTIC is
60 // complete. All resources are already valid if this event
61 // comes in. Add your own stuff if you have to.
62 break;
63
64 case evExit:
65 // This event is posted from the applications constructor if
66 // application is shutting down. All resources are still valid
67 // when this event happens.
68 break;
69
70 case evAbort:
71 // This event is posted in an emergency situation if spunk
72 // detected an internal processing error. It is usually *not*
73 // followed by an evExit event.
74 // Beware: The application may be in an unstable state if this
75 // event happens, so you cannot rely on anything. Place critical
76 // cleanup code here but only if needed.
77 break;
78
79 case evIdle:
80 // This event is posted if the application is idle. You cannot
81 // rely on any specific calling frequency, this event may or
82 // may not be posted. But if you have something, that must be
83 // done in a regular manner, do it here...
84 break;
85
86 case evSecondChange:
87 // This event may be posted if the application is idle and a
88 // new second has begun. Used for clocks or other stuff.
89 break;
90
91 case evMinuteChange:
92 // This event may be posted if the application is idle and a
93 // new minute has begun. Used for clocks or other stuff.
94 break;
95
96 case evChargeUpdate:
97 // This event is posted if something is written to the Charges
98 // variable in module iccom. This does not mean that the charges
99 // have really changed, but on the other side, the charges do
100 // not change without posting this event.
101 break;
102
103 case evMatrixChange:
104 // A device had a change in the connection matrix or the dialed
105 // number. E.Info.P points to the DevStateInfo object that had
106 // the change.
107 break;
108
109 case evCallLogMsg:
110 // This event is posted after a call is complete. E.Info.O
111 // contains a pointer to a string with the complete log message.
112 // If you need more specific information, have a look at
113 // evCallComplete.
114 break;
115
116 case evCallComplete:
117 // This event is posted after an external call is complete.
118 // E.Info.O is a pointer to a DevStateInfo object that contains
119 // complete information about the call.
120 break;
121
122 case evIncomingCall:
123 // Posted when the istec detects an incoming call and sends the
124 // CLI message. E.Info.O is a pointer to a CLI object that
125 // contains the calling partys number and more information.
126 break;
127
128 }
129
130 }
131
132
133
134 /*****************************************************************************/
135 /* Data */
136 /*****************************************************************************/
137
138
139
140 // Declare a static ExternalInterface object to have the event handler called
141 static ExternalInterface EI;
142
143
144
145