Jump to content

Make outbound PSTN call using Flowroute service provider


Recommended Posts

Hi, I am new to kazoo platform but has some prior experience to work with raw Freeswitch. I have tested some inbound call successfully by dialling an kazoo extension from zoiper client where callflow instructions are retrieved using pivot module and those are setup by me from Monster UI/Crossbar API.
 
Now i want to make outbound PSTN call using Flowroute service provider. But unable to find clear instructions regarding this. From the Create an outbound carrier section of the link https://docs.2600hz.com/sysadmin/doc/install/configure_kazoo/,  i think i need to setup Flowroute as resource and also need to configure corresponding callflow for routing the call using Flowroute.
 
Is this the all configuration required for PSTN call using Flowroute or any more things i need to configure?Can anyone give me some insight on this? 
 
Thanks in advance.
 
Note : 
 
1 . I have installed kazoo on single Centos v7 server.
2 . I did not add any main number to my account.
Link to comment
Share on other sites

Mehedi yes you are correct. Create a resource, either global or on the account. A global carrier requires creating a resource document in CouchDB but if you do it on the account you can use the API. 

Then you can create a callflow, but there is likely already one created by default for no match that goes to the account carrier (depends on your account settings IIRC.)

 

Link to comment
Share on other sites

@RuhNet and @fmateo05 Thanks for your prompt response.

As per doc, i have created a resource for Flowroute on the account using resources API. My Request Details are as below
 
URL : http://Kazoo-IP:8000/v2/accounts/account_id/resources
 
Method : PUT
 
Header : "X-Auth-Token: {AUTH_TOKEN}
 
Body : 
 
{
    "data": {
        "name": "flowroute",
        "rules": [
            ".{7,}"
        ],
        "flags": [
            "Use_Flowroute"
        ],
        "gateways": [{
            "channel_selection": "ascending",
            "codecs": ["PCMU", "PCMA"],
            "custom_sip_headers": {},
            "emergency": false,
            "enabled": true,
            "endpoint_type": "sip",
            "format_from_uri": false,
            "invite_format": "route",
            "password": "My_Password",
            "prefix": "",
            "progress_timeout": "15",
            "realm": "sip.flowroute.com",
            "server": "sip.flowroute.com",
            "skype_rr": true,
            "suffix": "",
            "username": "My_Username"
        }]
    }
}
 
If i fetch the resource details, then it shows
 
{
    "data": {
        "name": "flowroute",
        "rules": [
            ".{7,}"
        ],
        "flags": [
            "Use_Flowroute"
        ],
        "gateways": [{
            "channel_selection": "ascending",
            "codecs": [
                "PCMU",
                "PCMA"
            ],
            "custom_sip_headers": {},
            "emergency": false,
            "enabled": true,
            "endpoint_type": "sip",
            "format_from_uri": false,
            "invite_format": "route",
            "password": "My_Password",
            "prefix": "",
            "progress_timeout": 15,
            "realm": "sip.flowroute.com",
            "server": "sip.flowroute.com",
            "skype_rr": true,
            "suffix": "",
            "username": "My_Username",
            "force_port": false,
            "port": 5060
        }],
        "emergency": false,
        "enabled": true,
        "from_account_realm": false,
        "grace_period": 5,
        "rules_test": [],
        "weight_cost": 50,
        "id": "f39a018667d617e8052fa0bc88ff77d2"
    },
    "revision": "1-96d273e6e49cd071f0923ca18769de2a",
    "timestamp": "2021-10-18T13:17:18Z",
    "version": "4.3.140",
    "node": "yMeslQexQufV5c-zOCJ0Ow",
    "request_id": "b430f804325ca713f6d27df6d14bcf5a",
    "status": "success",
    "auth_token": "my - token"
}
 
I have created the callow from API. My Request Details are as below
 
URL : http://Kazoo-IP:8000/v2/accounts/account_id/callflows
 
Method : PUT
 
Header : "X-Auth-Token: {AUTH_TOKEN}
 
Body : 
 
{
    "data": {
        "name": "Flowroute Callflow",
        "numbers": ["no_match"],
        "flow": {
            "module": "resources",
            "data": {
                "use_local_resources": true,
                "outbound_flags": [
                    "Use_Flowroute"
                ]
            }
        }
    }
}
 
If i fetch the callflow details, then it shows
 
{
    "data": {
        "name": "Flowroute Callflow",
        "numbers": [
            "no_match"
        ],
        "flow": {
            "module": "resources",
            "data": {
                "use_local_resources": true,
                "outbound_flags": [
                    "Use_Flowroute"
                ],
                "caller_id_type": "external",
                "ignore_early_media": false
            }
        },
        "patterns": [],
        "id": "313f0a23386ce5096cc874e8ce3e1c96",
        "metadata": {}
    },
    "revision": "1-438e4f675ee0489d9f08c9a7530834cd",
    "timestamp": "2021-10-18T13:41:28Z",
    "version": "4.3.140",
    "node": "yMeslQexQufV5c-zOCJ0Ow",
    "request_id": "dd8d4cc26de38f9935891d7312aed8ae",
    "status": "success",
    "auth_token": "my-token"
}
 
 
But the problem is if i dialled my mobile number from zoiper client, then it shows Error Service Unavailable (500) in zoiper. Can you guys help me to figure out what i am doing wrong here? I have attached kazoo and freeswitch log.
 
