Asterisk integration with zammad cti bridge issue

Hello,

I am new to zammad and am configuring asterisk-zammad-cti-bridge for the first time by following this guide:

Right away, however, I can’t figure out what to do and where… in snso that in some steps of the guide it’s not clear if I have to do things in zammad or in asterisk.

in the “Setup” section of the guide for example, an ami user has to be created in /etc/asterisk/manager.d/zammad.conf but the manager.d folder doesn’t exist… i still solved it by creating the user from the freepbx GUI…

In step 5 the config.cfg file must be copied but it doesn’t say where… and so I try to copy in /etc/asterisk/

in step 8 it is asked to run the script ./asterisk-zammad-cti-bridge but from step 1 there is no mention of this script… where do I get it?

Should the second section of the “systemd” guide be followed for asterisk or zammad?

Please kindly help me to understand what I need to do to make this integration work? Has anyone already followed this guide and how did it work out?

Thank you

You have to download the script from the git repo, which you are reading from right now. Put it somewhere on your filesystem (mine is at /opt/asterisk-zammad-bridge/), copy the config to that folder and edit it like described.

Using systemd depends on your choice, if you want to start the script manually or as a service.

1 Like

Hello @richie_77,

thanks for answering me, I followed your advice and it seems to be making a step forward: I loaded the script and put in the folder /opt/asterisk-zammad-cti-bridge/ I edited the conf.cfg file and changed the permissions after which I started the script and now I get this result:

Can’t locate AnyEvent/HTTP.pm in @INC (@INC contains: /root/perl5/lib/perl5/5.16 .3/x86_64-linux-thread-multi /root/perl5/lib/perl5/5.16.3 /root/perl5/lib/perl5/ x86_64-linux-thread-multi /root/perl5/lib/perl5 /usr/local/lib64/perl5 /usr/loca l/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib 64/perl5 /usr/share/perl5 .) at ./asterisk-zammad-cti-bridge line 4.
BEGIN failed–compilation aborted at ./asterisk-zammad-cti-bridge line 4.

Could it be because of the perl version?

Maybe you have to load or install the modules first? As i remember, i had to install at least the Asterisk::AMI-Module. It looks like you have to install the AnyEvent::HTTP-Module as well.

1 Like

Right…
I actually skipped that step because perl is already there, but I understand that these dependencies are missing.

Now in fact I installed the module as you suggested and the script went ahead :slight_smile:

It stopped now at ‘version.pm’ with the same error:

