Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] http_prefetch does not work with parameter profile


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
freeswitch-users at li...
Guest





PostPosted: Wed Mar 01, 2023 4:31 am    Post subject: [Freeswitch-users] http_prefetch does not work with paramete Reply with quote

------ Start of attached email. Subject: http_prefetch does not work with parameter profile ------
Hi

I used the mod_http_cache modul in order to manage a cache of audio files. I have a new profile in the http_cache.conf.xml:

<profiles>
<profile name="swift">
<default>
<header name="Authorization">Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJjb3Vu...g</header>
</default>
</profile>
</profiles>

In fs_cli when I call

http_get {profile=swift]http://xx.xx.xx.xx:pppp/audio.mp3 (xx.xx.xx.xx ip and pppp the port of our swift web server)

The profile "swift" is well used in order to add the header Authorization into the GET HTTP request, and the audio file is well added to the cache.
But if I used the http_prefetch the command failed:

freeswitch@fs1> http_prefetch {profile=swift}http://xx.xx.xx.xx:pppp/acdc.mp3
+OK

2023-03-01 09:38:34.351425 99.70% [DEBUG] mod_http_cache.c:659 Locked cache
2023-03-01 09:38:34.351425 99.70% [INFO] mod_http_cache.c:751 Cache MISS: size = 15 (70 MB), hit ratio = 4/20
2023-03-01 09:38:34.351425 99.70% [DEBUG] mod_http_cache.c:816 Adding {profile=swift}http://xx.xx.xx.xx:pppp/audio.mp3(/var/cache/freeswitch/15/2a01eb-0e9a-4988-a7e3-40c80c1c9c52.mp3) to cache index 15
2023-03-01 09:38:34.351425 99.70% [DEBUG] mod_http_cache.c:670 Unlocked cache
2023-03-01 09:38:34.351425 99.70% [DEBUG] mod_http_cache.c:1126 opening /var/cache/freeswitch/15/2a01eb-0e9a-4988-a7e3-40c80c1c9c52.mp3 for URL cache
2023-03-01 09:38:34.351425 99.70% [ERR] mod_http_cache.c:1187 Received curl error 3 HTTP error code 0 trying to fetch {profile=swift}http://xx.xx.xx.xx:pppp/audio.mp3
2023-03-01 09:38:34.351425 99.70% [DEBUG] mod_http_cache.c:659 Locked cache
2023-03-01 09:38:34.351425 99.70% [INFO] mod_http_cache.c:773 Failed to download URL {profile=swift}http://xx.xx.xx.xx:pppp/audio.mp3
2023-03-01 09:38:34.351425 99.70% [DEBUG] mod_http_cache.c:670 Unlocked cache


When I read the mod_http_cache.c source code in the http_cache_prefetch function it seems that the parameter prefetch is added to the command
without checking if other parameters are added:
url = switch_mprintf("{prefetch=true}%s", cmd);

this result of a bad url: {prefetch=true}{profile=swift}http://xx.xx.xx.xx:pppp/audio.mp3, and maybe this is why curl return an error.

How can i use http_prefetch with a profile?
Thanks Eric.




------ End of attached email ------
_________________________________________________________________________

The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.

Join our online community to chat in real time https://signalwire.community

Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com

Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services