<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>54898</bug_id>
          
          <creation_ts>2025-06-23 17:03:11 +0300</creation_ts>
          <short_desc>freeswitch: imagick, http_cache: Invalid file format</short_desc>
          <delta_ts>2025-06-23 19:12:01 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>freeswitch-imagick</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugzilla.altlinux.org/show_bug.cgi?id=47326</see_also>
    
    <see_also>https://bugzilla.altlinux.org/show_bug.cgi?id=47382</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Artem Varaksa">varaksaaa</reporter>
          <assigned_to name="Anton Farygin">rider</assigned_to>
          <cc>at</cc>
    
    <cc>cas</cc>
    
    <cc>crux</cc>
    
    <cc>ender</cc>
    
    <cc>lav</cc>
    
    <cc>ldv</cc>
    
    <cc>mike</cc>
    
    <cc>qa_viy</cc>
    
    <cc>rider</cc>
    
    <cc>shaba</cc>
    
    <cc>viy</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>267673</commentid>
    <comment_count>0</comment_count>
    <who name="Artem Varaksa">varaksaaa</who>
    <bug_when>2025-06-23 17:03:11 +0300</bug_when>
    <thetext>Шаги
====

1. Настроить сервер:
  # apt-get install -y freeswitch-imagick freeswitch-daemon freeswitch-lang-ru freeswitch-sounds-ru-ru-elena-* &amp;&amp; \
    sed -i &quot;/default_password/s/1234/Pa##word/&quot; /etc/freeswitch/vars.xml &amp;&amp; \
    sed -i &quot;s/&lt;include&gt;/&lt;include&gt;\n&lt;X-PRE-PROCESS cmd=\&quot;set\&quot; data=\&quot;force_local_ip_v4=$(hostname -i)\&quot;\/&gt;\n&lt;X-PRE-PROCESS cmd=\&quot;set\&quot; data=\&quot;local_ip_v4=\$\${force_local_ip_v4}\&quot;\/&gt;/&quot; /etc/freeswitch/vars.xml &amp;&amp; \
    sed -i &quot;s/&lt;\/modules&gt;/&lt;load module=\&quot;mod_imagick\&quot;\/&gt;&lt;\/modules&gt;/&quot; /etc/freeswitch/autoload_configs/modules.conf.xml &amp;&amp; \
    sed -i &quot;s/&lt;context name=\&quot;public\&quot;&gt;/&lt;context name=\&quot;public\&quot;&gt;\n&lt;extension name=\&quot;public_extensions\&quot;&gt;\n&lt;condition field=\&quot;destination_number\&quot; expression=\&quot;^1007$\&quot;&gt;\n&lt;action application=\&quot;answer\&quot;\/&gt;\n&lt;action application=\&quot;playback\&quot; data=\&quot;{lazy=1}\/etc\/freeswitch\/file.pdf\&quot;\/&gt;\n &lt;\/condition&gt;\n&lt;\/extension&gt;/&quot; /etc/freeswitch/dialplan/public.xml &amp;&amp; \
    systemctl enable --now freeswitch  &amp;&amp; \
    sleep 5 &amp;&amp; \
    systemctl status freeswitch --no-pager -l &amp;&amp; \
    fs_cli

  Не выходить из консоли для просмотра логов.

2. Поместить любые тестовые файлы pdf, gif в `/etc/freeswitch/file.{pdf,gif}`.

