Telegram call notification

Good afternoon. I wrote such a script for sending notifications to telegrams.
The script works through Custom Destination.
[Telegram]
exten => s,1,NooP(~ Telegram notification ~)
exten => s,n,Set(tg_bot_api_key= BOT_API_Key)
exten => s,n,Set(tg_chat_id=CHAT_ID)
exten => s,n,Set(tg_message=Please%20call%20back%20me%20${CALLERID(num)})
exten => s,n,Set(tg_url_request=https://api.telegram.org/bot${tg_bot_api_key}/sendMessage?chat_id=${tg_chat_id}&text=${tg_message})
exten => s,n,NooP(${CURL(${tg_url_request})})
Should work like this.
The call comes through the trunk and then goes to the call recording group, then goes through the time zones.
After that, a telegram notification should come and the call should go to IVR.
But the creak just endlessly starts sending the incoming phone number without switching to IVR.
Tell me, how can I send a call to a specific IVR?
There are 5 incoming trunks and 4 IVRs.

I understand that I need to write a line that will send a call to the IVR, but I don’t understand how to send it to the specific IVR that I need.

Use the return() application and set in your custom destination to return to the IVR.

Good afternoon.
Please tell me.
How to send a call to one or another IVR?

There are 4 IVRs.
Everyone has their own id.


Translation to IVR must be done in the script.
Because the selected return in custom destination does not work.

Goto(ivr-<id>,s, 1l

Thank you very much. Everything worked out.
Now the script looks like this:
(Suddenly someone will come in handy)
[telegram]
exten => s,1,NooP(~ Telegram notification ~)
exten => s,n,Set(tg_bot_api_key=*****HERE-API-KEY)
exten => s,n,Set(tg_chat_id=**CHAT IDMay start with a minus)
exten => s,n,Set(tg_message=Please%20call%20back%20me%20${CALLERID(num)})
exten => s,n,Set(tg_url_request=https://api.telegram.org/bot${tg_bot_api_key}/sendMessage?chat_id=${tg_chat_id}&text=${tg_message})
exten => s,n,NooP(${CURL(${tg_url_request})})
exten => s,n,Goto(ivr-1,s,1)

The better way to do this is to end your dialplan block with a Return, and then enable the return option for the custom destination so you can choose the destination from the GUI, similar to what is explained here: IVR to read back the calling extension - #2 by lgaetz

Good afternoon.
I tried through the return, but then the call goes to an incomprehensible IVR, not the one specified in the Web interface.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.