event.forward.enable & event.forward.url

Anton Tananaev8 years ago

Are you saying that if you put any other URL, it works? It probably means that your URL is incorrect.

Atul8 years ago

No, No URL works for forwarding events.

forward.url is not for events.

Thanks
Atul

Atul8 years ago

Hello,

Can someone please help me with this or give me pointer that can help me? I am blocked on this.

Thanks,
Atul

Anton Tananaev8 years ago

I'm not sure what can be the problem. The only option I can think of is to debug server and see what's happening.

macphisto8 years ago

Hi,

Hope this can help you

This is my default.xml

<entry key='event.forward.enable'>true</entry>
<entry key='event.forward.url'>http://www.yourwebsite.com/your_listen_function.php</entry>
<entry key='event.forward.header'>
    content-type: application/json,
    authorization: Basic YOURAUTHORIZACIONIFYOUNEED
    cache-control: no-cache
</entry>

And Abyss777 posted this code to debug the data recieved. Put this in your your_listen_function.php

<?php
  $log_dir = '/tmp/';
  $log_name = "posts-" . $_SERVER['REMOTE_ADDR'] . "-" . date("Y-m-d-H") . ".log";
  $log_entry = gmdate('r') . "\t" . $_SERVER['REQUEST_URI'] . "
" . serialize($_POST) . "
" . $_POST['event']['type'] . "

";
  $fp=fopen( $log_dir . $log_name, 'a' );
  fputs($fp, $log_entry);
  fclose($fp);
?>

And restart your server :)

Atul8 years ago

Thanks very much. I was feeling bit lost, now I have something to try :)

Thank You,
Atul

Don4 years ago

I know this is old discussion, but I am facing the same problem, all events do not forwarded .. below is my traccar.xml

<entry key='forward.enable'>true</entry>
<entry key='forward.url'>https://mydomain.com/api/traccar_events</entry>
<entry key='forward.json'>true</entry>

<entry key="event.forward.enable">true</entry>
<entry key='event.forward.url'>https://mydomain.com/api/traccar_events</entry>

I also tried to set notifications channel to web and or empty .. but no luck..
please help

James4 years ago

Slightly related - is it possible to set the event / position forwards as attributes to devices / users / groups?