Skip to content

"Error: Caution! IP address is not from sipgate" when using webhooks #28

@michaelSchmidMaloon

Description

@michaelSchmidMaloon

Describe the bug
I'm not sure if I understand the usage of webhooks with sipgate.io correctly. I wrote some code, along with the node examples, that reacts on multiple events, e.g. newCallEvent. I host it on a dedicated machine in AWS that is assigned the WEBHOOK_SERVER_ADDRESS. This is also configured in sipgate.io.
The WEBHOOK_URL is set to some Grafana incoming webhook endpoint. When starting the server and calling a number that's configured for the webhook, the log reads

Caution! IP address is not from sipgate

At this point I'm not sure if I'm supposed to host this "webhook relay" myself or if it should somehow be configured / uploaded to sipgate. But if so, I have no idea how. Would be lovely if someone can point me in the right direction.

To Reproduce
Steps to reproduce the behavior.

Expected behavior
Webhook data being transfered from sipgate to the configured outgoing webhook.

Environment (please complete the following information):

  • OS: node:20-buster docker image
  • Node.js Version 20
  • Library Version 2.15.0

Additional context

const { createWebhookModule } = require("sipgateio");
require("dotenv").config();
const axios = require("axios").default;

process.on('SIGINT', function() {
  console.log("Caught interrupt signal");

  if (true)
      process.exit();
});
 
const outgoingWebhookUrl = process.env.OUTGOING_WEBHOOK_URL;
if (!outgoingWebhookUrl) {
  console.error(
    "Please provide a outgoing webhook URL via the environment variable OUTGOING_WEBHOOK_URL"
  );
  return;
}

const serverAddress = process.env.WEBHOOK_SERVER_ADDRESS;
if (!serverAddress) {
  console.error(
    "Please provide a server address via the environment variable WEBHOOK_SERVER_ADDRESS"
  );
  return;
}

const webhookServerOptions = {
  port: process.env.WEBHOOK_SERVER_PORT || 3000,
  serverAddress,
};
 
createWebhookModule()
  .createServer(webhookServerOptions)
  .then((server) => {
    console.log(
      `Server running at ${webhookServerOptions.serverAddress}:${webhookServerOptions.port}\n` + "Ready for calls"
    );
    server.onNewCall((newCallEvent) => {
      console.log(`New call from ${newCallEvent.from} to ${newCallEvent.to}`);
      axios.post(outgoingWebhookUrl, { })
    });
  });

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions