famfamfam
famfamfam

Reputation: 535

Vonage webhook event return error: Can't connect to outbound destination number that is linked to the same application

I am trying to integrate Janus SIP gate-way with Vonage SIP platform. I success to create Developer account and buy 2 virtual numbers, each number linked to other Application.

enter image description here

Above picture show how successfull registered with Janus, then I used this to call to the other number as the sip domain: sip:[email protected]

app.get('/voice/answer', (req, res) => {
  console.log('NCCO request:');
  console.log(`  - caller: ${req.query.from_user}`);
  console.log(`  - callee: ${req.query.to}`);
  console.log('---');


  res.json([ 
    { 
      "action": "talk", 
      "text": "Please wait while we connect you."
    },
    // {
    //     action: 'stream',
    //     streamUrl: ["https://commondatastorage.googleapis.com/codeskulptor-assets/Epoq-Lepidoptera.ogg"]
    // },
    { 
      "action": "connect",
    //   "from" : vonageNumber1,
      "endpoint": [ 
        { "type": "phone", "number": req.query.to },
        // { 
        //     "type": "sip", 
        //     "uri": "sip:[email protected];transport=tls;media=srtp" ,
        //     "headers": { 
        //         "Authorization" : "Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MTA3MzUzMDQsImp0aSI6IjE4YmRkMjMwLWU0ZGUtMTFlZS05YjNiLTJiNWRlOGE4ODUxZiIsImFwcGxpY2F0aW9uX2lkIjoiMWZlMTdiMTQtNTlhYy00MGYxLWE4ZTgtZWI2NmI1YWJlNDk2Iiwic3ViIjoiRHVuZ0R6YWkiLCJleHAiOjE3MTA3MzUzMjYwMDIsImFjbCI6eyJwYXRocyI6eyIvKi91c2Vycy8qKiI6e30sIi8qL2NvbnZlcnNhdGlvbnMvKioiOnt9LCIvKi9zZXNzaW9ucy8qKiI6e30sIi8qL2RldmljZXMvKioiOnt9LCIvKi9pbWFnZS8qKiI6e30sIi8qL21lZGlhLyoqIjp7fSwiLyovYXBwbGljYXRpb25zLyoqIjp7fSwiLyovcHVzaC8qKiI6e30sIi8qL2tub2NraW5nLyoqIjp7fSwiLyovbGVncy8qKiI6e319fX0.Skx27BsQVjg4o31kfb9asLVNZIP1wqG6tQP7SleETVtTdvV7C2NEad5vUXAH6xnQ0RyPefhBPDR54umgOIwkwioC7LNKXdc4_8PtOKNY93-BDdSa6e77dBpz7cyDzpfKTDDfiJPqbhObA88Qq-HN62gLY2cH2FdZa4kvBaIIkoViB3IBisFz9uVIvnHfDZTlWojyuGAEo0RmU0Dfb5D4conMbf9d0UmMX8gEoeAcu1Zs-ooxqNRDeSpORYgCTg4W_YTzugkCiwWPCcctUyjK4UZ9QNENH-zFX64ubqYx1P6KVKPNf9qNskPM7Ion_mRn2ITgrU3pHNQW0WAvokQ_GA"    
        //     }
        // },
      ]
    }
  ]);
});

app.all('/voice/event', (req, res) => {
  console.log('EVENT:', req.body.status);
  console.dir(req.body);
  console.log('---');
  res.sendStatus(200);
});

The problem appear when I press Call button from Janus, here is the log I got from the terminal:

enter image description here

This error I got appear after I hear this talk message: Please wait while we connect you., I am sure each number linked to each Application.

"endpoint": [ 
        { 
            "type": "sip", 
            "uri": "sip:[email protected];transport=tls;media=srtp"   
            }
        },
      ]

But no luck to me, I think my knowledge from Vonage and Janus is not enough, can someone give me some advices? Thanks so much

Upvotes: 0

Views: 51

Answers (0)

Related Questions