Zammad CRM Integration

Christof Lobmayer

Free User
Joined
Sep 13, 2018
Messages
17
Reaction score
6
Hi,

please integrate Zammad as CRM in 3CX. Zammad is from the same person how launch Zammad.

Zammad is a very good alternative to Zendesk because its open source and is very good. Zammad could connected to Facebook, Twitter and so on.

API documentation: https://docs.zammad.org/en/latest/api-intro.html

Zammad has already a generic CTI integration https://github.com/zammad/zammad/issues/2044

I think Zammad and 3CX could be one of the best combination for customer support.
 
  • Like
Reactions: autohaus
Upvote 13
To integrate it over opencnam is not an option because they are not an privacy shield verified. So GDPR don't allow it.

I hope Zammad and 3CX find a way to integrate their applications.
 
+1 for this idea
 
Hello everyone,
I have made a workaround
https://github.com/Mancy/Zammad_3CX
it's not perfect for Outbound calls, but it works
I had to make an external request to create a unique callID to be able to send hangup event on ReportCall action.
 
Hi Mancy,

Thank you so much - that's so helpful! :)
Please, can you give us more details about the configuration?
I doesn't work for me.

My configuration:

Zammad CTI Tocken = Endpoint ?
Zammad Ticket API URL = https://zammad.domain.com/api/v1/groups ?
Zammad Ticket API Token = User Access Token (Userprofile) or API OAuth Token? (API Configuration)

If i must use the user access token - how can it work with other agents?

I don't understand that callID configuration - can you send us a screenshot?

Thanks and Regards
Adolar
 
Zammad CTI Token is the CTI endpoint full URL
Zammad Ticket API URL = https://zammad.domain.com
Zammad Ticket API Token = User Access Token (Userprofile) with suitable permissions

If i must use the user access token - how can it work with other agents?
you'll have a user with admin privileges

I don't understand that callID configuration - can you send us a screenshot?
you don't have to do anything about it, I have just mentioned it because i need to requst the DateTime from an external resource to be able to create a unique call id
 
Last edited by a moderator:
Thank you for providing the integration wizard
Zammad provides CTI feature
https://docs.zammad.org/en/latest/cti-api-push.html
but 3CX does not provide events during the call, to make this Zammad feature perfect, 3CX only send two call events, contact lookup in the beginning of the call which does not provide any information other than the phone number and call journaling at the end of the call.



I would like 3CX to provide the following:
  • in the beginning of the outbound call should tells which agent placed the call not just a number but from/to/callid/datetime.
  • more events during the call
  • a key/callid to connect those events to a specific call
  • a notify that call has been connected to an agent
  • if there is a call feedback/survey menu for example after call has been ended by the agent, but the caller still connected, there should be a notify with caller selected options.
 
Hello @Mancy and thank you for your reply.

Each CTI integration requires a set of operations by the connected PBX. The connection of our platform with the CTI provides is something that indeed will pack a very nice integrated solution, but it is under internal discussion on when and the approach to move forward.

The easiest approach to reach that integration and have the option to get the contact information, create contacts and call journaling entries in the Zammad is via the Server-Side CRM template.

This can be done easily and approximately in 2-3 hour work (including reviewing the documentation) with the CRM Template Wizard.
 
Hello @Constantinos Constantinou,

I have been trying to intergrate zammad with 3CX. I have been trying to do this using the crm template wizard. However, the xml that is generated by the wizard is not accepted by the 3CX webportal. I have been comparing other xml files that are given as examples in the webportal and have not been able to spot the differences in the structure of the files. Is there any straightforward reason this might not work?

Kind regards
 
I have been trying to intergrate zammad with 3CX. I have been trying to do this using the crm template wizard. However, the xml that is generated by the wizard is not accepted by the 3CX webportal. I have been comparing other xml files that are given as examples in the webportal and have not been able to spot the differences in the structure of the files. Is there any straightforward reason this might not work?

I've managed to install the template. I made a Pull Request on github to provide minor fixes, but I cannot exactly recall if those were required for import. You can have a try.
 
I've managed to install the template. I made a Pull Request on github to provide minor fixes, but I cannot exactly recall if those were required for import. You can have a try.

Thank you for the quick response. I have completed all the steps that you described, changed the XML accordingly and created the token with admin.user permissions. CTI has been activated for a while on our zammad portal, i hope this is not a problem.

I have also changed the matching option in contacts at the 3CX side, however, the XML is still invalid when i try to upload it. Would it be possible for you to upload your xml file so that i can compare the two?
 
Would it be possible for you to upload your xml file so that i can compare the two?

