Hello.
I’m integrating Asterisk with ntfy
to send push notifications on incoming calls to mobile clients to wake up baresip
. As part of that I’d like to send two notifications within the same channel, one is a wake-up notification (consumed by Tasker
to open baresip
), and the other one in case the call is missed, which would be actually displayed on a mobile client.
To do that, I call channel.CURL()
with ntfy
endpoint specified (note I use Lua dialplan), and before this call I set up ntfy
-related HTTP headers like this: channel["CURLOPT(httpheader)"]:set("Title: " .. msg_title)
. For two different notifications I’d like to have two different titles, and this is ruled by this very HTTP header.
The problem is that within the same channel the HTTP headers set by CURLOPT
just add up (as documented, no complaints), there’s no way to remove what was added before (I studied the documentation and the code to my best extent and didn’t find such a possibility), and then ntfy
client gets all those headers and just uses the first one meaning what was added later gets ignored.
So, the question is: is it in fact possible to remove/replace specific HTTP header added via CURLOPT
in the same channel, and if so, how? Or is there a way to just reset everything added via CURLOPT
? And if not, is there any clever workaround?
Thanks.