Kazoo channel hangup

641 views
Skip to first unread message

Ayoub Laaziz

unread,
Aug 12, 2015, 11:13:09 AM8/12/15
to 2600hz-users
Hi, 

I'm trying to hangup channels using the channel API, when I do a POST to :
https://{realm}/v2/accounts/{account_id}/channels/{call_id}?auth_token={token}
https://{realm}/v2/accounts/{account_id}/channels/{other_leg_call_id}?auth_token={token}

with data: {"data": {"action": "hangup"}} 

Kazoo responds with :
  data: 'hangup initiated',
  revision: 'undefined',
  request_id: '79567754109dd7618bc6a194f068d5cb',
  status: 'success',
  auth_token: '78232a534d7e88eb7c40f1a3977ab345' 
}

but the a-leg shows to still be online, and the network capture does not show any BYE received on its end.

Is there something I'm missing ?

Thank you, 

James Aimonetti

unread,
Aug 12, 2015, 11:53:26 AM8/12/15
to 2600hz...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

The issue is two fold; metaflows need to be enabled on the account and
konami needs to be running on the backend. I'm going to create a
ticket to update the channels docs to reflect this necessity.
- --
James Aimonetti
Lead Systems Architect / Impressionable Scallywag
"I thought I fixed that"

2600Hz | http://2600hz.com
sip:ja...@2600hz.com
tel:415.886.7905
irc:mc_ @ freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJVy2vwAAoJENTKa+JPXCVgG0YH/0LBbwqbj4YP23NUuF0XoNcw
OCtCFXghRjMb2SJvLTvSxvrFVXsdkt32zIfsiLfJ7XIOTGll2cSk+/YV18d190h+
8JfF+Mb69qI0HpegAxFKUi7NoHI8tZxJHf7xkDyui3d2NSC1u3zBXigCFXvRGTlM
FSRY1YIHnl5sRGDSjs+RAEDZID52HqFQaFKGZuD54F8iUvnJM7Tm/lc+XEwBfMTp
8SE0vxvLjiJv6Qi5sWyaQc19PZMutBrLKavihmXgoATw3eVSq5qtu0K9lzJuiZUY
bG968D5+r87QLirfcziiMPZjJ8jZPSDFr7FUJSr/v6KEZt8DNoALtdwqL4NNc4w=
=Mw9U
-----END PGP SIGNATURE-----

Abdelghafour Harraz

unread,
Aug 12, 2015, 6:53:50 PM8/12/15
to 2600hz-users
Hello, 

I'm also working on the same thing, I think it is well explained in here: 

The doc is showing the operations to make a transfer using metaflows, you can just change the action to hangup I guess:

You basically need to configure a metaflow on the account:

POST v1/accounts/{ACCOUNT_ID}/metaflows 
{"data":{
   "numbers":{
        "2":{
            "module":"transfer"
            ,"data":{
                "takeback_dtmf":"*1"
                ,"moh":"media_id"
            }
        }
    },
   "binding_key":"*"
}

And then you can transfer from your application by posting to:

 POST v1/accounts/{ACCOUNT_ID}/channels/{CALL_ID}
 {
   "data": {
     "action": "transfer",
     "target": "2600",
     "takeback_dtmf": "*1",
     "moh": "media_id"
   }
 }

What I'm missing is how the POST to the channel API emulate the press of a given DTMF (in the above case: *2) to trigger the transfer ?

Regards, 

James Aimonetti

unread,
Aug 12, 2015, 6:56:28 PM8/12/15
to 2600hz...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

The Konami app works in phases:

1. Listen for the binding key (arm the listener)
2. When armed, collect DTMF until timeout
3. Compare collected DTMF to "numbers", go to 4 on match
3a. If no match, compare DTMF to "patterns", go to 4 on match
4. Process matched metaflow

The POST essentially jumps to 4.
- --
James Aimonetti
Lead Systems Architect / Impressionable Scallywag
"I thought I fixed that"

2600Hz | http://2600hz.com
sip:ja...@2600hz.com
tel:415.886.7905
irc:mc_ @ freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJVy88aAAoJENTKa+JPXCVgCtYH/2yTmMdm2GHHVFEno/Vlow0U
3Qc9q27UNAbgb9fHeIpFfb9JHWB4c1sM5D+DeoOrEReFz1F5oONGLkxWAuo2kOSS
2NSz7WEbI3emNdWis8XiCmqs6/78i7+Wr4KYUuZJIjvZeMcV5q3tDcr/6kjr/Ngp
3I7diOu6gXpJbup3QSBQp+t7qyiFQnqFP+T7gOjaQgPpbN6Orqxd2YGofDXtN3Q3
FoZkAzR/dU7Wwix16+tg1VSMJvw0RRgTm37UFnOVbGngSM+1bejagO0ebihtpIAY
UtvD4zSZP6yu9weQi2/z1MwAlLZRchRsZ82CIvWwFhqhKyu0CsOr2IQE7vPdBYo=
=W+l7
-----END PGP SIGNATURE-----

Abdelghafour Harraz

unread,
Aug 12, 2015, 7:02:36 PM8/12/15
to 2600hz-users
Thank you,


Le mercredi 12 août 2015 16:13:09 UTC+1, Ayoub Laaziz a écrit :

Ayoub Laaziz

unread,
Aug 13, 2015, 9:36:58 AM8/13/15
to 2600hz-users
Here is the POST I'm updateing the metaflows with:

{
  "data": {
    "numbers": {
      "234": {
        "module": "hangup",
        "data": {
          "id": "media_id"
        }
      },
      "binding_digit": "*",
      "listen_on": "both"
    }
  }
}
   
Here is the metaflow object on my account:

"metaflows": {
  "numbers": {
    "234": {
      "module": "hangup",
      "data": {
        "id": "media_id"
      }
    },
    "binding_digit": "*",
    "listen_on": "both"
  },
  "owner_id": "xxxxxxxxxxxxxxx"
}

When I send a POST to the channel API:

https://{realm}/v2/accounts/{account_id}/channels/{call_id}?auth_token={token}

I'm still getting:

{
  "data": "hangup initiated",
  "revision": "undefined",
  "request_id": "692ee78945d3e94880d6e4a0bfae9ff6",
  "status": "success",
  "auth_token": "3550001efe6d11501dcf829d8ccc6c93"
}

And the a-leg is not hangup.

Am I  missing something ?

Many thanks,

Le mercredi 12 août 2015 16:13:09 UTC+1, Ayoub Laaziz a écrit :

Ayoub Laaziz

unread,
Aug 13, 2015, 9:52:20 AM8/13/15
to 2600hz-users

Hi, 

Update:

When I send a POST to the channel API:
https://{realm}/v2/accounts/{account_id}/channels/{call_id}?auth_token={token}

with body :
{"data": {"action": "hangup"}}

Many thanks, 

Le mercredi 12 août 2015 16:13:09 UTC+1, Ayoub Laaziz a écrit :

James Aimonetti

unread,
Aug 13, 2015, 1:57:38 PM8/13/15
to 2600hz...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Without seeing logs of that request_id, as well as callflow and konami
logs related to {call_id}, it is hard to say. I'd start by collecting
those debug logs and see if something stands out.

Le 08/13/2015 06:44 AM, Ayoub Laaziz a écrit :
>
> Hi,
>
- --
James Aimonetti
Lead Systems Architect / Impressionable Scallywag
"I thought I fixed that"

2600Hz | http://2600hz.com
sip:ja...@2600hz.com
tel:415.886.7905
irc:mc_ @ freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJVzNqOAAoJENTKa+JPXCVg9gMH/0cuPkh/btvTXCqsuc8jt447
JqZ7VBO/HTv1YmIo9SJXlYj+Q4vMS61T44dQuDmRP5TlrVl+dPkNXoVROXd99Lup
iQLNaToBB1EeOurRxt4s+AUE9PszXO4+IaMspD13Y6q9xjUIZg/WlluVBu7aD9NY
8Ic2DlqbGxD0cUagF4g7S15KQkVoQOGtroIFe3VIuhIn2P1i+HtJZvmQNhNN3Fd/
KyO9Nbky8cQcxl69ry5rj19SpEx4uiZdjTS0ZFvGUEQm5T7hD0wtDI0VRimHas5B
9OImT2TRk7YejmzrwGRfio7ggkkVKoZo6zpNupdTbgJNN88TRkt8T1WOG1xsTuo=
=OxqX
-----END PGP SIGNATURE-----

Abdelghafour Harraz

unread,
Aug 14, 2015, 10:33:56 PM8/14/15
to 2600hz-users
Hello, 

I'm running the hosted version, I imagine that konami is enabled by default, I have a couple of questions:
- is it armed once a metaflow is configured ?
- how does it find which metaflow should be executed when a POST is received? I tried to configure a pattern that match anything, bu t it does not seem to receive the initiated hangup requested by the channel API.

Many thanks, 

Le mercredi 12 août 2015 16:13:09 UTC+1, Ayoub Laaziz a écrit :

Abdelghafour Harraz

unread,
Nov 21, 2015, 11:24:20 PM11/21/15
to 2600hz-users
Hello, 

We tried to implement an alternative to live call transfer using konami, but we bumped up to some road blocks, so I was hoping that someone can shed some more light on:
- How we can configure konami with the channel API to be able to transfer a live call or hang it up. 
- Or doe the pivot app provide this kind of call handling. 

Many thanks, 

Michal

unread,
Feb 29, 2016, 4:09:01 PM2/29/16
to 2600hz-users
Hi,

I've got exactly same problem: 

konami running: 

sup whapps_controller running_apps

[konami,crossbar,doodle,frontier,camper,pivot,milliwatt,omnipresence,hangups,acdc,fax,conference,trunkstore,cdr,notify,callflow,media_mgr,sysconf,stepswitch,reorder,registrar]


metaflow:

GET {realm}/v2/accounts/{account_id}/metaflows

{

  "data": {

    "numbers": {

      "486487": {

        "module": "hangup",

        "data": {}

      }

    },

    "binding_digit": "*",

    "listen_on": "self",

    "owner_id": "{owner_id}"

  },

  "revision": "undefined",

  "request_id": "{request_id}",

  "status": "success",

  "auth_token": "{auth_token}"

}


dialled number and then executed:

POST {realm}/v2/accounts/{account_id}/channels/9e0a6d27f68eac5d...@0.0.0.0

{

"data": {

     "action": "hangup"

     }

}


returned:

{

  "data": "hangup initiated",

  "revision": "undefined",

  "request_id": "b86360b2d75166f4d4cab0dedcf1df08",

  "status": "success",

  "auth_token": "{auth_token}"

}


kazoo logs:

attached


Could you please point me out what could be possible wrong? I cannot see any error message or anything like that in logs...


Thanks

Michal 

api hangup logs.txt

ynasida

unread,
Apr 5, 2017, 4:40:35 PM4/5/17
to 2600hz-users
We have absolutely same issue. 
Any update ?


On Tuesday, 1 March 2016 00:09:01 UTC+3, Michal wrote:
Hi,

I've got exactly same problem: 

konami running: 

sup whapps_controller running_apps

[konami,crossbar,doodle,frontier,camper,pivot,milliwatt,omnipresence,hangups,acdc,fax,conference,trunkstore,cdr,notify,callflow,media_mgr,sysconf,stepswitch,reorder,registrar]


metaflow:

GET {realm}/v2/accounts/{account_id}/metaflows

{

  "data": {

    "numbers": {

      "486487": {

        "module": "hangup",

        "data": {}

      }

    },

    "binding_digit": "*",

    "listen_on": "self",

    "owner_id": "{owner_id}"

  },

  "revision": "undefined",

  "request_id": "{request_id}",

  "status": "success",

  "auth_token": "{auth_token}"

}


dialled number and then executed:

POST {realm}/v2/accounts/{account_id}/channels/9e0a6d27f68eac5da560c341...@0.0.0.0

Reply all
Reply to author
Forward
0 new messages