Note : I did not add any Main Number to account. Is it any issue?

 

Link to comment
Share on other sites

@fmateo05 I am using formatter now but still same error. I am not sure whether i am using formatter in right way or not. After adding formatter to resource, resource detail is as follows now

{
    "data": {
        "name": "flowroute",
        "format_from_uri": true,
        "rules": [
            ".{7,}"
        ],
        "flags": [
            "Use_Flowroute"
        ],
        "formatters": {
            "outbound_caller_id_name": {
                "value": "kazoo"
            },
            "outbound_caller_id_number": {
                "value": "12408446009"
            }
        },

        "gateways": [{
            "caller_id_type": "external",
            "channel_selection": "ascending",
            "codecs": [
                "PCMU",
                "PCMA",
                "OPUS"
            ],
            "custom_sip_headers": {},
            "emergency": false,
            "enabled": true,
            "endpoint_type": "sip",
            "format_from_uri": true,
            "invite_format": "route",
            "password": "my_password",
            "prefix": "",
            "progress_timeout": 10,
            "realm": "sip.flowroute.com",
            "server": "sip.flowroute.com",
            "skype_rr": false,
            "suffix": "",
            "username": "my_username",
            "force_port": false,
            "port": 5060
        }],
        "emergency": false,
        "enabled": true,
        "from_account_realm": false,
        "grace_period": 5,
        "rules_test": [],
        "weight_cost": 50,
        "id": "f39a018667d617e8052fa0bc88ff77d2"
    },
    "revision": "24-b34137ec7a15bdf702c24f967abdfc98",
    "timestamp": "2021-10-19T18:23:15Z",
    "version": "4.3.140",
    "node": "yMeslQexQufV5c-zOCJ0Ow",
    "request_id": "b80d5e6234fc055ba32bfb539e499c96",
    "status": "success",
    "auth_token": "my_token"
}

 

@RuhNet  As per your suggestion , i have also added external caller ID on the user. User details is as below 

{
    "data": {
        "apps": {},
        "call_forward": {
            "substitute": false,
            "enabled": false,
            "failover": false,
            "require_keypress": false,
            "keep_caller_id": false,
            "direct_calls_only": false,
            "ignore_early_media": true
        },
        "call_restriction": {
            "closed_groups": {
                "action": "inherit"
            },
            "tollfree_us": {
                "action": "inherit"
            },
            "toll_us": {
                "action": "inherit"
            },
            "emergency": {
                "action": "inherit"
            },
            "caribbean": {
                "action": "inherit"
            },
            "did_us": {
                "action": "inherit"
            },
            "international": {
                "action": "inherit"
            },
            "unknown": {
                "action": "inherit"
            }
        },
        "caller_id": {
            "internal": {
                "number": "300003",
                "name": "Mehedi BMQA"
            },
            "
external": {
                "number": "12408446009",
                "name": "Kazoo"
            }

        },
        "hotdesk": {
            "require_pin": false,
            "keep_logged_in_elsewhere": false,
            "enabled": false,
            "id": ""
        },
        "contact_list": {
            "exclude": false
        },
        "priv_level": "user",
        "music_on_hold": {},
        "username": "mehedi.hasan@bengalmobileqa.com",
        "email": "mehedi.hasan@bengalmobileqa.com",
        "first_name": "Mehedi",
        "last_name": "BMQA",
        "presence_id": "300003",
        "flags": [],
        "vm_to_email_enabled": false,
        "verified": true,
        "ui_metadata": {
            "version": "4.3-140",
            "ui": "monster-ui",
            "origin": "callflows"
        },
        "smartpbx": {
            "find_me_follow_me": {
                "enabled": true
            },
            "call_recording": {
                "enabled": false
            }
        },
        "send_email_on_creation": true,
        "ringtones": {},
        "require_password_update": false,
        "enabled": true,
        "directories": {
            "undefined": "75b01106686d5b71d504864c500d6019",
            "b9d388d91d3f7ae631cda9a905cdcd0b": "75b01106686d5b71d504864c500d6019"
        },
        "do_not_disturb": {
            "enabled": false
        },
        "record_call": false,
        "id": "581f26b1c20d7ca49307eadc36d14204"
    },
    "revision": "17-3ddc2b1310de65a55053684083a5512e",
    "timestamp": "2021-10-19T18:28:19Z",
    "version": "4.3.140",
    "node": "yMeslQexQufV5c-zOCJ0Ow",
    "request_id": "260ae8c21d5363132766e71607cedf6f",
    "status": "success",
    "auth_token": ""
}

These caller id change effect can be seen at log but error is same.

