Disabled NUTAG_AUTO100, Entering PROCEEDING state after sending INVITE
[lcr.git] / endpointapp.cpp
1 /*****************************************************************************\
2 **                                                                           **
3 ** Linux Call Router                                                         **
4 **                                                                           **
5 **---------------------------------------------------------------------------**
6 ** Copyright: Andreas Eversberg                                              **
7 **                                                                           **
8 ** The EndpointApp represents the application for the Endpoint.              **
9 **                                                                           **
10 \*****************************************************************************/ 
11
12 #include "main.h"
13
14 /*
15  * EndpointApp constructor
16  */
17 EndpointApp::EndpointApp(class Endpoint *epoint, int origin, int type)
18 {
19         ea_endpoint = epoint;
20         ea_type = type;
21         classuse++;
22 }
23
24 /*
25  * endpoint destructor
26  */
27 EndpointApp::~EndpointApp(void)
28 {
29         classuse--;
30 }
31
32 /* mini application for test purpose only */
33
34 void EndpointApp::ea_message_port(unsigned int port_id, int message_type, union parameter *param)
35 {
36         PDEBUG(DEBUG_EPOINT, "%s: Spare function.\n", __FUNCTION__);
37 }
38
39 void EndpointApp::ea_message_join(unsigned int join_id, int message_type, union parameter *param)
40 {
41         PDEBUG(DEBUG_EPOINT, "%s: Spare function.\n", __FUNCTION__);
42 }
43
44
45 /* create endpoint app */
46 class EndpointApp *new_endpointapp(class Endpoint *epoint, int origin, int type)
47 {
48         class EndpointApp *app = NULL;
49
50         switch (type) {
51         case EAPP_TYPE_PBX:
52                 app = new EndpointAppPBX(epoint, origin);
53                 break;
54         case EAPP_TYPE_BRIDGE:
55                 app = new EndpointAppBridge(epoint, origin);
56                 break;
57         }
58
59         if (!app)
60                 FATAL("Failed to create endpoint APP (type %d)\n", type);
61
62         epoint->ep_app_type = type;
63         epoint->ep_app = app;
64
65         return app;
66 }