Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to record in async mode in freeswitch
    primarykey
    data
    text
    <p>I am trying to execute record command in async mode from Java esl, the reason is I have to play music on hold when ever request is processing, and play the wave file to theuser, stopping the moh, I have tried in sync mode but it did not work, I have tried the same in async mode using event lock for play and record, play and moh works fine but the problem is while recording,record command is called but not being executed, the same record command executed properly in sync mode, Please help I guess I am missing out something.</p> <p>This is record command</p> <pre><code> private void record(Channel channel, String path, int maxsilence, int i) { SendMsg recordMsg = new SendMsg(); recordMsg.addCallCommand("execute"); recordMsg.addExecuteAppName("record"); StringBuffer sb = new StringBuffer(); sb.append(path + i+ ".wav").append(" ").append(filelength).append(" ") .append(silenceThreshold).append(" "); if (maxsilence == 0) { sb.append(10000); } recordMsg.addExecuteAppArg(sb.toString()); System.out.println(System.currentTimeMillis()); recordMsg.addEventLock(); EslMessage response = sendSyncMultiLineCommand(channel, recordMsg.getMsgLines()); System.out.println(System.currentTimeMillis()); if (response.getHeaderValue(Name.REPLY_TEXT).startsWith("+OK")) { System.out.println(this.getClass().getName() + " &gt;&gt; recordMsg successful"); log.info(this.getClass().getName() + " &gt;&gt; recordMsg successful"); } else { log.error(this.getClass().getName() + " &gt;&gt; recordMsg failed: [{}}" + response.getHeaderValue(Name.REPLY_TEXT)); System.out.println(this.getClass().getName() + " &gt;&gt; recordMsg failed: [{}}" + response.getHeaderValue(Name.REPLY_TEXT)); } } </code></pre> <p>This is music on hold</p> <pre><code>public void playMusicOnHold() { SendMsg holdMusic = new SendMsg(); holdMusic.addCallCommand( "execute" ); holdMusic.addExecuteAppName( "playback" ); holdMusic.addExecuteAppArg("$${hold_music}"); EslMessage response = sendSyncMultiLineCommand(ctx.getChannel(), holdMusic.getMsgLines() ); if ( response.getHeaderValue( Name.REPLY_TEXT ).startsWith( "+OK" ) ) { System.out.println(this.getClass().getName()+" &gt;&gt; playMsg successful"); } else { log.error( this.getClass().getName() + " &gt;&gt; playMsg failed :" + response.getHeaderValue( Name.REPLY_TEXT ) ); System.out.println( this.getClass().getName() + " &gt;&gt; playMsg failed :" + response.getHeaderValue( Name.REPLY_TEXT ) ); } } </code></pre> <p>Please help me either to execute music on hold in sync mode or recording in async mode</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload