7 /*****************************************************************************/
8 /* Local prototypes. */
9 /*****************************************************************************/
10 static void demo_service(void);
12 int main(int argc, char ** argv)
14 EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
15 EVENT_HEADER * heartbeat = NULL;
17 printf("\nHello AT&T Vendor Event world!\n");
23 "Usage: %s <FQDN>|<IP address> <port> "
24 "<username> <password>\n", argv[0]);
28 /***************************************************************************/
30 /***************************************************************************/
31 if (evel_initialize(argv[1], /* FQDN */
32 atoi(argv[2]), /* Port */
33 NULL, /* optional path */
34 NULL, /* optional topic */
36 argv[3], /* Username */
37 argv[4], /* Password */
38 EVEL_SOURCE_VIRTUAL_MACHINE, /* Source type */
39 "EVEL training demo", /* Role */
42 fprintf(stderr, "\nFailed to initialize the EVEL library!!!\n");
47 printf("\nInitialization completed\n");
50 /***************************************************************************/
51 /* Send a heartbeat just to show we're alive! */
52 /***************************************************************************/
53 heartbeat = evel_new_heartbeat();
54 if (heartbeat != NULL)
56 evel_rc = evel_post_event(heartbeat);
57 if (evel_rc != EVEL_SUCCESS)
59 printf("Post failed %d (%s)", evel_rc, evel_error_string());
64 printf("New heartbeat failed");
67 /***************************************************************************/
68 /* Raise a service event */
69 /***************************************************************************/
72 /***************************************************************************/
74 /***************************************************************************/
77 printf("Terminated\n");
82 /**************************************************************************//**
83 * Create and send a Service event.
84 *****************************************************************************/
85 void demo_service(void)
87 EVENT_SIGNALING * event = NULL;
88 EVEL_ERR_CODES evel_rc = EVEL_SUCCESS;
90 event = evel_new_signaling("vendor_x_id",
91 "correlator", "1.0.3.1", "1234", "192.168.1.3","3456");
94 evel_signaling_vnfmodule_name_set(event, "vendor_x_module");
95 evel_signaling_vnfname_set(event, "vendor_x_vnf");
96 evel_signaling_type_set(event, "Service Event");
97 evel_signaling_correlator_set(event, "vendor_x_correlator");
98 evel_signaling_addl_info_add(event, "prodid", "vendor_x_product_id");
99 evel_signaling_addl_info_add(event, "subsys", "vendor_x_subsystem_id");
100 evel_signaling_addl_info_add(event, "friendly_name", "vendor_x_friend");
102 evel_signaling_addl_info_add(event, "callee", "PCMA");
103 evel_signaling_addl_info_add(event, "caller", "G729A");
105 evel_signaling_addl_info_add(event, "Name1", "Value1");
106 evel_signaling_addl_info_add(event, "Name2", "Value2");
108 evel_rc = evel_post_event((EVENT_HEADER *) event);
109 if (evel_rc != EVEL_SUCCESS)
111 EVEL_ERROR("Post failed %d (%s)", evel_rc, evel_error_string());
116 EVEL_ERROR("New Service failed");
118 printf(" Processed Service Events\n");