projects
/
skype-conference-recorder.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c92c338
)
gstreamer file sink
master
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 6 Feb 2011 20:37:59 +0000
(21:37 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 6 Feb 2011 20:37:59 +0000
(21:37 +0100)
SkypeAPI.pm
patch
|
blob
|
history
diff --git
a/SkypeAPI.pm
b/SkypeAPI.pm
index
26683b5
..
2b522cc
100644
(file)
--- a/
SkypeAPI.pm
+++ b/
SkypeAPI.pm
@@
-107,10
+107,34
@@
sub Notify {
$self->Invoke('SET USERSTATUS NA');
}
$self->Invoke('SET USERSTATUS NA');
}
- if ( $string =~ m{CALL (\d+) STATUS INPROGRESS} ) {
+ if ( $string =~ m{CALL (\d+) STATUS RINGING} ) {
+ $self->Invoke("ALTER CALL $1 ANSWER");
+ } elsif ( $string =~ m{CALL (\d+) STATUS INPROGRESS} ) {
my $call_id = $1;
my $call_id = $1;
- my $port = 5000;
+ my $port = 5000 + $call_id;
+
+ my $gst = qq{
+ gst-launch -v
+ tcpserversrc port=$port !
+ "audio/x-raw-int,rate=16000,width=16,channels=1" !
+ wavenc !
+ filesink location=/tmp/$port.wav
+ };
+ $gst =~ s{[\s\n\r]+}{ }gs;
+
+ warn "# $gst\n";
+ open(my $g, '-|', $gst) || die $!;
+ while(<$g>) {
+ warn "## $_";
+ last if m/PREROLL/;
+ }
+
$self->Invoke(qq|ALTER CALL $call_id set_output port="$port"|);
$self->Invoke(qq|ALTER CALL $call_id set_output port="$port"|);
+ } elsif ( $string =~ m{CALL (\d+) STATUS FINISHED} ) {
+ my $port = $1 + 5000;
+ my $path = "/tmp/$port.wav";
+ warn "# $path ", -s $path, " bytes\n";
+# } elsif ( $string =~ m{} ) {
}
return 0;
}
return 0;