Bugfix: FreeSWITCH::Client::sendmsg was returning the first FSES packet it received, which caused a race condition when an event was in transit; now it waits for Content-Type: command/reply

This commit is contained in:
Luke Dashjr 2011-03-08 16:50:35 -06:00
parent 4861e34bd2
commit 189d81a1b2
1 changed files with 7 additions and 1 deletions

View File

@ -143,7 +143,13 @@ sub sendmsg($$$) {
}
$self->output("\n");
return $self->readhash($to);
for(;;) {
$e = $self->readhash(undef);
last if $e->{socketerror} or $e->{'content-type'} eq 'command/reply';
push @{$self->{events}}, $e;
}
return $e;
}
sub command($$) {