How to modify the handling of a SIP message in Freeswitch? - freeswitch

I need to do special handling in freeswitch when receiving a REFER message from an Avaya SIP trunk. But I am not sure whether Sofia-SIP allows users to specify a callback hook when REFER is received. I haven't found one.
I want to add a custom freeswitch module just to handle REFER. How can I force Sofia-SIP to cede control to my custom module while handling REFER?

Having FreeSWITCH, i would recommend using the LUA module that provides a Event Callback for the REFER handling. This can allow you control with what you want to do with the REFER message.
mod_lua is well documented as a module in freeswitch. The pain is coding in LUA which is easy or hard based on your preferences.

I would suggest to place Kamailio server between them, and do the granular message handling as required

Related

Mailchimp Dynamic Content: add customized link in subscribe email

We want to start a service with Mailchimp where every subscriber will get a customized link in the email she receives. The Subscription Form will be on a wordpress website (not my decision).
There is a pool of thousand of links with a unique parameter, which we have stored on our webserver, like these examples
https://example.com/link?code=a25b1d085f3aec4b256
https://example.com/link?code=32219abb336de28a103
etc
Every code parameter should only be used once and should be kept as secret as possible. So I don't think it is a good idea to send the code from the form to mailchimp in a hidden field.
I don't know, if this is possible. Is Mailchimp even the right tool to do this?
I'm not sure, where to start the journey.
I don't think webhooks will help me here, as those are only one-way communication without a backwards channel, as far as I understand.
I checked the Mailchimp API documentation, but I might be too foolish to understand, which of the multiple options I need to use.
I found this answer here: https://stackoverflow.com/a/53096852/476951, but I don't know, if this will suit my needs. As I understand it, this will chhange the mail template in Mailchimp UI with an API request and store it. The successive emails will all use this changed template until I change the template again. This seems not to be the correct way.
So, here are the two workflows that might be possible, but I don't know if they are.
Have a form created in Wordpress (not the embedded Mailchimp form), and create a custom form handler with admin-post.php like described here. Then use the API to send the email through the Mailchimp service with my dynamic link in it. But how. Every tuorial I found sends campaigns via the API, not individual mails to single recepients
Somehow manage Mailchimp to get the dynamic content via some sort of webhooks or the likes.
Is any of these workflows suitable to do this?
If yes, who should I set these up?
Is there anything else I might have missed?
Edit
Or do I need to use Mailchimp Transactional Email service (former called Mandrill)?

How do I use Telegram API without a bot?

I don't need a reply bot.
I want to just make a read-only call to read the channel history. Probably I need †he method https://core.telegram.org/method/messages.getHistory but documentation https://core.telegram.org/api#getting-started does not even explain the protocol.
The protocol as I understand is pretty custom and I should use some minimal wrapper but all examples/articles I've managed to find link to https://github.com/atipugin/telegram-bot-ruby but I don't need a bot.
To use Telegram without a bot you should work with Telegram low-level protocol MTProto. There are MTProto libraries for Python, JavaScript and even for PHP. See examples of getting chat history with those libraries here, here and here
But it seems that there is no Ruby gem for this - bad luck, you should either create MTProto Ruby gem yourself, either move this functional to another service written in language that has MTProto library.
You can use tdlib-ruby
gem 'tdlib-ruby'

Twilio programmable custom voice call

