[Freeswitch-users] Passing stuff from javascript to mod_xml_curl and then to a authentication web service
Oivvio Polite
mylists at polite.se
Fri May 6 17:43:21 MSD 2016
Today I've been trying to grok mod_xml_curl.
I've set up a webservice that xml_curl will call to get the
user directory.
I've figured out from experimentation that my endpoint gets called
whenever a sip user tries to register or in my case when verto is
initialized in the browser.
What I haven't figured out is how to pass stuff from the browser to
mod_xml_curl and then on to the webservice.
In my case I want to pass a JSON Web Token. I can pass it as the
passwd argument in the verto initialization.
vertoHandle = new jQuery.verto({
login: 'user at mydomain',
passwd: 'xxxxxx',
socketUrl: 'wss://mydomain:8082',
deviceParams: {
useMic: true,
useSpeak: true
},
iceServers: true
}, vertoCallbacks);
But how then do I pick that up in in my xml_curl conf and pass it on to the webservice?
<configuration name="xml_curl.conf" description="cURL XML Gateway">
<bindings>
<binding name="directory">
<param name="gateway-url" value="https://127.0.0.1/my_jwt_checking_webservice" bindings="directory"/>
</binding>
</bindings>
</configuration>
The webservice will be running on the same box as FS so passing the token to it as a URL paramater or as a HTTP header
would be equally fine by me, but right now I can't even figure out how to access it.
Regards Oivvio
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users
mailing list