- dbg("Exit");
- return;
-}
-
-static void s_call_info_mo_cfc(CoreObject *o)
-{
- TcorePlugin *plugin = NULL;
- CallObject *co = NULL;
- int id = 0;
-
- dbg("Entry");
-
- // Parent plugin
- plugin = tcore_object_ref_plugin(o);
-
- // Call Core object
- co = tcore_call_object_current_on_mo_processing(o);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Call ID
- id = tcore_call_object_get_id(co);
-
- // Send notification to TAPI
- tcore_server_send_notification(tcore_plugin_ref_server(plugin),
- tcore_plugin_ref_core_object(plugin, "call"),
- TNOTI_CALL_INFO_FORWARD_CONDITIONAL,
- sizeof(unsigned int),
- (void *) &id);
-
- dbg("Exit");
- return;
-}
-
-static void s_call_info_mt_cli(CoreObject *o, enum tcore_call_cli_mode mode, char *number)
-{
- CallObject *co = NULL;
-
- dbg("Entry");
-
- // Call Core object
- co = tcore_call_object_current_on_mt_processing(o);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Set CLI information
- tcore_call_object_set_cli_info(co, mode, number);
-
- dbg("Exit");
- return;
-}
-
-static void s_call_info_mt_cna(CoreObject *o, enum tcore_call_cna_mode mode, char *name, int dcs)
-{
- CallObject *co = NULL;
-
- dbg("Entry");
-
- // Call Core object
- co = tcore_call_object_current_on_mt_processing(o);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Set CNA information
- tcore_call_object_set_cna_info(co, mode, name, dcs);
-
- dbg("Exit");
- return;
-}
-
-static void s_call_info_mt_forwarded_call(CoreObject *o, char *number)
-{
- TcorePlugin *plugin = NULL;
- CallObject *co = NULL;
- int id = 0;
-
- dbg("Entry");
-
- // Parent plugin
- plugin = tcore_object_ref_plugin(o);
-
- // Call Core object
- co = tcore_call_object_find_by_number(o, number);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Call ID
- id = tcore_call_object_get_id(co);
-
- // Send notification to TAPI
- tcore_server_send_notification(tcore_plugin_ref_server(plugin),
- tcore_plugin_ref_core_object(plugin, "call"),
- TNOTI_CALL_INFO_FORWARDED_CALL,
- sizeof(unsigned int),
- (void *) &id);
-
- dbg("Exit");
- return;
-}
-
-static void s_call_info_mt_deflected_call(CoreObject *o, char *number)
-{
- TcorePlugin *plugin = NULL;
- CallObject *co = NULL;
- int id = 0;
-
- dbg("Entry");
-
- // Parent plugin
- plugin = tcore_object_ref_plugin(o);
-
- // Call Core object
- co = tcore_call_object_find_by_number(o, number);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Call ID
- id = tcore_call_object_get_id(co);
-
- // Send notification to TAPI
- tcore_server_send_notification(tcore_plugin_ref_server(plugin),
- tcore_plugin_ref_core_object(plugin, "call"),
- TNOTI_CALL_INFO_DEFLECTED_CALL,
- sizeof(unsigned int),
- (void *) &id);
-
- dbg("Exit");
- return;
-}
-
-static void s_call_info_mt_transfered(CoreObject *o, char *number)
-{
- TcorePlugin *plugin = NULL;
- CallObject *co = NULL;
- int id = 0;
-
- dbg("Entry");
-
- // Parent plugin
- plugin = tcore_object_ref_plugin(o);
-
- // Call Core object
- co = tcore_call_object_find_by_number(o, number);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Call ID
- id = tcore_call_object_get_id(co);
-
- // Send notification to TAPI
- tcore_server_send_notification(tcore_plugin_ref_server(plugin),
- tcore_plugin_ref_core_object(plugin, "call"),
- TNOTI_CALL_INFO_TRANSFERED_CALL,
- sizeof(unsigned int),
- (void *) &id);
-
- dbg("Exit");
- return;
-}
-
-static void s_call_info_held(CoreObject *o, char *number)
-{
- TcorePlugin *plugin = NULL;
- CallObject *co = NULL;
- int id = 0;
-
- dbg("Entry");
-
- // Parent plugin
- plugin = tcore_object_ref_plugin(o);
-
- // Call Core object
- co = tcore_call_object_find_by_number(o, number);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Call ID
- id = tcore_call_object_get_id(co);
-
- // Send notification to TAPI
- tcore_server_send_notification(tcore_plugin_ref_server(plugin),
- tcore_plugin_ref_core_object(plugin, "call"),
- TNOTI_CALL_INFO_HELD,
- sizeof(unsigned int),
- (void *) &id);
-
- dbg("Exit");
- return;
-}
-
-static void s_call_info_active(CoreObject *o, char *number)
-{
- TcorePlugin *plugin = NULL;
- CallObject *co = NULL;
- int id = 0;
-
- dbg("Entry");
-
- // Parent plugin
- plugin = tcore_object_ref_plugin(o);
-
- // Call Core object
- co = tcore_call_object_find_by_number(o, number);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Call ID
- id = tcore_call_object_get_id(co);
-
- // Send notification to TAPI
- tcore_server_send_notification(tcore_plugin_ref_server(plugin),
- tcore_plugin_ref_core_object(plugin, "call"),
- TNOTI_CALL_INFO_ACTIVE,
- sizeof(unsigned int),
- (void *) &id);
-
- dbg("Exit");
- return;
-}
-
-static void s_call_info_joined(CoreObject *o, char *number)
-{
- TcorePlugin *plugin = NULL;
- CallObject *co = NULL;
- int id = 0;
-
- dbg("Entry");
-
- // Parent plugin
- plugin = tcore_object_ref_plugin(o);
-
- // Call Core object
- co = tcore_call_object_find_by_number(o, number);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Call ID
- id = tcore_call_object_get_id(co);
-
- // Send notification to TAPI
- tcore_server_send_notification(tcore_plugin_ref_server(plugin),
- tcore_plugin_ref_core_object(plugin, "call"),
- TNOTI_CALL_INFO_JOINED,
- sizeof(unsigned int),
- (void *) &id);
-
- dbg("Exit");
- return;
-}
-
-static void s_call_info_released_on_hold(CoreObject *o, char *number)
-{
- TcorePlugin *plugin = NULL;
- CallObject *co = NULL;
- int id = 0;
-
- dbg("Entry");
-
- // Parent plugin
- plugin = tcore_object_ref_plugin(o);
-
- // Call Core object
- co = tcore_call_object_find_by_number(o, number);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Call ID
- id = tcore_call_object_get_id(co);
-
- // Send notification to TAPI
- tcore_server_send_notification(tcore_plugin_ref_server(plugin),
- tcore_plugin_ref_core_object(plugin, "call"),
- TNOTI_CALL_INFO_RELEASED_ON_HOLD,
- sizeof(unsigned int),
- (void *) &id);
-
- dbg("Exit");
- return;
-}
-
-static void s_call_info_transfer_alert(CoreObject *o, char *number)
-{
- TcorePlugin *plugin = NULL;
- CallObject *co = NULL;
- int id = 0;
-
- dbg("Entry");
-
- // Parent plugin
- plugin = tcore_object_ref_plugin(o);
-
- // Call Core object
- co = tcore_call_object_find_by_number(o, number);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Call ID
- id = tcore_call_object_get_id(co);
-
- // Send notification to TAPI
- tcore_server_send_notification(tcore_plugin_ref_server(plugin),
- tcore_plugin_ref_core_object(plugin, "call"),
- TNOTI_CALL_INFO_TRANSFER_ALERT,
- sizeof(unsigned int),
- (void *) &id);
-
- dbg("Exit");
- return;
-}
-
-static void s_call_info_transfered(CoreObject *o, char *number)
-{
- TcorePlugin *plugin = NULL;
- CallObject *co = NULL;
- int id = 0;
-
- dbg("Entry");
-
- // Parent plugin
- plugin = tcore_object_ref_plugin(o);
-
- // Call Core object
- co = tcore_call_object_find_by_number(o, number);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Call ID
- id = tcore_call_object_get_id(co);
-
- // Send notification to TAPI
- tcore_server_send_notification(tcore_plugin_ref_server(plugin),
- tcore_plugin_ref_core_object(plugin, "call"),
- TNOTI_CALL_INFO_TRANSFERED,
- sizeof(unsigned int),
- (void *) &id);
-
- dbg("Exit");
- return;
-}
-
-static void s_call_info_cf_check_message(CoreObject *o, char *number)
-{
- TcorePlugin *plugin = NULL;
- CallObject *co = NULL;
- int id = 0;
-
- dbg("Entry");
-
- // Parent plugin
- plugin = tcore_object_ref_plugin(o);
-
- // Call Core object
- co = tcore_call_object_find_by_number(o, number);
- if (!co) {
- err("Failed to find Call Core object!");
- return;
- }
-
- // Call ID
- id = tcore_call_object_get_id(co);
-
- // Send notification to TAPI
- tcore_server_send_notification(tcore_plugin_ref_server(plugin),
- tcore_plugin_ref_core_object(plugin, "call"),
- TNOTI_CALL_INFO_CF_CHECK_MESSAGE,
- sizeof(unsigned int),
- (void *) &id);
-
- dbg("Exit");
- return;
-}
-
-// Call Information Operations
-static struct tcore_call_information_operations call_information_ops = {
- .mo_call_col = 0,
- .mo_call_waiting = s_call_info_mo_waiting,
- .mo_call_cug = 0,
- .mo_call_forwarded = s_call_info_mo_forwarded,
- .mo_call_barred_incoming = s_call_info_mo_barred_incoming,
- .mo_call_barred_outgoing = s_call_info_mo_barred_outgoing,
- .mo_call_deflected = s_call_info_mo_deflected,
- .mo_call_clir_suppression_reject = s_call_info_mo_clir_suppression_reject,
- .mo_call_cfu = s_call_info_mo_cfu,
- .mo_call_cfc = s_call_info_mo_cfc,
- .mt_call_cli = s_call_info_mt_cli,
- .mt_call_cna = s_call_info_mt_cna,
- .mt_call_forwarded_call = s_call_info_mt_forwarded_call,
- .mt_call_cug_call = 0,
- .mt_call_deflected_call = s_call_info_mt_deflected_call,
- .mt_call_transfered = s_call_info_mt_transfered,
- .call_held = s_call_info_held,
- .call_active = s_call_info_active,
- .call_joined = s_call_info_joined,
- .call_released_on_hold = s_call_info_released_on_hold,
- .call_transfer_alert = s_call_info_transfer_alert,
- .call_transfered = s_call_info_transfered,
- .call_cf_check_message = s_call_info_cf_check_message,
-};
-
-gboolean s_call_init(TcorePlugin *p, TcoreHal *h)
-{
- CoreObject *o = NULL;
- struct property_call_info *data = NULL;
-
- dbg("Entry");
-
- // Creating Call COre object
- o = tcore_call_new(p, "call", &call_ops, h);
- if (!o) {
- err("Failed to create Call Core Object");
- return FALSE;
- }
-
- // Set Call Operations
- tcore_call_information_set_operations(o, &call_information_ops);
-
- // Add Callbacks
- tcore_object_add_callback(o, "+XCALLSTAT", on_notification_call_info, NULL);
- tcore_object_add_callback(o, "+CLIP", on_notification_call_clip_info, NULL);
-
- // User Data
- data = calloc(sizeof(struct property_call_info *), 1);
- tcore_plugin_link_property(p, "CALL", data);
-
- dbg("Exit");