zammad / zammad

Zammad is a web based open source helpdesk/customer support system
https://zammad.org
GNU Affero General Public License v3.0
4.49k stars 761 forks source link

Asterisk integration #467

Closed corny closed 5 years ago

corny commented 7 years ago

Is anyone interested in the integration of Asterisk? I have written a small program that uses the Asterisk manager API to recognize incoming calls and delivers the information via webhooks.

What is the best way to consume these hooks in Zammad? Creating a Integration::AsteriskController?

monotek commented 7 years ago

Please don't use this API. It is using telnet for communication with asterisk and therefore is insecure by default...

Asterisk is able to execute commands in the dialplan. You could use curl to access the REST API of an HTTPS protected Zammad.

corny commented 7 years ago

If the program runs on the asterisk host or the connection between the program and asterisk is secured on a lower level this is not a problem.

monotek commented 7 years ago

The questions to me also is, why somebody would like to use separate program if Asterisk and Zammad are already able to communicate with each other in a more secure way.

Just access the Zammad API from a Curl call in Asterisk dialplan: http://www.mehrdust.com/archives/using-curl-in-asterisk-dialplan https://docs.zammad.org/en/latest/api-ticket.html#create

Next thing is that i'm pretty sure most people would use Zammad and Asterisk on the same server.

corny commented 7 years ago

Using external scripts in the dialplan leads to several probleme:

Regardless of whether I use curl in the dialplan or the manager API - how should I implement the interface in Zamad? I don't want to create a ticket on each call. I want to use the CTI model as the sipgate.io integration does.

monotek commented 7 years ago

We use it this way with OTRS for years, without any problems. Ticket is only created when an agent is accepting the call.

corny commented 7 years ago

Well, that might fit well to your use case. It want to use it in a different way with the new CTI model.

monotek commented 7 years ago

Nevertheless there are better ways than using the old fashioned Asterisk 1.x AMI/Telnet API nowdays. Have a look at ARI:

https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573#AsteriskRESTInterface(ARI)-ARIFundamentals

corny commented 7 years ago

I took a closer look into the REST API. Unfortunately the modules are not yet included in the Asterisk packages of Debian 8 and Ubuntu 16.04.

mmojadad commented 7 years ago

Its my interest too. I am using Elastix ( Asterisk Based ).

martinvonwittich commented 5 years ago

I share @corny's concerns about putting synchronous actions into the dialplan, and so I've come up with my own solution - a simple Perl script that interfaces with Asterisk's AMI interface, listens for queue events, and pushes them via HTTPS to Zammad's CTI API.

I've posted about it here in the community: https://community.zammad.org/t/asterisk-zammad-cti-bridge-push-asterisk-queue-events-into-zammads-cti-integration/2327

Here's a direct GitHub link: https://github.com/martinvonwittich/asterisk-zammad-cti-bridge

IMO the AMI interface is suited just fine for this kind of purpose. I don't want to use ARI because as far as I understand it, it requires me to modify my dialplan and route calls into the Stasis dialplan application where they then have to be managed by my application, which is something I absolutely do not want. My bridge script is intended to be a passive watcher for Asterisk only - if it turns out to be buggy, then it should only break itself and not our telephony.

My script currently uses a plain unencrypted AMI connection because I was lazy, and therefore it needs to be put on the Asterisk server so it can connect via 127.0.0.1. As Asterisk also supports SSL-secured AMI, it should be possible to improve this.

dophulong commented 5 years ago

Hi @monotek Your comment : [ https://github.com/zammad/zammad/issues/467#issuecomment-263243704 We use it this way with OTRS for years, without any problems. Ticket is only created when an agent is accepting the call. ] [Me :] Agent was accepted call but can't show call or ticket on zammad.Do I have to fill what about phone/agent.id in zammad?. If have then fill where?

Thanks!

MrGeneration commented 5 years ago

Correct me if I'm wrong, I think this should be covered by our generic CTI integration? https://docs.zammad.org/en/latest/cti-api-intro.html

Also for Callerlog-Ticketactions, we have a fairly new feature since 3.1: https://zammad.com/news/release-3-1

dophulong commented 5 years ago

Thanks for your response quickly. I will try to find out as your info.

thorsteneckel commented 5 years ago

Hey @martinvonwittich - IIRC you have developed an Asterisk bridge, right? Since Zammad comes with the generic CTI integration in 3.1 (as @MrGeneration already mentioned) I assume it's save to close this issue. If you have any questions how to integrate any PBX please refer to the community board - we're happy to help.

numankhan82 commented 4 years ago

I installed all the pre-requisites for this script but still not working for me. Please help.

root@localhost:/home/numan# ./asterisk-zammad-cti-bridge Can't locate Asterisk/AMI.pm in @INC (you may need to install the Asterisk::AMI module) (@INC contains: /etc/perl /usr/local/lib/i386-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/i386-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/i386-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/i386-linux-gnu/perl-base) at ./asterisk-zammad-cti-bridge line 5. BEGIN failed--compilation aborted at ./asterisk-zammad-cti-bridge line 5.

martinvonwittich commented 4 years ago

I installed all the pre-requisites for this script but still not working for me. Please help. Can't locate Asterisk/AMI.pm

Hi @numankhan82,

this isn't necessarily the right place for this - asterisk-zammad-cti-bridge has its own repo.

Your issue is that the Asterisk::AMI CPAN package is missing. If you're on Debian, this isn't available as a Debian package and therefor cannot be installed via APT. Other distributions might have the same problem. You'll probably need to install it directly from CPAN, as documented:

cpan Asterisk::AMI

If you can't get it running, please post a separate issue in asterisk-zammad-cti-bridge.

numankhan82 commented 4 years ago

thank you I just installed it manually.

MrGeneration commented 4 years ago

Sorry, but I'm locking the conversation of this issue. Please do not recycle closed issues - especially not for technical questions like above.

For technical questions please feel welcome to ask your questions at the Community: https://community.zammad.org

If you require commercial support, you can also have a look at https://zammad.com/pricing#selfhosted if you're interested.