On Saturday 05 December 2009 02:04:35 Stefan Sayer wrote:
> Hi,
Hi Stefan, and thanks a lot for your work.
> you can use the last parameter of dialout_auth.
> s.dial_auth('test_outgoing', 'sanchii', 'sip:[email protected]',
> 'sip:[email protected]', 'sipgate.de', '8xxxxxx', 'mypwd',
> {'ha':'hups'})
>
> will give you one variable $ha with the value hups (try logVars() to
> see all variables.)
It's possible to pass arrays as params ?, let say ... a $variable with more
than one value and accessed as $variable[0], I have done the trick sending a
concatenaed string and spliting it with py ( ... )
> > - Launch a call to a MoH server (maybe a DSM script that it's
> > playing a file
> > in loop)
>
> easy, as above
How to play a file in loop? ... controlling a noAudioTest transsition and
going back to playing state?, so only will end in a "kick" event that will
fire transition from playing to bye ... well it's not an efficent MoH
server .. but will work :-)
[...]
> have a look at all the text files in doc/, especially doc/dsm_syntax.txt:
> recordFile(filename)
> Throws "file" exeption with #path if file can not be opened for
> recording
>
> stopRecord()
> getRecordLength([dst_varname]) -- only while recording! default
> dst var: record_length
> getRecordDataSize([dst_varname]) -- only while recording! default
> dst var: record_data_size
So this two functions could only be called JUST before calling stopRecord, is
that true?
> e.g. something like this:
>
> s.dial_auth(... {'welcome_prompt':'welcome.wav', 'recfile':'recording'})
>
> ------------
> import(mod_dlg);
> import(mod_py);
>
> initial state BEGIN
> enter {
> playFile($welcome_prompt);
A question about path's .... where will be looked for $welcome_promt? at DSM
dir? at /etc/sems? at /usr/lib/sems/audio? ... I mean by default.
> };
> transition "uh, error" BEGIN - exception; / stop(true) -> END;
> transition "welcome ends" BEGIN - noAudioTest / {
> set($rec_fname=$recfile);
> append($rec_fname, .wav);
> recordFile($rec_fname);
> setTimer(1, 120);
Is this a timer of "max length"? so not for been recording forever
> } -> RECORDING;
>
> state RECORDING;
> transition "timer hit" RECORDING - timerTest(#id==1) / {
> getRecordLength(rec_length);
> stopRecord();
> dlg.bye();
> } -> PROCESSING;
> transition "bye" RECORDING - hangup / {
> getRecordLength(rec_length);
> stopRecord();
> } -> PROCESSING;
>
> state PROCESSING enter {
> -- could better use a sys.exec method than using python here...
> py(
> import os
> os.system(' lame ' + session.var('rec_fname') + ' ' +
> session.var('recfile')+'.mp3')
> )
> -- but maybe use python for sending smtp as well?
> -- or add some DI method to voicemail app...
>
> };
> transition "ok, done" PROCESSING - / stop(false) -> END;
>
> transition "bye received" BEGIN - hangup / stop(false) -> END;
> state END;
> ----------------------------
>
> note that the "uh, error" transition will also capture exceptions on
> recording...
And on playing of prompts and announces ...
A question about "playing" ... playing out something culd only occurs on enter
and exit of states but not on trasitons, is that true ?
And last ... just as a curiosity, using lame produce a very bad quality .mp3,
compared with the one produced by the voicemail app with the .mp3 format
pluging.
Best regards.
--
Raúl Alexis Betancor Santana
Dimensión Virtual
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems