Specify(Filter) Events to Forward

Michael B7 years ago

Hello,

I have placed the following into my conf/traccar.xml config file:

    <entry key='event.forward.enable'>true</entry>
    <entry key='event.forward.url'>http://localhost:8080/phlegigeozone</entry>
    <entry key='event.forward.header'>
    content-type: text/html
    Authorization: Basic (REDACTED)
    </entry>

There is another platform on the same server that I want to communicate events to.

I have an ODB device configured which is successfully sending position data to Traccar.

I have geofences defined.
I have notifications defined for "Device has entered geofence" and "Device has exited geofence"

The ODB device is mapped to the defined geofences.
The ODB device is mapped to the defined notifications.

This works well and the listening service receives http post data when a geofence transition occurs.

This is great and I'm just trying to tidy it up a bit.

From the logs of the listening service, I see events being forwarded for event types that I have not configured notifications for. For example device online/offline and position events are also being forwarded.

Is it possible, through the conf/traccar.xml config file perhaps, to specify which event types are forwarded? Or will all events always be forwarded?

Is it necessary to define (geofence) notifications in order for the geofence transition events to be forwarded? Or will all geofence events always be forwarded regardless of whether or not a notification is defined in the Traccar web UI?

Thank you for your time.

Anton Tananaev7 years ago

Notifications are configured per users. Events forwarding is a global configuration and always includes all events.

Michael B7 years ago

Thank you.

Would it be possible, in theory, to build a custom notificator that performed a http post action. Then use that notificator in the channels of a configured notification? By using this method, instead of global event forwarding, only the specified notificaitons would be forwarded?

Anton Tananaev7 years ago

Yes, it should be possible.