2021-10-19T13:29:35.640417174Z [NOTICE] kazoo_node.c:466 log|g5JjzWMA7WqSxhXjHbyahg..|building xferext extension: bridge {origination_caller_id_number='12408446009',origination_caller_id_name='Kazoo',ignore_early_media='false',ecallmgr_Account-ID='36c8b00775c52885118d87b1cc7e78ca',ignore_display_updates='true',ecallmgr_Outbound-Flags='Use_Flowroute',ecallmgr_Realm='li89-28.members.linode.com',ecallmgr_Reseller-ID='36c8b00775c52885118d87b1cc7e78ca',effective_caller_id_number='12408446009',effective_caller_id_name='Kazoo',local_var_clobber='true'}[^^!origination_caller_id_name='kazoo'!leg_progress_timeout='10'!sip_from_uri='sip:12408446009@sip.flowroute.com'!ecallmgr_Global-Resource='false'!ecallmgr_Resource-ID='f39a018667d617e8052fa0bc88ff77d2'!ecallmgr_E164-Destination='+8801717580324'!ecallmgr_Original-Number='8801717580324'!ecallmgr_Matched-Number='+8801717580324'!ecallmgr_Resource-Type='offnet-termination'!absolute_codec_string='^^:PCMU:PCMA:OPUS'!effective_callee_id_number='+8801717580324'!effective_callee_id_name='8801717580324'!sip_auth_username='my_username'!sip_auth_password='my_password']sofia/sipinterface_1/+8801717580324@sip.flowroute.com

2021-10-19T13:29:35.640421103Z [NOTICE] kazoo_node.c:466 log|g5JjzWMA7WqSxhXjHbyahg..|building xferext extension: event Event-Name=CUSTOM,Event-Subclass=kazoo::masquerade,kazoo_event_name=CHANNEL_EXECUTE_COMPLETE,kazoo_application_name=bridge  

Link to comment
Share on other sites

You forgot the match regex in the formatters section. You can also use sngrep to see if the callerid is well formatted.

"formatters":{
     "from":[
         {"regex":"\\+?1?(\\d{10})$"
           ,"direction":"outbound"
          }
      ]
      ,"outbound_caller_id_number":[{
          "value":"<NUMBER HERE>"
      }],"outbound_caller_id_name":[{
          "value":"<NAME HERE>"
      }]
  },

 

Link to comment
Share on other sites

@fmateo05 thanks for your patience and cooperation . As per your suggestion i have added regex in the formatter section.But still no luck. I have attached a pcap file and sngrep screenshot. From pcap file, i am little bit confused whether the request is reached to flowroute or not.

After updating formatter, my current resource detail is as follow

{
    "data": {
        "name": "flowroute",
        "format_from_uri": true,
        "rules": [
            ".{7,}"
        ],sip_message.pcap
        "flags": [
            "Use_Flowroute"
        ],
        "formatters": {
            "from": [{
                "regex": "\\+?1?(\\d{10})$",
                "direction": "outbound"
            }],
            "outbound_caller_id_number": [{
                "value": "12408446009"
            }],
            "outbound_caller_id_name": [{
                "value": "kazoo"
            }]
        },
        "gateways": [{
            "caller_id_type": "external",
            "channel_selection": "ascending",
            "codecs": [
                "PCMU",
                "PCMA",
                "OPUS"
            ],
            "custom_sip_headers": {},
            "emergency": false,
            "enabled": true,
            "endpoint_type": "sip",
            "format_from_uri": true,
            "invite_format": "route",
            "password": "my_password",
            "prefix": "",
            "progress_timeout": 10,
            "realm": "sip.flowroute.com",
            "server": "sip.flowroute.com",
            "skype_rr": false,
            "suffix": "",
            "username": "my_username",
            "force_port": false,
            "port": 5060
        }],
        "emergency": false,
        "enabled": true,
        "from_account_realm": false,
        "grace_period": 5,
        "rules_test": [],
        "weight_cost": 50,
        "id": "f39a018667d617e8052fa0bc88ff77d2"
    },
    "revision": "26-2b129d38d2cec1e713a064c93a7240b9",
    "timestamp": "2021-10-20T08:21:32Z",
    "version": "4.3.140",
    "node": "yMeslQexQufV5c-zOCJ0Ow",
    "request_id": "0fd4c481a17edc12bd4b57c30b22979d",
    "status": "success",
    "auth_token": "my_token"
}

invite.png

sngrep-home.png

Link to comment
Share on other sites

@fmateo05 Flowroute tech prefix is 8 digit and it is same as sip username. Did you mean to add this under gateway section of resource configuration as like  (marked in red color) ? 

{
    "gateways": [{
        "caller_id_type": "external",
        "channel_selection": "ascending",
        "codecs": [
            "PCMU",
            "PCMA",
            "OPUS"
        ],
        "custom_sip_headers": {},
        "emergency": false,
        "enabled": true,
        "endpoint_type": "sip",
        "format_from_uri": true,
        "invite_format": "route",
        "password": "my_password",
        "prefix": "09....11",
        "progress_timeout": 10,
        "realm": "sip.flowroute.com",
        "server": "sip.flowroute.com",
        "skype_rr": false,
        "suffix": "",
        "username": "my_password",
        "force_port": false,
        "port": 5060
    }]
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...