Skip to content

Asterisk integration with Bitrix24 and SuiteCRM

License

Notifications You must be signed in to change notification settings

MrSykes/asterlink

 
 

Repository files navigation

AsterLink

Asterisk CRM Connector. Supports FreePBX v14 and VitalPBX v3+ integration with Bitrix24 and SuiteCRM.

Asterisk

You need Asterisk 13+.
To monitor how call is going this connector listens for AMI events.

There should be 4 different contexts to distinguish calls:

  • incoming_context - context for incoming calls from voip trunk. inbound calls will be registred there
  • outgoing_context - context for outgoing calls. outbound calls will be registred there
  • ext_context - extensions dials from queue, ring group, etc. use this context to route incoming calls to your extensions
  • dial_context - context for originating (click2dial) calls

Default configuration is tested to work with FreePBX v14 and Asterisk v13.

Here is configuration for basic-pbx asterisk dialplan:

dialplan:
  incoming_context:
  - DCS-Incoming
  outgoing_context:
  - Outbound-Dial
  ext_context:
  - Dial-Users
  - DCS-Incoming
  dial_context: Long-Distance

You see DCS-Incoming in ext_context because we are dialing queue extensions directly from incoming context.
(queue memeber config member => PJSIP/1101 and not member => Local/1101@Dial-Users like in freepbx).

Here is the configuration for VitalPBX dialplan:

VitalPBX

dialplan:
  incoming_context:
  - trk-4-in
  outgoing_context:
  - trk-4-dial
  ext_context:
  - trk-4-in
  - ivr-only-extensions
  - cos-Standard
  - sub-local-dialing
  dial_context: cos-Standard

CallerID Format

Connector can format CallerID using regexp. This useful when your VoIP provider doesn't send desired format.

  • cid_format - from PBX to CRM
  • dial_format - from CRM to PBX
    • expr - regual expression (use double blackslashes)
    • repl - replace pattern

If config is set and callerid doesn't matched any of regexp, then call will be ignored.

CRM Integration

See instructions in the following files:

Install

Install asterlink under /opt/asterlink folder.

  • Create folder /opt/asterlink
    mkdir /opt/asterlink; cd /opt/asterlink
  • Download binary from releases page
    wget https://github.com/MrSykes/asterlink/releases/latest/download/asterlink_x86_64.tar.gz
    tar xvf asterlink_x86_64.tar.gz && rm asterlink_x86_64.tar.gz
    chmod +x asterlink
    • Or build it from source (assume you have go installed)
    go get github.com/MrSykes/asterlink
    go build github.com/MrSykes/asterlink
  • Create configuration file. Use conf.example.yml as example.
    wget https://raw.githubusercontent.com/MrSykes/asterlink/master/conf.example.yml
    mv conf.example.yml conf.yml
    nano conf.yml
    Note: config file is using YAML format and it requires to have proper indentation.
    Use online yaml validator to check your file for errors.
  • Test run
    ./asterlink

Startup script example

Create /etc/systemd/system/asterlink.service file with following contents:

[Unit]
Description=AsterLink Connector
After=freepbx.service

[Install]
WantedBy=multi-user.target

[Service]
ExecStart=/bin/sh -c 'exec /opt/asterlink/asterlink >>/opt/asterlink/app.log 2>>/opt/asterlink/err_app.log'
WorkingDirectory=/opt/asterlink
Restart=always
RestartSec=5
systemctl enable asterlink
systemctl start asterlink

About

Asterisk integration with Bitrix24 and SuiteCRM

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 47.2%
  • PHP 36.6%
  • Smarty 8.9%
  • JavaScript 7.3%