拨打并启动asr
bgapi originate {origination_uuid=12345678}user/1000 ‘start_asr:xx yy zz, park’ inline
放音
uuid_broadcast 12345678 /home/w.wav
对应事件如下:
<event>
<headers>
<Event-Name>PLAYBACK_START</Event-Name>
<Core-UUID>c42aad28-0e79-4b57-be48-7232b35db8a2</Core-UUID>
<Unique-ID>12345678</Unique-ID>
<variable_current_application_data>/home/w.wav</variable_current_application_data>
<variable_current_application>playback</variable_current_application>
<Playback-File-Path>/home/w.wav</Playback-File-Path>
</headers>
</event>
放音暂停
使用uuid_fileman来控制声音文件的播放和暂停
uuid_fileman 12345678 pause
放音打断
使用uuid_break来实现打断的效果
uuid_break 12345678 all
对应的事件如下:
<event>
<headers>
<Event-Name>PLAYBACK_STOP</Event-Name>
<Core-UUID>c42aad28-0e79-4b57-be48-7232b35db8a2</Core-UUID>
<Unique-ID>12345678</Unique-ID>
<variable_current_application_data>/home/w.wav</variable_current_application_data>
<variable_current_application>playback</variable_current_application>
<variable_playback_last_offset_pos>170560</variable_playback_last_offset_pos>
<variable_playback_seconds>22</variable_playback_seconds>
<variable_playback_ms>22528</variable_playback_ms>
<variable_playback_samples>180224</variable_playback_samples>
<Playback-File-Path>/home/w.wav</Playback-File-Path>
<Playback-Status>break</Playback-Status>
</headers>
</event>
播放结束
对应事件
<event>
<headers>
<Event-Name>PLAYBACK_STOP</Event-Name>
<Core-UUID>c42aad28-0e79-4b57-be48-7232b35db8a2</Core-UUID>
<Unique-ID>12345678</Unique-ID>
<variable_current_application_data>/home/w.wav</variable_current_application_data>
<variable_current_application>playback</variable_current_application>
<variable_playback_last_offset_pos>371040</variable_playback_last_offset_pos>
<variable_playback_seconds>46</variable_playback_seconds>
<variable_playback_ms>46380</variable_playback_ms>
<variable_playback_samples>371040</variable_playback_samples>
<Playback-File-Path>/home/w.wav</Playback-File-Path>
<Playback-Status>done</Playback-Status>
</headers>
</event>