[Voiceglue] Passing a parameter from Asterisk, slashes won't work.
Emiliano Esposito
emiespo at tiscali.it
Fri Apr 3 05:18:46 EDT 2009
Andrew Zitnay ha scritto:
> I don't know whether or not this will fix your problem, but the
> slashes in the feed parameter of your URL should probably be
> URL-encoded, i.e.:
>
> http://localhost/ReadMyFeed/ReadMyFeed.php?feed=iltempo.ilsole24ore.com%2Frss%2Fhome.xml&max=
>
> Thus causing them to be double-URL-encoded when you URL-encode again:
>
> http%3A%2F%2Flocalhost%2FReadMyFeed%2FReadMyFeed.php%3Ffeed%3Diltempo.ilsole24ore.com%252Frss%252Fhome.xml%26max%3D
>
That seemed to work, but I couldn't find an easy way to do the trick in
Asterisk (I mean, simply calling URIENCODE twice has no effect,
obviously, nor would have passing an already encoded URL from SIP).
So I did something like this in Asterisk:
exten => s,n,Set(feed=${BASE64_ENCODE(${feed})})
exten => s,n,Set(feed=${URIENCODE(${feed})})
And just base64 decode on the CGI side.
Anyway, Voiceglue user guide should warn about this, and warn that the
"&" sign in URIs has to be encoded too.
Thank you for pointing me in the right direction!
Regards.
Emiliano E.
More information about the Voiceglue
mailing list