Der entsprechende Eintrag in der Map sieht bei mir wie folgt aus:
Code: Select all
[ 'UserPhone', 'Phone', 'phone_1', 1, 0, 'var', 'http://asteriskserver/click2dial.php?agent=$Env{"UserComment"}&recipient=$Env{"UserPhone"}', 0, '_blank' ],
Wie komm ich an die Telefonnumer des Kunden?
Gibts da ne andere Variable für?
Ich möchte nichts am Quellcode ändern müssen, damit es funktioniert.
P.S.: Falls noch jemand Interesse am Click2Dial Script hat... Bitteschön:
Code: Select all
<?php
# config
$ast_context="outbound-allroutes";
$ast_maxretries="1";
$ast_retrytime="60";
$ast_waittime="60";
$ast_dialprefix="0";
$ast_outdir="/var/spool/asterisk/outgoing";
$ast_callfile = "otrs_call_" . mt_rand();
# script
# remove unwanted chars from agents number
$agent_nr=preg_replace('/[^0-9]/', '', $HTTP_GET_VARS["agent"]);
# remove unwanted chars from customers number
$recipient=$ast_dialprefix . preg_replace('/[^0-9]/', '', $HTTP_GET_VARS["recipient"]);
if( !isset($agent) || !isset($recipient) || $recipient == $ast_dialprefix){
echo "no agent or recipient given";
exit;
}
# check if agent nr could be fetched from db
if (!isset($agent_nr)){
echo "cant call customer because your sip number is unknown.";
exit;
}
# create callfile
$fh = fopen($ast_callfile, 'w');
$stringdata = "Channel: $agent_nr
MaxRetries: $ast_maxretries
RetryTime: $ast_retrytime
WaitTime: $ast_waittime
Context: $ast_context
Extension: $recipient";
fwrite($fh, $stringdata);
fclose($fh);
# move callfile to asterisk outgoing dir
exec('mv ' . escapeshellarg($ast_callfile) . ' ' . escapeshellarg($ast_outdir) . '');
echo "calling customer $recipient via extension " . preg_replace('/SIP\//', '', $agent_nr) . " of agent $agent";
?>