User:Birgit bachler/Freeswitch: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "== Py PlayAndGetDigits == <pre> playAndGetDigits(int min_digits, int max_digits, int max_tries, int timeout, char *terminators, char *audio_fil...")
 
No edit summary
Line 12: Line 12:


</pre>
</pre>
== Example ==


<pre>
<pre>
Line 31: Line 29:
     actual_result = int(actual_result)
     actual_result = int(actual_result)
</pre>
</pre>
==
Python Dialplan API ==
getting digits maybe via dialplan?
<action application="set"
      data="foo=${python(my_script)}"/>

Revision as of 16:21, 28 April 2011

Py PlayAndGetDigits

playAndGetDigits(int min_digits, 
		 int max_digits, 
		 int max_tries, 
	         int timeout, 
		 char *terminators, 
	         char *audio_files, 
	         char *bad_input_audio_files, 
		 char *digits_regex)


tempfile = "/path/to/song.mp3"
in_rslt = self.session.playAndGetDigits(1,
                                        1,
                                        1,
                                        1000,
                                        "*#",
                                        tempfile,
                                        "",         
                                        "")      
                    
actual_result = in_rslt[1]
if not actual_result:
    actual_result = int(actual_result)

== Python Dialplan API ==

getting digits maybe via dialplan?
<action application="set"
     data="foo=${python(my_script)}"/>