From: Leon de Rooij Date: Tue, 28 Apr 2009 09:08:54 +0000 (+0200) Subject: freeswitch plugin: Added error checking on connecting to esl on _init X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=db35f58a10a95fbe94d28896818b57ad61892dfe;p=collectd.git freeswitch plugin: Added error checking on connecting to esl on _init --- diff --git a/src/freeswitch.c b/src/freeswitch.c index b483ad3c..b59f7aa1 100644 --- a/src/freeswitch.c +++ b/src/freeswitch.c @@ -509,7 +509,11 @@ static int fs_init (void) /* Connect to FreeSWITCH over ESL */ DEBUG ("freeswitch plugin: making ESL connection to %s %s %s\n", fs_host, fs_port, fs_pass); - esl_connect(&esl_handle, fs_host, atoi(fs_port), fs_pass); + if (esl_connect(&esl_handle, fs_host, atoi(fs_port), fs_pass)) + { + ERROR ("freeswitch plugin: connection failed [%s]", esl_handle.err); + return (-1); + } /* Start a seperate thread for incoming events here */ //esl_thread_create_detached(msg_thread_run, &esl_handle);