Blackhole "missing required keys in data object"

112 views
Skip to first unread message

Tomcar

unread,
May 25, 2017, 11:25:36 PM5/25/17
to 2600hz-dev
Hi!

I'm trying to get blackhole client working, as in https://docs.2600hz.com/dev/applications/blackhole/doc/README
I did exactly as in the example, changing {BLACKHOLE_IP_ADDRESS}, {ACCOUNT_ID} and {AUTH_TOKEN} to my correct values.
(I also changed 'accountId' and 'token' in the third Send to my values, seems like a typo in the doc?).

In console (Chrome) I only see three lines with "errors";
Object {action: "reply", request_id: "dca5026c0efd6807214dfde5c2a82e62", status: "error", data: Object}

When expanding Object -> data -> errors -> i see  '0:"missing required keys in data object"'. See attached screenshot.

Logfile: https://pastebin.com/ztrJheEJ (replaced my token with <MY_AUTH_TOKEN>)
(Note that request_id's differs, I did testing several times).

'sup blackhole_config autoload_modules' returns: [<<"bh_token_auth">>,<<"bh_call">>,<<"bh_object">>,<<"bh_fax">>,<<"bh_conference">>,<<"bh_events">>,<<"bh_authz_subscribe">>]

Same thing if just using one send request.

I checked this also: https://groups.google.com/d/topic/2600hz-dev/J6oXAP-4wPU/discussion


I'm on kazoo-core-4.0-52.el7.centos.x86_64


What's wrong?

Br - Tomas
Screenshot at maj 25 11-15-33.png

ALMA

unread,
May 26, 2017, 5:21:08 AM5/26/17
to 2600hz-dev
If I remember well, you must put data request on the branch "data" and not on the same level of auth_token. Try something like this:

send({
auth_token: '{AUTH_TOKEN}',
data: {
action: 'subscribe', account_id: '{ACCOUNT_ID}', binding: 'call.CHANNEL_CREATE.*'
} });
Message has been deleted

Tomcar

unread,
May 29, 2017, 11:14:48 AM5/29/17
to 2600hz-dev
Thanks for your answer.
Unfortunately it didn't work, now I get '[error] |0000000000|Undefined:Undefined (emulator) Error in process <0.30048.3> on node 'kazoo_apps@kazoo-host' with exit value:'  and a lot of stackrace info instead...

Br - Tomas

Tomcar

unread,
May 31, 2017, 11:26:30 AM5/31/17
to 2600hz-dev
I found another documentation about this, seems similar and still no luck; https://github.com/2600hz/kazoo/tree/master/applications/blackhole/doc
What's wrong? Anyone else got this working?

I checked https://github.com/2600hz/kazoo-popup and with my very poor knowledge I still found the connection string there;
name:'subscribe',args:'{"account_id":"%1","auth_token""":"%2","binding":"call.CHANNEL_ANSWER.*"}

It uses "name:'subscribe'" instead of "action", but it doesn't work either.

Please help!

Br - Tomas

ALMA

unread,
Jun 1, 2017, 8:47:24 AM6/1/17
to 2600hz-dev
Hi,

The app works, this is sure, I have tested this but I don't remember how I had wrote the websocket client on kazoo 4.
On kazoo 3 there is socket.io and works with:

socket.emit("subscribe", { auth_token: token, binding: 'call.*.*' });

On kazoo4 remember that maybe you have to send in API style, so "auth_token" and "data"... Try to put binding inside a list:

send({
auth_token: '{AUTH_TOKEN}',
data: {
action: 'subscribe', account_id: '{ACCOUNT_ID}', binding: ['call.CHANNEL_CREATE.*']
} });

Also paste here the stacktrace please.

Tomcar

unread,
Jun 2, 2017, 9:13:27 AM6/2/17
to 2600hz-dev
Thanks for answer!
Sorry, my bad. I missed that auth_token was outside the data {}.

Now it connects OK, but I can't see anything in the console log, besides 'Object {action: "reply", request_id: "99382a2a9481cc843dd3f42c4d1b2e89", status: "success", data: Object}'.
I've subscribed to call.CHANNEL_CREATE.*, but when making a call nothing is happening in the log...

Br - Tomas

Tomcar

unread,
Jun 2, 2017, 5:25:04 PM6/2/17
to 2600hz-dev
Finally I got it working now, great help from JR^ on the IRC channel (thanks again!).

The request should look like this:
socket.onopen = function() {
            send
({
                    action
: 'subscribe',
                    auth_token
: '<token>',
                    request_id
: '<self-generated-id>',
                    data
: {
                        account_id
: '<account_id>',
                        binding
: 'call.CHANNEL_CREATE.*'
                   
}
           
});

I'm not sure what request_id is used for, it worked for me when setting it to same as account_id...

I will update the documentation asap.

Br - Tomas

ALMA

unread,
Jun 5, 2017, 7:26:08 AM6/5/17
to 2600hz-dev
Hi,
I don't remember a nything about request_id but if it works for you, it's ok :) I have to test in in future so I will update you about my case.

Tomcar

unread,
Jun 6, 2017, 3:03:31 PM6/6/17
to 2600hz-dev
Hi!

Tested without request_id now and it works anyway. :)

Br - Tomas
Reply all
Reply to author
Forward
0 new messages