- ocf_log $not_running_log_level "Kamailio is running, but not functional as sipsak ${OCF_RESKEY_proto} failed with $(kamailio_format_result $result "$output" "$error")"
+ ocf_log $not_running_log_level "Kamailio is running, but not functional as sipsak OPTIONS ${OCF_RESKEY_proto} failed with $(kamailio_format_result $result "$output" "$error")"
return $OCF_ERR_GENERIC
fi
+
+ # Checks if it is possible to register an extension.
+ if [ ${OCF_RESKEY_register} == true ]; then
+ # Iterate on the extensions array
+ for extension in ${OCF_RESKEY_register_array[@]}; do
+ # If cannot register the extension, raise an OCF_ERR
+ if [ $result -ne 0 ]; then
+ ocf_log $not_running_log_level "Kamailio is running, but not functional as sipsak REGISTER ${OCF_RESKEY_proto} failed with $(kamailio_format_result $result "$output" "$error")"
+ return $OCF_ERR_GENERIC
+ fi
+ echo "RESULT: $result"
+ done
+ fi
return $OCF_SUCCESS
}
kamailio_monitor() {
kamailio_status
}
kamailio_start() {
local errorfile error output piddir
if
kamailio_status
then
ocf_log info "kamailio already running."
return $OCF_SUCCESS
fi
# if pidfile directory does not exist, create it with kamailio process owner