IVRで処理する際、お客様の電話番号をDB照会する必要などがある場合に使える、CallerIDの基本的な取得方法です。下記のスクリプトをRunscript(スクリプトを実行)コマンドで実行すると、音声で電話番号を案内します。
必要に応じて処理を追加してください。
#!/usr/bin/perl
use strict;
use Asterisk::AGI;
###########################################
# 2010 Communication Business Avenue, Inc.
# Caller ID Check Script
###########################################
$|=1;
# Setup some variables
my %AGI; my $tests = 0; my $fail = 0; my $pass = 0;
my $astagi = new Asterisk::AGI;
while(<stdin>) {
chomp;
last unless length($_);
if (/^agi_(\w+)\:\s+(.*)$/) {
$AGI{$1} = $2;
}
}
$astagi->say_alpha($AGI{'callerid'});
| 画像 0 | ||
|---|---|---|
| ギャラリーに表示すべき画像はありません。 |