Can’t locate version.pm in @INC (@INC contains: /root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi /root/perl5/lib/perl5/5.16.3 /root/perl5/lib/perl5/x86_64-linux-thread-multi /root/perl5/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /root/perl5/lib/perl5/Asterisk/AMI.pm line 621.
BEGIN failed–compilation aborted at /root/perl5/lib/perl5/Asterisk/AMI.pm line 621.
Compilation failed in require at ./asterisk-zammad-cti-bridge line 5.
BEGIN failed–compilation aborted at ./asterisk-zammad-cti-bridge line 5.

Since the guide shows how to install for debian I do a check first to know if the libraries are also the same for centos7, I will then try to install and restart the script

I’m installed the equivalent packages for centos:

  1. libanyevent-http-perl:
  • CentOS Equivalent: perl-AnyEvent-HTTP
  1. libconfig-simple-perl:
  • CentOS Equivalent: perl-Config-Simple
  1. libdata-printer-perl:
  • CentOS Equivalent: perl-Data-Printer
  1. liblog-any-perl:
  • CentOS Equivalent: perl-Log-Any
  1. liblog-any-adapter-dispatch-perl:
  • CentOS Equivalent: perl-Log-Any-Adapter-Dispatch
  1. libwww-form-urlencoded-perl:
  • CentOS Equivalent: perl-URI-Encode

But obtain the same error:

Can’t locate version.pm in @INC (@INC contains: /root/perl5/lib/perl5/5.16.3/x86_64-linux-thread-multi /root/perl5/lib/perl5/5.16.3 /root/perl5/lib/perl5/x86_64-linux-thread-multi /root/perl5/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /root/perl5/lib/perl5/Asterisk/AMI.pm line 621.
BEGIN failed–compilation aborted at /root/perl5/lib/perl5/Asterisk/AMI.pm line 621.
Compilation failed in require at ./asterisk-zammad-cti-bridge line 5.
BEGIN failed–compilation aborted at ./asterisk-zammad-cti-bridge line 5.

Maybe this helps:

Furthermore it might like better, to upgrade to a newer OS release. Centos7 will become eol in a few months.

1 Like

Just as a side note…
CentOS 7 is going EOL end of June 2024.

There’s already no current Zammad packages for CentOS 7 available any more.

Please consider upgrading to a more current and better maintained Distribution.
I hope that you’re at least somewhere at 6.x already …

@richie_77 thank you,

i’ve installed

perl-version
perl-DDP
perl-WWW-Form-UrlEncoded
perl-Module-Build
perl-YAML

after that i’ve run the script and obtain this:

[root@tsmr asterisk-zammad-cti-bridge]# ./asterisk-zammad-cti-bridge
2024-03-27 12:21:55 +0100 [info] connecting to Asterisk…
2024-03-27 12:21:55 +0100 [info] connection established
2024-03-27 12:21:55 +0100 [debug] got event: FullyBooted
2024-03-27 12:22:22 +0100 [debug] got event: Registry
2024-03-27 12:22:22 +0100 [debug] got event: Registry
2024-03-27 12:23:07 +0100 [debug] got event: Registry
2024-03-27 12:23:07 +0100 [debug] got event: Registry
2024-03-27 12:23:29 +0100 [debug] got event: Newchannel
2024-03-27 12:23:29 +0100 [debug] got event: VarSet
2024-03-27 12:23:29 +0100 [debug] got event: Newexten
2024-03-27 12:23:29 +0100 [debug] got event: VarSet
2024-03-27 12:23:29 +0100 [debug] got event: VarSet
2024-03-27 12:23:29 +0100 [debug] got event: VarSet
2024-03-27 12:23:29 +0100 [debug] got event: VarSet
2024-03-27 12:23:29 +0100 [debug] got event: VarSet
2024-03-27 12:23:29 +0100 [debug] got event: VarSet
2024-03-27 12:23:29 +0100 [debug] got event: VarSet
2024-03-27 12:23:29 +0100 [debug] got event: VarSet
2024-03-27 12:23:29 +0100 [debug] got event: Newexten
2024-03-27 12:23:29 +0100 [debug] got event: VarSet
2024-03-27 12:23:29 +0100 [debug] got event: VarSet
2024-03-27 12:23:29 +0100 [debug] got event: Newexten
2024-03-27 12:23:29 +0100 [debug] got event: VarSet

means that working?

I think so. These are the ami-events.

Just create a queue (if you don’t have that done already) in your freepbx and call the queue. Than you should see calls in zammad.

1 Like

Hello richie_77,

doesn’t seem to be working. there are ami-events but in zammad non view the new entries.

Your script on your pbx should produce an output like that on an incoming call:

2024-03-27 17:35:14 +0100 [debug] got event: QueueCallerJoin
2024-03-27 17:35:14 +0100 [info] pushing to Zammad post queue: direction=in&callId=99271711557291.8081&event=newCall&from=01xxxxxx7&to=Werkstatt
2024-03-27 17:35:14 +0100 [info] posting to Zammad: direction=in&callId=99271711557291.8081&event=newCall&from=01xxxxxx7&to=Werkstatt
2024-03-27 17:35:17 +0100 [debug] got event: QueueCallerAbandon
2024-03-27 17:35:17 +0100 [debug] Queue: 9927
2024-03-27 17:35:17 +0100 [info] pushing to Zammad post queue: event=answer&callId=99271711557291.8081&direction=in&user=Uebergabe
2024-03-27 17:35:17 +0100 [info] pushing to Zammad post queue: event=hangup&callId=99271711557291.8081&direction=in&cause=normalClearing
2024-03-27 17:35:17 +0100 [info] posting to Zammad: event=answer&callId=99271711557291.8081&direction=in&user=Uebergabe
2024-03-27 17:35:17 +0100 [info] posting to Zammad: event=hangup&callId=99271711557291.8081&direction=in&cause=normalClearing

Your zammad production.log should then have entries like that:

I, [2024-03-27T17:40:12.147499#188340-31664760]  INFO -- : Started POST "/api/v1/cti/kb6lTWc0nweyffr_8" for 192.168.40.1 at 2024-03-27 17:40:12 +0100
I, [2024-03-27T17:40:12.154481#188340-31664760]  INFO -- : Processing by Integration::CtiController#event as HTML
I, [2024-03-27T17:40:12.154613#188340-31664760]  INFO -- :   Parameters: {"direction"=>"in", "from"=>"03xxxxxx40", "to"=>"JSK", "callId"=>"99201711557601.8086", "event"=>"newCall", "token"=>"kb6lFqqr0nweyffr_8"}
I, [2024-03-27T17:40:12.297110#188340-31664760]  INFO -- : Completed 200 OK in 142ms (Views: 0.3ms | ActiveRecord: 55.7ms | Allocations: 28101)
1 Like

the script in my pbx doesn’t play them–I’ll investigate to see what happens when I run the script.

I will update you as soon as I have news. My output only brings back [debug]

But you have a queue with agents in your pbx, that can be called?