Zammad: How to implement Telegram?

Created on 16 Feb 2017  ·  29Comments  ·  Source: zammad/zammad

I'm trying to get telegram flying. I allready created a telegram bot and put the accesstoken in the zammad telegram configuration. But when i chat the telegram bot, nothing apears in zammad.

Is there something special with the configuration to look for?

Thanks!

channel question

Most helpful comment

Yea, after adding the certificate chain Telegram is working! Thanks!

All 29 comments

Hi @Julian0o,

can you check if you receive the telegram webhock messages by watching in your Zammad log file (log/production.log) and enter a new chat message via telegram client?

If there is no entire, just delete you telegram bot (via BotFather and in Zammad admin interface), register the bot again and add it again in Zammad admin interface. Then try sending new messages via telegram client again.

If there is an entry in log/production.log but no ticket in Zammad appears, there should be an error message which helps me to get it working. :)

-Martin

Thanks Martin.

I will test this. But i have something in mind. Our new Next Generation Super Duper Firewall :) Will check this.

Okay, No Firewall Issue. But i get nothing in the logs. Only when i add the telegram token.

Okay, No Firewall Issue. But i get nothing in the logs. Only when i add the telegram token.

That's correctly. Telegram is checking the connection to your Zammad instance (only https, valid certificate and so on...).

-=> Normally this should work now, just fine.

Can you try to delete and add your bot at telegram again (just to be sure). And can somebody else write to you bot too?

Have already made a new bot and someone else has also written to the bot. The bot has no special settings to be set?

No. No special settings. And I tested it today about 10:00 with a complete new number and new bot. Just was working fine. :-/

For me it was an HTTPS issue. Telegram needs an HTTPS endpoint with valid certificates (as @martini mentioned above). After switching from HTTP to HTTPS it incoming messages were possible.

I have a valid SSL Certificate.

JFI: https://docs.zammad.org/en/latest/channel-telegram.html -> no extra settings for bot settings. Just normal (fast) way.

Strang is, that the first/initial telegram http call works fine. If your http_type or fqdn would be wrong, you would get there an error message back from telegram. -> But telegram says, all fine (otherwise you would get an error message in Zammad).

It seems that telegram itself has an issue right now. 🤔 Try to test in in 30 min again. Strange.

Any news today? You get the http calls from telegram now?

Having the same problem. Bot registered and green in Zammad configuration. When I send a message with telegram there goes nothing in Zammad. There is also no message in production.log.

Using a valid SSL certificate and Zammad is reachable with HTTPS.

Problem still persists. No Idea why...

I can't reproduce it. @Julian0o @mgibu27 have you already tried to create a new bot?

Yes, I already tried it with two other new bots. But still the same problem.
I'm running Zammad on a private DSL line with no static IP but I use DynDNS for public access from the web. The SSL certificate is valid and I use the standard HTTPS Port 443.
Do I need another port for telegram or something?

I also tryed another telegram account with a new bot. There is nothing in the logs. Maybe we could start a teamviewer session to look for the problem. I'm from Düsseldorf ;)

@Julian0o I live really close to Düsseldorf. If you want we could hang out at starbucks or any other place to have a nice talk and a debugging session. Send me an email or ping me on twitter!

@mgibu27 I wonder if telegram has some special check on the resolved ip address (would be strage). Might still be related to @Julian0o's problem. Does HTTP port 80 also serve your zammad instance or redirect to HTTPS?

@schurig You've got mail.

We have a special configuration here.
Public IP -> PaloAlto NG Firewall -> Kemp Loadmaster -> Zammad
Maybe this does something unspecified...

Same problem here.
Do I also need to allow http (port 80) in our firewall?

I already tried with a newly created bot, but no luck. After starting a chat with the bot, neither a welcome-message is sent nor ticket created. zammad-log is quiet too.

@schurig @Julian0o any process/feedback here? Anything discover why telegram is not sending messages to you?

@martini No nothing yet. We forgot our date :) Will try to start a new session with @schurig

Currently when i chat the telegram bot, nothing apears in zammad. Is there any issue ?

Currently when i chat the telegram bot, nothing apears in zammad. Is there any issue ?<

Did it work earlyer?

@Julian0o
No. Its new zammad implementation. But i used this bot also for my crisp chat, In crisp side also do not working.

I installed SSL and now Telegram bot working fine. :)

Update: Today I figured out why telegram is not sending a message to the webhook endpoint.

Get the reason why Telegram is not sending webhooks

You can ask telegram what the issue is:
curl https://api.telegram.org/bot:your_bot_key/getWebhookInfo

I my case, telegram was not able to verify my SSL certificate:

"last_error_message":"SSL error {337047686, error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed}"

But in my browser the SSL certificate look fine.

Why?

Telegram need the whole certificate chain (it's also called CA Bundle or full chained certificate).

How to verify if my server is serving full chained certificate?

Use the following url, just replace support.zammad.com with your host: https://www.ssllabs.com/ssltest/analyze.html?d=support.zammad.com&hideResults=on&latest

If you see "Chain issues: Incomplete" you do not serve full chained certificate.

How to fix that?

Download the full chained certificate for your SSL certificate provider and install this on your webserver.

References:

https://www.cubewebsites.com/blog/guides/fix-telegram-webhooks-not-working/

Nice! This could be the solution. I will try it when there is some time to play with zammad ;)

Yea, after adding the certificate chain Telegram is working! Thanks!

Thanks for feedback! 🤓

Was this page helpful?
0 / 5 - 0 ratings