Proper way to route calls to a connected PBX

339 views
Skip to first unread message

RT

unread,
Feb 8, 2016, 7:03:23 PM2/8/16
to 2600hz-dev
I am trying to route calls to an asterisk box from a callflow.

I have a callflow with a menu that routes to a "landline" device.  This sends calls to the phone number assigned to the connected PBX in kazoo.  This hairpins the call internally to the PBX since the number is local to the system.

Is there a better way to do this?


At the moment I have the asterisk box setup as a connected PBX for outbound calls.

The downside to this is that I can't seem to record outbound calls the same way I do with regular outbound calls.  I've created a no_match with recording and a global carrier resource.  This seems to circumvent that altogether.  How is this possible when the account has no carrier?  And how can I get kazoo to record these calls?

James Aimonetti

unread,
Feb 8, 2016, 7:14:08 PM2/8/16
to 2600h...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

This sounds more appropriate for PBX Connecter (trunkstore on the
backend) than for Callflows. Did you try using that first?
- --
James Aimonetti
Lead Systems Architect / Impressionable Scallywag
"If Dialyzer doesn't care, I don't care"

2600HzPDX | 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/

iQEcBAEBCAAGBQJWuS9NAAoJENTKa+JPXCVgvnUH/1FVl9wP7u0iOzqVNLMy7JxB
BZ3tmJwmQ2Gxi7PkZiv+rD8qyWXU4C7uDfApbW+sjEB6DQ1e0+rlnph8Xa3S7kZL
ojxOBgF2Ew/3mF83oCSSZVDlpOsYj4VzVya3kCIgo7Ho6bWWfiAgONOvCPWe/UoG
kQDlSxVfnpMJQ8egYqXDum8R9No+Oxg+g54XeDmdd4rdEQvmstMD/Eo9OTNlgUzD
5bbjLobTO371bo1N8bunw1j/vbzrs3FtfsUDEgDDYSZ32HU0iBo3sRaowQe3/1/T
D2IKdoD+XEkjyJK18IUOScWqtomq+TqRds8sIGz6GcPTdrACTvr9Fje/vbJfsO0=
=Y6xp
-----END PGP SIGNATURE-----

Kirill Sysoev

unread,
Feb 9, 2016, 1:37:38 AM2/9/16
to 2600h...@googlegroups.com
Hi RT

If I understood you correctly (and I'm really not sure), you are talking about separate outbound routing for a particular account.

You should think about callflows' devices and trunkstore more from an inbound call perspective.
Trunkstore is good when you need to pass two or more DIDs to your PBX

Outbound calling should result in thoughts about "resources" in Kazoo admin's head :)  

Instead of global carrier (resources), you can use local one for such a tricky account.
Just put resource doc with type local into account's db and point your no_match callflow to module resources:

{
   "_id": "9f689a763f341dba10dd0b3d7ddcbeac",
   "_rev": "51-9924cfaf7e04fd761b3e8688a92b98d7",
   "weight_cost": "50",
   "enabled": false,
   "gateways": [
       {
           "prefix": "",
           "codecs": [
               "PCMA",
               "PCMU"
           ],
           "progress_timeout": "7",
           "server": "1.2.3.5",
           "username": "",
           "password": "",
           "realm": "",
           "format_from_uri": false,
           "suffix": "",
           "channel_selection": "ascending",
           "custom_sip_headers": {
           },
           "emergency": false,
           "enabled": true,
           "endpoint_type": "sip",
           "force_port": false,
           "invite_format": "route",
           "port": "5080",
           "skype_rr": false
       }
   ],
   "caller_id_options": {
       "type": "external"
   },
   "type": "local",
   "name": "fsmf",
   "emergency": false,
   "grace_period": 5,
   "flags": [
   ],
   "media": {
       "audio": {
           "codecs": [
               "PCMU"
           ]
       },
       "video": {
           "codecs": [
           ]
       }
   },
   "id": "9f689a763f341dba10dd0b3d7ddcbeac",
   "rules": [
       "^\\+?(\\d*)$"
   ],
   "cid_rules": [
   ],
   "pvt_is_authenticated": true,
   "pvt_auth_account_id": "b35483a7e18684f4cd5f09eae01a4c0c",
   "pvt_auth_user_id": "8b81351bc3afaf4c34d67eb799438498",
   "pvt_request_id": "a8868a3d705f78ebb173db098e339b30",
   "pvt_modified": 63619801258,
   "pvt_created": 63615924807,
   "pvt_account_db": "account%2F33%2Fca%2F3929ed585e0e423eb39e4ffe1452",
   "pvt_account_id": "33ca3929ed585e0e423eb39e4ffe1452",
   "pvt_vsn": "1",
   "pvt_type": "resource"
}


{
   "_id": "7c353a7a9ae042f039f072f9b720f121",
   "_rev": "77-0eb1ef477ed477da3d8ec7facf5b35cc",
   "numbers": [
       "no_match"
   ],
   "flow": {
       "children": {
       },
       "data": {
       },
       "module": "resources"
   },
   "patterns": [
   ],
   "id": "7c353a7a9ae042f039f072f9b720f121",
   "metadata": {
   },
   "pvt_is_authenticated": true,
   "pvt_auth_account_id": "33ca3929ed585e0e423eb39e4ffe1452",
   "pvt_auth_user_id": "20dcee6607c37ef4bac8fb6c067919c8",
   "pvt_type": "callflow",
   "pvt_vsn": "1",
   "pvt_account_id": "33ca3929ed585e0e423eb39e4ffe1452",
   "pvt_account_db": "account%2F33%2Fca%2F3929ed585e0e423eb39e4ffe1452",
   "pvt_created": 63582394917,
   "pvt_modified": 63622217738,
   "pvt_request_id": "4f3d9dc585ea825d3943d1b287133d6c"
}


Calls recording should act as with usual (global carrier) scheeme.

My favourite is to switch call recording for all calls passing in and out by using preflow module...


Regards,
Kirill
--
You received this message because you are subscribed to the Google Groups "2600hz-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 2600hz-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

RT

unread,
Feb 9, 2016, 7:35:55 PM2/9/16
to 2600hz-dev
Kirill,

We use multiple inbound and outbound carriers for almost all accounts.  Depending on cost for various origination and termination services.  Termination is handled via offnet docs weighted by cost to various carriers for particular NPANXX combinations with a fall-through for everything else.  A sort of dumbed down LCR.  I see account based resources has weight and regex matching on dial rules.  But how is this going to behave differently than creating a no_match callflow with recording for outbound?

RT

unread,
Feb 9, 2016, 7:35:55 PM2/9/16
to 2600hz-dev, ja...@2600hz.com
James,

Perhaps my explanation or my question wasn't worded very well.

I am using PBX connector for the trunk between kazoo and the asterisk box.  But I am not sure how to get calls from an existing callflow with a menu to send calls to the other PBX via a menu option.  The method I have used is a bit of a hack.


RT

unread,
Feb 11, 2016, 7:50:39 PM2/11/16
to 2600hz-dev
Is there any documentation on the preflow module?  Unable to find anything.



On Tuesday, February 9, 2016 at 1:37:38 AM UTC-5, kirill.sysoev wrote:

Kirill Sysoev

unread,
Feb 12, 2016, 12:31:58 AM2/12/16
to 2600h...@googlegroups.com
Usual steps:

1. Search for a needed word at google list you are posting to.
    https://groups.google.com/forum/?fromgroups#!searchin/2600hz-dev/prefolw/2600hz-dev/RGEUIsl_RCc/SVz_xMwCQPoJ
    You can find a link to the PR with docs here

2. Use locate command at your Kazoo server:
    [root@kz527 ~]# locate preflow.md
    /opt/kazoo/applications/callflow/doc/preflow.md

If nothing found in previous two steps, sometimes you still can be successfull with:

3. Check wiki.2600hz.com
4. grep Kazoo source code for a word you are looking for. Source code is the best documentation ever :)))


So, preflow.md says you need to put an ID of a callflow you want to execute to your account:

   "preflow": {
       "always": "1e2d69d345d03ab184494dc043ed8d86"
   },

And this means that you need an appropriate callflow:

{
   "_id": "1e2d69d345d03ab184494dc043ed8d86",
   "_rev": "6-bfff4b7205de899edeb33a0768fa6a12",
   "flow": {
       "children": {
       },
       "data": {
           "action": "start",
           "url": "",
           "format": "mp3",
           "time_limit": "6000",
           "record_on_answer": true
       },
       "module": "record_call"
   },
   "numbers": [
   ],
   "patterns": [
   ],
   "name": "record_call",
   "contact_list": {
       "exclude": false
   },
   "id": "1e2d69d345d03ab184494dc043ed8d86",

   "pvt_is_authenticated": true,
   "pvt_auth_account_id": "b35483a7e18684f4cd5f09eae01a4c0c",
   "pvt_auth_user_id": "8b81351bc3afaf4c34d67eb799438498",
   "pvt_request_id": "0d86e531aefc8f0d33e98710fe418a86",
   "pvt_modified": 63613339330,
   "pvt_created": 63613337975,

   "pvt_account_db": "account%2F33%2Fca%2F3929ed585e0e423eb39e4ffe1452",
   "pvt_account_id": "33ca3929ed585e0e423eb39e4ffe1452",
   "pvt_vsn": "1",
   "pvt_type": "callflow"

RT

unread,
Feb 12, 2016, 6:11:01 PM2/12/16
to 2600hz-dev
LOL... Thank you for schooling me, Kirill.  Very helpful information.
Reply all
Reply to author
Forward
0 new messages