3. На клиенте с p10:
  # apt-get install -y linphone

  Настроить Linphone:

  - При запуске закрыть мастер настройки.
  - Открыть Опции &gt; Параметры &gt; вкладка по умолчанию Управление учётными записями SIP &gt; в разделе Учётные записи нажать Добавить.
  - Ввести данные:
    - Ваш идентификатор SIP:  sip:1001@&lt;ip-адрес сервера c freeswitch&gt;
    - Адрес SIP прокси:   sip:&lt;ip-адрес сервера c freeswitch&gt;:5080
    - Остальные параметры оставить по умолчанию.
  - При запросе ввести пароль по умолчанию (Pa##word).
  - Закрыть окно настроек.

4. Позвонить на номер 1007 с клиента.

5. Также можно попробовать с gif:
  # sed -i &apos;s/file.pdf/file.gif/&apos; /etc/freeswitch/dialplan/public.xml

  # fs_cli
  freeswitch@...&gt; reloadxml

  и позвонить на тот же номер.


Фактический результат
=====================

Вывод в консоли:

&gt; 2025-06-23 16:22:22.113298 93.67% [INFO] mod_enum.c:884 ENUM Reloaded
&gt; 2025-06-23 16:22:22.113298 93.67% [INFO] switch_time.c:1436 Timezone reloaded 597 definitions
&gt; 2025-06-23 16:23:02.553272 99.77% [NOTICE] switch_channel.c:1142 New Channel sofia/external/1001@SERVER_IP [325176f2-b8e1-4171-8c7e-793ff7213580]
&gt; 2025-06-23 16:23:02.553272 99.77% [INFO] sofia.c:10460 sofia/external/1001@SERVER_IP receiving invite from &lt;CALLER_IP&gt;:52380 version: 1.10.12-release  64bit call-id: A2zwwjXUEg
&gt; 2025-06-23 16:23:02.553272 99.77% [INFO] mod_dialplan_xml.c:639 Processing 1001 &lt;1001&gt;-&gt;1007 in context public
&gt; EXECUTE [depth=0] sofia/external/1001@SERVER_IP answer()
&gt; 2025-06-23 16:23:02.593155 99.77% [INFO] switch_core_media.c:9560 Activating VIDEO RTCP PORT 9079 interval 1000 mux -1
&gt; 2025-06-23 16:23:02.593155 99.77% [NOTICE] sofia_media.c:90 Pre-Answer sofia/external/1001@SERVER_IP!
&gt; 2025-06-23 16:23:02.593155 99.77% [NOTICE] mod_dptools.c:1406 Channel [sofia/external/1001@SERVER_IP] has been answered
&gt; EXECUTE [depth=0] sofia/external/1001@SERVER_IP playback({lazy=1}/etc/freeswitch/file.pdf)
&gt; 2025-06-23 16:23:02.593155 99.77% [ERR] switch_core_file.c:346 Invalid file format [pdf] for [/etc/freeswitch/file.pdf]!
&gt; 2025-06-23 16:23:02.593155 99.77% [NOTICE] switch_core_state_machine.c:382 sofia/external/1001@SERVER_IP has executed the last dialplan instruction, hanging up.
&gt; 2025-06-23 16:23:02.593155 99.77% [NOTICE] switch_core_state_machine.c:384 Hangup sofia/external/1001@SERVER_IP [CS_EXECUTE] [NORMAL_CLEARING]
&gt; 2025-06-23 16:23:02.613172 99.77% [NOTICE] switch_core_session.c:1762 Session 1 (sofia/external/1001@SERVER_IP) Ended
&gt; 2025-06-23 16:23:02.613172 99.77% [NOTICE] switch_core_session.c:1766 Close Channel sofia/external/1001@SERVER_IP [CS_DESTROY]

Аналогично с gif:

&gt; 2025-06-23 16:33:07.733215 99.33% [ERR] switch_core_file.c:346 Invalid file format [gif] for [/etc/freeswitch/file.gif]!


Ожидаемый результат
===================

В окне с видео отображается pdf/gif-файл.

Примечание: могут воспроизводится также и другие ошибки:
* https://bugzilla.altlinux.org/47326
* https://bugzilla.altlinux.org/47382

Воспроизводимость
=================

Воспроизводится на виртуальных машинах:

[sisyphus] ALT Server 11.0 x86_64
freeswitch-daemon-1.10.12-alt4.x86_64

[p11] ALT Server 11.0 x86_64
freeswitch-daemon-1.10.12-alt2.x86_64

[p10] ALT Workstation 11.0 x86_64
freeswitch-daemon-1.10.11-alt1.x86_64</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>267684</commentid>
    <comment_count>1</comment_count>
    <who name="Artem Varaksa">varaksaaa</who>
    <bug_when>2025-06-23 19:12:01 +0300</bug_when>
    <thetext>Воспроизводится и с модулем mod_http_cache (подставить MEDIA_URL):

# MEDIA_URL=&quot;http://example.com/file.wav&quot; &amp;&amp; \
    sed -i &apos;s|&lt;/modules&gt;|&lt;load module=&quot;mod_http_cache&quot;/&gt;&lt;/modules&gt;|&apos; /etc/freeswitch/autoload_configs/modules.conf.xml &amp;&amp; \
    sed -i &apos;s|&lt;context name=&quot;public&quot;&gt;|&lt;context name=&quot;public&quot;&gt;\n&lt;extension name=&quot;public_extensions&quot;&gt;\n&lt;condition field=&quot;destination_number&quot; expression=&quot;^1017$&quot;&gt;\n&lt;action application=&quot;answer&quot;/&gt;\n&lt;action application=&quot;playback&quot; data=&quot;http_cache://MEDIA_URL&quot;/&gt;\n &lt;/condition&gt;\n&lt;/extension&gt;|&apos; /etc/freeswitch/dialplan/public.xml
    sed -i &quot;s|MEDIA_URL|$MEDIA_URL|&quot; /etc/freeswitch/dialplan/public.xml &amp;&amp; \
    fs_cli -x &quot;reloadxml&quot; &amp;&amp; \
    fs_cli

Позвонить на 1017 с клиента.

&gt; 2025-06-23 19:09:16.160182 99.83% [ERR] switch_core_file.c:346 Invalid file format [http_cache] for [http://git.testlink.ipa.basealt.ru/bigdata/multimedia/audio_files/file.wav]!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>