freeswitch 放音

使用default_language

1: phrase

2:say

===================

default_language

Controls the default language the Say Phrase engine will use when no language is explicitly specified in the API call. This permits you to easily support multiple languages by only changing a single variable at call time.

1: phrase

phrase <macro_name>,<data>
<action application="phrase" data="timespec,12:45:15"/>

Speak a phrase of text using a predefined phrase macro.

http://wiki.freeswitch.org/wiki/Speech_Phrase_Management

<macro name="custom_count">
     <input pattern="^(\d+):(.*)$">
      <match>
        <action function="play-file" data="custom/you_have.wav"/>
        <action function="say" data="$1" method="pronounced" type="items"/>
        <action function="play-file" data="custom/$2.wav"/>
      </match>
    </input>
  </macro>


2.say


3:

streamFile

4:获取数字

 destnum = session:playAndGetDigits(3, 20, 3, 5000, "#*", "phrase:getnum", "phrase:error", "\\d+")
<min> <max> <tries> <timeout> <terminators> <file> <invalid_file> <var_name> <regexp> <digit_timeout>

Parameters

  • min = Minimum number of digits to fetch (minimum value of 1)
  • max = Maximum number of digits to fetch (maximum value of 128)
  • tries = numbers of tries for the sound to play
  • timeout = Number of milliseconds to wait for a dialed response after the file playback ends and before PAGD does a retry.
  • terminators = digits used to end input if less than <max> digits have been pressed. (Typically '#')
  • file = Sound file to play while digits are fetched
  • invalid_file = Sound file to play when digits don't match the regexp
  • var_name = Channel variable into which digits should be placed
  • regexp = Regular expression to match digits
  • digit_timeout = Inter-digit timeout; number of milliseconds allowed between digits; once this number is reached, PAGD assumes that the caller has no more digits to dial
    • Note: digit_timeout is optional and defaults to the value of <timeout>

Channel Variables

On exit, there may be some useful values in channel variables

  • read_terminator_used = The digit used to terminate entry (if a digit was used). Note that if termination was due to a timeout or hangup, then this channel variable is not touched (so may be left as nil or whatever it was on entry)

http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_get_digits



你可能感兴趣的:(api,function,application,input,action)