[asterisk-users] How to detect if the call is being answered by Voice Mail?

Bharath B. Reddy Bynagari bynagari at mavensphere.com
Tue Aug 25 15:14:20 CDT 2009


Hi,

 

I am pretty new to Asterisk. I am trying to make sure some human being
answers the phone not the voice mail machine. How can I programmatically
identify that?

 

Here is my Sub:

 

sub DialPhysician {

        my ($self, $con, $PhysicianPhone, $call_id, $conv_id) = (@_);

 

        to_log($self, "Inside Dial Physician", 2);

 

        my $DocPhone = "1". $PhysicianPhone;

        to_log($self, "Values: $DocPhone, $call_id, $conv_id", 2);

 

        $self->agi->set_variable("STATE","NEXT");

        $self->agi->set_variable("stat_vars","$call_id:$conv_id:$DocPhone");

        my $response =
$self->agi->exec("Dial","Local/$DocPhone\@$out_context/n|20|g");

        my $CallStatus = $self->agi->get_variable("DIALSTATUS");

        my $ANSWEREDTIME=$self->agi->get_variable("ANSWEREDTIME");

        to_log($self, "Physician Call Status: $CallStatus; ANSWEREDTIME:
$ANSWEREDTIME", 2);

 

        return 0;

}

 

Is this not the correct way to do this? Or Are there any other methods?

 

Thanks 

Bharath B. Reddy Bynagari

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090825/d59f4e22/attachment.htm 


More information about the asterisk-users mailing list