event.forward.enable & event.forward.url

Anton Tananaev 9 years ago

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

Atul 9 years ago

No, No URL works for forwarding events.

forward.url is not for events.

Thanks
Atul

Atul 9 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 Tananaev 9 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.

macphisto 9 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 :)

Atul 9 years ago

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

Thank You,
Atul

Don 5 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

James 5 years ago

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