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.
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