# outgoing.pl
# 
# example for using the perl SimpleCapi interface with Perl
# 
# Part of the caiviar package. 
# 
# Copyright (c) 2002 Matthias Kramm <kramm@quiss.org>
# 
# This file is distributed under the GPL, see file COPYING for details.

push @INC, "../../client/";
require SimpleCapi;

$capi = SimpleCapi::new("127.0.0.1",7347);
$capi->call("1234567890", 60);

$playjob = $capi->play("welcome.wav");
$recordjob = $capi->record("record.wav", 60);
while(1)
{
    $event = $capi->listen(1);
    next if($event->{type} == $capi->{CAPI_EVENT_TIMEOUT});
    last if($event->{type} == $capi->{CAPI_EVENT_DONE});
    last if($event->{type} == $capi->{CAPI_EVENT_HANGUP});
}

$capi->close();