I've recently started to use Twilio, for our own needs - we need to provide users with real-time informations about possible dangerous events that might have happened at their home, through SMS or Voice call.
I've tried to use VoiceCall exactly as it's specificied here - https://www.twilio.com/user/account/developer-tools/api-explorer/call-create. The scenario is that I want a robotic voice to explain what was happened, hence I need to generate the xml file for voice on demand. I supplied my own RestApi url for the voice, that is able to generate this file through TWIML.
By default Twilio, will use that url to fetch the audio and other instructions, at the moment when the call is performed. Since the voice URL cannot contain parameters (because they got cut off for some reason) (e.g YES - http://mywebsite.com/api/sayVoice, NO - http://mywebsite.com/api/sayVoice?eventId=1), you will ALWAYS get the same audio (no way to identify a different kind of event and generate a DIFFERENT xml output (for a different audio to the end user).
In Twilio documentation examples, they have only static URLs as well, without extra parameters, hence is that indeed the only way Twilio Call Api can be used?
It's hardly believable that such an use case was not planned for Twilio.
Did anyone tried to use Twilio for a similar scenario?
Any suggestions regarding similar technologies for the same purpose?
Found the issue in the end, you need to pass the parameters as RequestParams.
For example, this one will work - Url=http://mywebsite.com/api/twilio/sayVoice?eventId=379, while pathParam won't work Url=http://mywebsite.com/api/twilio/sayVoice/379.
Hence, stay safe and use RequestParams.

Suggested directory / module structure for multi-channel Yii2 app

I started my scheduling app with a basic app template for my app, it worked pretty well. Initially, it was only for IVR, now it started to add multiple channels (ivr, web, sms, etc). Each channel handles the user request differently and communicates the request in the requested channel, but all it does is scheduling. So, I started off with the following structure,
backend
common
frontend
modules
ivr
web
appt
For me, appt is going to be the core module and will be used by all channel modules. ivr and web modules handles request from different channels. If someone requests for appt, how can I pass the request data to appt module and send the appt's response back to user?
If it is an app without modules, it would be an instantiation of model and assigning form collected values to model, validate them, save and send the response in the request synchronously. How I can do the same, if my module depends on another module to perform validation and other business logic?
Can anyone shed some light on my approach? Should I go with module and just go back with the plain single app structure?
Edit:
My main confusion is whether IVR should go as a module or it should go as separate app as backend, frontend & console app does with Yii2 advanced template. The other modules that I'm considering are subscribe, script, notifier. Some modules are common to all channels and some others are specific to IVR.
When I considered 'appointment (appt)' as module and attempted to make appt from web module, I got stuck at how to instantiate models & retrieve error message.
I think modules should be loosed coupled, but for me, it appears to tightly integrated with other modules. What do you suggest from the following?
every purpose / feature as module and should be able to handle requests / response for all channels (ivr, web, etc)
every channel should be projected as module and should interact with feature modules. Does this over complate the module system?
Bring IVR as a separate app and import the necessary modules in it and add modules as needed?
Your question is a bit of a general nature and therefore are not able to give you a precise answer, however with Yii2 can pass information in multiple ways. You can redirect calls to redirect but I think the best solution is to instantiate in your module appt the services that you need. including the correct namespace with use ----\modules\ivr ... and then use the most appropriate methods of the modules that you need.
For the response to be sent to users must return obviously the information provided in different formats and so you must watch to the correct format for each channel type, but having successfully organized the different forms you will need, I think, limit yourself to make or specialize a render / echo appropriate.
Reply
Compared to Your I would keep in mind the following aspects: the various channels may well be separate modules strongly be decoupled between them.
The problem of integration and the coupling between the various components it would go to manage with a single module (appt) who cares to integrate and coordinate user requests and relay the various tasks on the specific functions of the channel.
It must also take account of the opportunity to manage the various features through a proper object-oriented architecture that would allow a further centralization of coordination actions between module functions and especially creandio an abstract channel from which specialize functions Common Channel (and relationship with the system components).
I look with particular interest in the fact of concenpire the IVR module as a module too different from the channels. Certainly it has some intrinsic speficità but try to work more in terms of modularity homogenous.
The discussion is still very wide. and we should be more specific to the needs of interaction and telecommunications that will set us as objective functional application.
I hope this will be useful

Detecting and logging phone call answer and phone call drop events?

I would like to know if its possible to detect and register an incoming call and also to register a droped call?
After doing a bit of research, I noticed a lot of comments on using the obscured event.
But problem here is that this event is not specific to phone calls and therefore the data collected will not be accurate.
Is there a way to verify which of the obscured events are actual incomming calls or dropped calls?
If this is possible, could you please respond with a sample code?
no there is no way to plug into phone call related events as there isn't any available option.
The current Windows Phone SDK (version 7.1.1) doesn't allow you to access any information about received/dropped calls, nor their log information...
I guess that you'd have to use do with Interop access to achieve such a thing, but that is always tricky!

Resources