I remember I had problems with the template with 3cx version 15. Then I upgraded to 16 and I was able to import it. Anyway here it is:
XML:
<?xml version="1.0"?>
<Crm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Country="TR" Name="Zammad" Version="1">
  <Number Prefix="Off" MaxLength="[MaxLength]" />
  <Connection MaxConcurrentRequests="16" />
  <Parameters>
    <Parameter Name="ctiUrl" Type="String" Parent="General Configuration" Editor="String" Title="Zammad CTI Endpoint URL:" Default="Your Zammad CTI Generic Endpoint full URL" />
    <Parameter Name="zammadUrl" Type="String" Parent="General Configuration" Editor="String" Title="Zammad URL:" Default="https://zammad.url.com" />
    <Parameter Name="apiToken" Type="String" Parent="General Configuration" Editor="String" Title="Zammad API Token:" Default="User API Token Access (HTTP Token Authentication)" />
    <Parameter Name="ReportCallEnabled" Type="Boolean" Editor="String" Title="Enable Call Journaling" Default="True" />
    <Parameter Name="tofield" Type="String" Parent="ReportCallEnabled" Editor="String" Title="Queue Name" Default="Customer Service" />
    <Parameter Name="CreateContactEnabled" Type="Boolean" Editor="String" Title="Enable Contact Creation" Default="True" />
    <Parameter Name="CreateContactFirstName" Type="String" Parent="CreateContactEnabled" Editor="String" Title="New Contact Name:" Default="[Number]" />
    <Parameter Name="CreateContactLastName" Type="String" Parent="CreateContactEnabled" Editor="String" Title="New Contact Name:" Default="3CX" />
  </Parameters>
  <Authentication Type="No" />
  <Scenarios>
    <Scenario Type="REST">
      <Request SkipIf="[ReportCallEnabled]!=True" Url="http://worldclockapi.com/api/json/utc/now" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json" />
      <Rules>
        <Rule Type="Any">currentDateTime</Rule>
      </Rules>
      <Variables>
        <Variable Name="Calldate" Path="currentDateTime">
          <Filter />
        </Variable>
      </Variables>
      <Outputs Next="newCall" AllowEmpty="false">
        <Output Type="Calldate" Passes="0" Value="[Calldate]" />
      </Outputs>
    </Scenario>
    <Scenario Id="newCall" Type="REST">
      <Request SkipIf="[ReportCallEnabled]!=True" Url="[ctiUrl]" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Post" ResponseType="Json">
        <PostValues>
          <Value Key="event" Passes="0" Type="String">newCall</Value>
          <Value Key="callId" Passes="0" Type="String">[Number][Calldate]</Value>
          <Value Key="to" Passes="0" Type="String">[tofield]</Value>
          <Value Key="from" Passes="0" Type="String">[Number]</Value>
          <Value Key="direction" Passes="0" Type="String">in</Value>
        </PostValues>
      </Request>
      <Variables />
      <Outputs AllowEmpty="false" />
    </Scenario>
    <Scenario Type="REST">
      <Request SkipIf="[IIf([FoundRecordCount]&gt;0,True,False)]" Url="[zammadUrl]/api/v1/users/search?query=mobile:[Number]&amp;limit=1" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Get" ResponseType="Json">
        <Headers>
          <Value Key="Authorization" Passes="0" Type="String">Token token=[apiToken]</Value>
        </Headers>
      </Request>
      <Rules>
        <Rule Type="Any">id</Rule>
      </Rules>
      <Variables>
        <Variable Name="Id" Path="id">
          <Filter />
        </Variable>
        <Variable Name="FirstName" Path="firstname">
          <Filter />
        </Variable>
        <Variable Name="LastName" Path="lastname">
          <Filter />
        </Variable>
        <Variable Name="Email" Path="email">
          <Filter />
        </Variable>
        <Variable Name="PhoneMobile" Path="mobile">
          <Filter />
        </Variable>
        <Variable Name="PhoneMobile2" Path="phone">
          <Filter />
        </Variable>
      </Variables>
      <Outputs AllowEmpty="false">
        <Output Type="ContactUrl" Passes="0" Value="[zammadUrl]/#user/profile/[Id]" />
        <Output Type="FirstName" Passes="0" Value="[FirstName]" />
        <Output Type="LastName" Passes="0" Value="[LastName]" />
        <Output Type="PhoneMobile" Passes="0" Value="[PhoneMobile]" />
        <Output Type="PhoneMobile2" Passes="0" Value="[PhoneMobile2]" />
        <Output Type="FullName" Passes="0" Value="[FirstName] [LastName]" />
      </Outputs>
    </Scenario>
    <Scenario Id="ReportCall" Type="REST">
      <Request SkipIf="[ReportCallEnabled]!=True" Url="[ctiUrl]" MessagePasses="0" RequestEncoding="UrlEncoded" RequestType="Post" ResponseType="Json">
        <PostValues>
          <Value Key="event" Passes="0" Type="String">hangup</Value>
          <Value Key="callId" Passes="2" Type="String">[Number][[CallStartTimeUTC].ToString("yyyy-MM-ddTHH:mmZ")]</Value>
          <Value Key="to" Passes="0" Type="String">[Agent]</Value>
          <Value Key="from" Passes="0" Type="String">[Number]</Value>
          <Value Key="direction" Passes="2" Type="String">[IIf([CallType]==Inbound||[CallType]==Missed,in,out)]</Value>
          <Value Key="cause" Passes="2" Type="String">[IIf([CallType]==Notanswered||[CallType]==Missed,noAnswer,normalClearing)]</Value>
          <Value Key="CallType" Passes="0" Type="String">[CallType]</Value>
          <Value Key="Number" Passes="0" Type="String">[Number]</Value>
          <Value Key="Agent" Passes="0" Type="String">[Agent]</Value>
          <Value Key="Duration" Passes="0" Type="String">[Duration]</Value>
          <Value Key="DurationTimespan" Passes="4" Type="String">[[[DurationTimespan].get_TotalMinutes()].ToString("F0")]</Value>
          <Value Key="DateTime" Passes="0" Type="String">[DateTime]</Value>
          <Value Key="CallStartTimeLocal" Passes="2" Type="String">[[CallStartTimeLocal].ToString("yyyy-MM-ddTHH:mm:ssZ")]</Value>
          <Value Key="CallStartTimeUTC" Passes="2" Type="String">[[CallStartTimeUTC].ToString("yyyy-MM-ddTHH:mmZ")]</Value>
          <Value Key="CallEndTimeLocal" Passes="2" Type="String">[[CallEndTimeLocal].ToString("yyyy-MM-ddTHH:mm:ssZ")]</Value>
          <Value Key="CallEndTimeUTC" Passes="2" Type="String">[[CallEndTimeUTC].ToString("yyyy-MM-ddTHH:mm:ssZ")]</Value>
        </PostValues>
      </Request>
      <Variables />
      <Outputs AllowEmpty="false" />
    </Scenario>
    <Scenario Id="CreateContactRecord" Type="REST">
      <Request SkipIf="[CreateContactEnabled]!=True" Url="[zammadUrl]/api/v1/users" MessagePasses="0" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
        <Headers>
          <Value Key="Authorization" Passes="0" Type="String">Token token=[apiToken]</Value>
        </Headers>
        <PostValues>
          <Value Key="firstname" Passes="2" Type="String">[[CreateContactFirstName]]</Value>
          <Value Key="lastname" Passes="2" Type="String">[[CreateContactLastName]]</Value>
          <Value Key="mobile" Passes="0" Type="String">[Number]</Value>
          <Value Key="phone" Passes="0" Type="String">[Number]</Value>
        </PostValues>
      </Request>
      <Rules>
        <Rule Type="Any">id</Rule>
      </Rules>
      <Variables>
        <Variable Name="Id" Path="id">
          <Filter />
        </Variable>
        <Variable Name="FirstName" Path="firstname">
          <Filter />
        </Variable>
        <Variable Name="LastName" Path="lastname">
          <Filter />
        </Variable>
        <Variable Name="Email" Path="email">
          <Filter />
        </Variable>
        <Variable Name="PhoneMobile" Path="mobile">
          <Filter />
        </Variable>
        <Variable Name="PhoneMobile2" Path="phone">
          <Filter />
        </Variable>
      </Variables>
      <Outputs AllowEmpty="false">
        <Output Type="ContactUrl" Passes="0" Value="[zammadUrl]/#user/profile/[Id]" />
        <Output Type="FirstName" Passes="0" Value="[FirstName]" />
        <Output Type="LastName" Passes="0" Value="[LastName]" />
        <Output Type="PhoneMobile" Passes="0" Value="[PhoneMobile]" />
        <Output Type="PhoneMobile2" Passes="0" Value="[PhoneMobile2]" />
        <Output Type="FullName" Passes="0" Value="[FirstName] [LastName]" />
      </Outputs>
    </Scenario>
  </Scenarios>
</Crm>
 
I remember I had problems with the template with 3cx version 15. Then I upgraded to 16 and I was able to import it. Anyway here it is:

I am not entirely sure what version we are using. It states to be up-to-date, but i would have to check with with networkmanager as do not see it stated in the webportal. [Edit] We are using version 15.5. So gathering from your experience that might be the issue [/Edit] There were some minor differences in the XML files however, after changing the neccesary parts in the code you uploaded the result was the same. None the less, thank you very much for going through the efffort! I will continue my search.
 
Last edited: