X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=endpointapp.cpp;h=da797de148d3c916d56fdda7c24c925c08ca8c42;hp=158b3d61fdb28b95e92451e402d78ac21b183518;hb=f854931ffbee9464b278c433c4fdc7c3ea5af2fb;hpb=8bb49ccb7b3eba0a3f20d3b097541304b3580f70 diff --git a/endpointapp.cpp b/endpointapp.cpp index 158b3d6..da797de 100644 --- a/endpointapp.cpp +++ b/endpointapp.cpp @@ -14,9 +14,10 @@ /* * EndpointApp constructor */ -EndpointApp::EndpointApp(class Endpoint *epoint, int origin) +EndpointApp::EndpointApp(class Endpoint *epoint, int origin, int type) { ea_endpoint = epoint; + ea_type = type; classuse++; } @@ -40,3 +41,26 @@ void EndpointApp::ea_message_join(unsigned int join_id, int message_type, union PDEBUG(DEBUG_EPOINT, "%s: Spare function.\n", __FUNCTION__); } + +/* create endpoint app */ +class EndpointApp *new_endpointapp(class Endpoint *epoint, int origin, int type) +{ + class EndpointApp *app = NULL; + + switch (type) { + case EAPP_TYPE_PBX: + app = new EndpointAppPBX(epoint, origin); + break; + case EAPP_TYPE_BRIDGE: + app = new EndpointAppBridge(epoint, origin); + break; + } + + if (!app) + FATAL("Failed to create endpoint APP (type %d)\n", type); + + epoint->ep_app_type = type; + epoint->ep_app = app; + + return app; +}