Hi,
Raúl Alexis Betancor Santana wrote:
Sorry Stefan, I forgot to send it also to the list
On Wednesday 02 December 2009 15:20:39 you wrote:
Hi,
have a look at apps/dsm/doc/examples/dsm_di_monit/, this is what you
want (control conference app from XMLRPC).
Great!, I'm reviewing it
Also, it is possible to invocate DSM apps from xmlrpci ?, and control
them?, let say to mute/unmute conference room participants ...
have a look at that example. for muting, look at test_conference_mute.dsm .
Umm, reviewing that i have some doubs:
- Who is able to mute/unmute a channel? anyone that press 1 or 2 ?
yes, but you can do the same by controlling it from XMLRPC.
- Why is needed to join the conference everytime a keypressed event occurs? to
change speakonly or listenonly status?
that changed more recently, use conference.rejoin() as in the example.
you won't really leave the conference, just that inout is set (for
muting). yes, it is for speakonly/listenonly status.
- I suppose 'myroom' it's a static name, how do I "create" new rooms from
xmlrpc and pass that roomnumber/name as a param to the DSM script?, lets say
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.)
So for example:
s.dial_auth('test_outgoing', 'sanchii', 'sip:[email protected]',
'sip:[email protected]', 'sipgate.de', '8xxxxxx', 'mypwd',
{'confname':'mysuperfancyroom'})
and then
conference.join($confname);
what I want to archive ...
- Create a new room from the xmlrpc client side
no need to "create the room" - when people join the room with the same
name, they will be in.
- Launch a call to a MoH server (maybe a DSM script that it's playing
a file
in loop)
easy, as above
- Join MoH as first participant
- Launch a call to a human participant
- Give hParticipant a wellcome annouce (on lobby state of
dsm_webconference?)
easy, as above
- Join hParticipant to the chatroom in listenonly mode (so it will
only hear
music from MoH particpant)
join($confname, listenonly)
- Repeat until all hParticipants are inside chatroom
- Chatroom Master join as last participant, no wellcome announce
simple:
python:
> s.dial_auth(... {'confname':'mysuperfancyroom', 'ismaster':'true'})
DSM:
initial state BEGIN;
transition "are we master" BEGIN - test($ismater==true) /
conference.join($confname) -> IN_CONFERENCE;
state IN_CONFERENCE;
...
- MoH participant is kicked-off chatroom
state IN_CONFERENCE;
transition "got kicked" IN_CONFERENCE - eventTest(#action=kick) /
stop(true) -> end;
- From now on .. only Chatroom Master is able to mute-unmute
hParticpants
from xmlrpc interface (so no keyPress(#) actions, instead I should create 2
transitions room - eventTest(#action==mute), room -
eventTest(#action==unmute) )
You can create calls with di_dial (examples/di_dial). In DSM there is
some code that you can pass authentication data, and/or variables, to an
outgoing DSM call.
This is what I don't know how to do, how do I do an auth call from xmlrpc and
join it to the conference.
I was thinking about something like:
s.dial_auth_b2b(
"click2dial", ....)
Using a "conference uri" as callee and "participant uri" as caller, but I
think that would give me problems :(
ATM this function is not in di_dial, but
i was mistaken here, it is already there, in dial_auth(...)
A totally different question, but related with DSM; Another app I'm trying to
develop as a DSM script it's one that will have to do:
- Launch a call to a participant
- Play an announce
- Record a responce from participant
- Send response in .mp3 to a mail address (this could be anything
else, save
on disk, etc.)
Till now I'm doing that with a click2dial xmlrpc call using as caller a
participant uri and as callee a SIP-uri of a user that is never online but
have a voicemail defined, so the call ends on a voicemail prompt (announce to
play) and when voicemail is recorded, it's encoded as mp3 and send by email.
But I whant to have some extra information send into the email as customs
values I have when I do the click2dial invocation but don't know how to send
that information to click2dial and then to the voicemail app, even I don't
know if that is possible as I'm doing.
I think that this kind of apps could be better do as DSM scripts, but again my
knowleadge of DSM is not soo spread that let me do it. Any example dsm script
I could follow?, I'm been taking a look at play_file.dsm, that is one part of
my problem, but that we have a recordFile() function available to been called
from DSM ?
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
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);
};
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);
} -> 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...
Regards
Stefan
Best regards
--
Stefan Sayer
VoIP Services Development
Warschauer Str. 24
10243 Berlin
tel:+491621366449
sip:[email protected]
email/xmpp:[email protected]
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems