Callback
как оно работает?
Откуда: Voronezh
Сообщений: 21
|
Callback
Добрый день! И так суть очередного вопроса.
Модуль callback
Прописанно: внутр. номер 3003 как некое SIP устройство -> в Follow me 3003 ext направлять на Callback test.
Соответственно создана запись Test в модуле callback. Данные по записи:
Description: test
Callback number - пусто
Delay before callback - 2 (в секундах)
Destination after callback - IVR
В обсчем....звоним на 3003. Идут сигналы КПВ - busy.
А сомого то callback-а не происходит..... Т.е. он должен мне через 2 секунды отзвониться на тот номер, с которого я его набирал (проверяю только на внутренних номерах)и соеденить меня сразу с меню IVR-а. Но...что-то у меня с руками или я что-то не так сделал? Помогите разобраться, пожалуйста!
|
Откуда: Voronezh
Сообщений: 21
|
Re: Callback
Неужели мыслей ни у кого нет....??? Куда хоть заглянуть?
|
Сообщений: 215
|
Re: Callback
http://asterisk.ru/store/files/TrixboxCE-2.6.pdf
стр. 198. Подробно расписано что и как.
|
Откуда: Voronezh
Сообщений: 21
|
Re: Callback
Сделал так же, как описано в мануале. Один фиг не работает. При звонке с softphon-а (X-Lait) вообще пишет, что Declined или Temporarily Unaviable. Начинаю уже думать, что лыжи точно не едут....Вот такое пишет лог файл. Не пойму....толи он всеже собирается звонить но не туда кудато или не собирается вообще....Кто подскажет?
[Oct 29 09:34:54] VERBOSE[25260] logger.c: -- Executing [s@macro-dial:1] [1;36;40mGotoIf[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40m1?dial[0;37;40m") in new stack
[Oct 29 09:34:54] VERBOSE[25260] logger.c: -- Goto (macro-dial,s,3)
[Oct 29 09:34:54] VERBOSE[25260] logger.c: -- Executing [s@macro-dial:3] [1;36;40mAGI[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40mdialparties.agi[0;37;40m") in new stack
[Oct 29 09:34:54] VERBOSE[25260] logger.c: -- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
[Oct 29 09:34:54] VERBOSE[25260] logger.c: dialparties.agi: Starting New Dialparties.agi
[Oct 29 09:34:54] VERBOSE[25264] logger.c: == Manager 'admin' logged on from 127.0.0.1
[Oct 29 09:34:54] VERBOSE[25262] logger.c: == Manager 'admin' logged on from 127.0.0.1
[Oct 29 09:34:54] VERBOSE[25260] logger.c: dialparties.agi: Caller ID name is 'Stas' number is '2002'
[Oct 29 09:34:54] VERBOSE[25260] logger.c: dialparties.agi: Methodology of ring is 'ringallv2'
[Oct 29 09:34:54] VERBOSE[25260] logger.c: -- dialparties.agi: Added extension 1000 to extension map
[Oct 29 09:34:54] VERBOSE[25260] logger.c: -- dialparties.agi: Extension 1000 cf is disabled
[Oct 29 09:34:54] VERBOSE[25260] logger.c: -- dialparties.agi: Extension 1000 do not disturb is disabled
[Oct 29 09:34:54] VERBOSE[25260] logger.c: -- dialparties.agi: dbset CALLTRACE/1000 to 2002
[Oct 29 09:34:54] VERBOSE[25260] logger.c: -- dialparties.agi: Filtered ARG3: 1000
[Oct 29 09:34:54] VERBOSE[25264] logger.c: == Manager 'admin' logged off from 127.0.0.1
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- <SIP/2002-b7421c28>AGI Script dialparties.agi completed, returning 0
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [s@macro-dial:7] [1;36;40mDial[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40mSIP/1000,22,trwM(auto-blkvm)[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: == Using SIP RTP TOS bits 184
[Oct 29 09:34:55] VERBOSE[25260] logger.c: == Using SIP RTP CoS mark 5
[Oct 29 09:34:55] VERBOSE[25260] logger.c: == Using SIP VRTP TOS bits 136
[Oct 29 09:34:55] VERBOSE[25260] logger.c: == Using SIP VRTP CoS mark 6
[Oct 29 09:34:55] WARNING[25260] app_dial.c: Unable to create channel of type 'SIP' (cause 20 - Unknown)
[Oct 29 09:34:55] VERBOSE[25260] logger.c: == Everyone is busy/congested at this time (1:0/0/1)
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [s@macro-dial:8] [1;36;40mSet[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40mDIALSTATUS=CHANUNAVAIL[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [s@macro-dial:9] [1;36;40mGosubIf[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40m0?CHANUNAVAIL,1[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [1000@from-internal:17] [1;36;40mGoto[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40mnextstep[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Goto (from-internal,1000,19)
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [1000@from-internal:19] [1;36;40mSet[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40mRingGroupMethod=[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [1000@from-internal:20] [1;36;40mGotoIf[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40m0?nodest[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [1000@from-internal:21] [1;36;40mSet[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40m__NODEST=[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [1000@from-internal:22] [1;36;40mDBdel[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40mBLKVM/1000/SIP/2002-b7421c28[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- DBdel: family=BLKVM, key=1000/SIP/2002-b7421c28
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [1000@from-internal:23] [1;36;40mGoto[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40mcallback,1,1[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Goto (callback,1,1)
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [1@callback:1] [1;36;40mSet[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40mCALL=2002[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [1@callback:2] [1;36;40mSet[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40mDESTINATION=ext-meetme.3000.1[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [1@callback:3] [1;36;40mSet[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40mSLEEP=2[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [1@callback:4] [1;36;40mSystem[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40m/var/lib/asterisk/bin/callback 2002 ext-meetme.3000.1 2 &[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: -- Executing [1@callback:5] [1;36;40mHangup[0;37;40m("[1;35;40mSIP/2002-b7421c28[0;37;40m", "[1;35;40m[0;37;40m") in new stack
[Oct 29 09:34:55] VERBOSE[25260] logger.c: == Spawn extension (callback, 1, 5) exited non-zero on 'SIP/2002-b7421c28'
|
Сообщений: 215
|
Re: Callback
в /var/lib/asterisk/bin/callback отыщите переменную callerid и посмотрите ее значение
|
Откуда: Voronezh
Сообщений: 21
|
Re: Callback
про callerid единственная запись в строке callback
$callerid = "Callback";
больше ничего.....
|
Сообщений: 215
|
Re: Callback
вместо "Callback" попробуйте поставить что-нибудь такое "111" циферное и перезапустите астериск
|
Откуда: Voronezh
Сообщений: 21
|
Re: Callback
не помогло...точнее, сделал 111 и произвел звонок. Как обычно. Перезвона - небыло.
#!/usr/bin/php -q
<?php
/*
This Callback script takes 3 arguments:
1- number to dial
2- context.exten.priority to dump number into
3- time in seconds to sleep before calling back
eg: callback 14032448089 ext-meetme.200.1
*/
//Copyright (C) 2004 Coalescent Systems Inc. (info@coalescentsystems.ca)
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or (at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
?>
<?php
define("AMP_CONF", "/etc/amportal.conf");
//sleep(10);
/**************************************************************/
// from ben-php dot net at efros dot com at php.net/install.unix.commandline
if (version_compare(phpversion(),'4.3.0','<') || !defined("STDIN")) {
define('STDIN',fopen("php://stdin","r"));
define('STDOUT',fopen("php://stdout","r"));
define('STDERR',fopen("php://stderr","r"));
register_shutdown_function( create_function( '' , 'fclose(STDIN); fclose(STDOUT); fclose(STDERR); return true;' ) );
}
// **** Make sure we have PEAR's GetOpts.php, and include it
outn("Checking for PEAR Console::Getopt..");
if (! @ include("Console/Getopt.php")) {
out("FAILED");
fatal("PEAR must be installed (requires Console/Getopt.php). Include path: ".ini_get("include_path"));
}
out("OK");
outn("Reading ".AMP_CONF."..");
$amp_conf = parse_amportal_conf(AMP_CONF);
if (count($amp_conf) == 0) {
fatal("FAILED");
}
out("OK");
// include manager functions
include $amp_conf['AMPWEBROOT'].'/admin/common/php-asmanager.php';
// **** Parse out command-line args
// context, extension, and number of voicemails
out("Getting passed arguments:");
$con = new Console_Getopt;
$args = $con->readPHPArgv();
array_shift($args);
//system("echo \"".$args[0].substr($args[1],0,strpos($args[1],"@")).$args[2]."\" > on.txt"); ;
print_r($args);
$callback_number = $args[0];
$callback_destination = $args[1];
$pause_seconds = $args[2];
if($pause_seconds)
sleep($pause_seconds);
// figure out context, exten, priority
$dest = explode(".",$callback_destination);
$callback_context = $dest[0];
$callback_exten = $dest[1];
$callback_priority = $dest[2];
//define the args for Originate
$channel = "Local/".$callback_number."@from-internal";
//$channel = "zap/g0/".$uservm[$vmcontext][$vmextension]['options']['callme'];
$exten = $callback_exten;
$context = $callback_context;
$priority = $callback_priority;
$timeout = "15000";
$callerid = "111";
$variable = "";
$account = "";
$application = "";
$data = "";
//connect to manager and dial
$astman = new AGI_AsteriskManager();
if ($res = $astman->connect("127.0.0.1", $amp_conf["AMPMGRUSER"] , $amp_conf["AMPMGRPASS"])) {
$astman->Originate($channel, $exten, $context, $priority, $timeout, $callerid, $variable, $account, $application, $data);
} else {
fatal("Cannot connect to Asterisk Manager with ".$amp_conf["AMPMGRUSER"]."/".$amp_conf["AMPMGRPASS"]);
}
$astman->disconnect();
function parse_amportal_conf($filename) {
$file = file($filename);
foreach ($file as $line) {
if (preg_match("/^\s*([a-zA-Z0-9]+)\s*=\s*(.*)\s*([;#].*)?/",$line,$matches)) {
$conf[ $matches[1] ] = $matches[2];
}
}
return $conf;
}
function out($text) {
echo $text."\n";
}
function outn($text) {
echo $text;
}
function error($text) {
echo "[ERROR] ".$text."\n";
}
function fatal($text) {
echo "[FATAL] ".$text."\n";
exit(1);
}
?>
|
Сообщений: 215
|
Re: Callback
в логах что-нибудь изменилось?
|
Откуда: Voronezh
Сообщений: 21
|
Re: Callback
вроде нет, хотя, опять же вроде, он пытается связать меня с тем, с чем нужно
Еще раз повторюсь: номер дод каллбэк - 1000
Вызов идет с 2002
Должно соеденить с конференцией с номером 3000
Лог:
[Oct 29 13:26:16] VERBOSE[2907] logger.c: -- Executing [s@macro-dial:1] [1;36;40mGotoIf[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40m1?dial[0;37;40m") in new stack
[Oct 29 13:26:16] VERBOSE[2907] logger.c: -- Goto (macro-dial,s,3)
[Oct 29 13:26:16] VERBOSE[2907] logger.c: -- Executing [s@macro-dial:3] [1;36;40mAGI[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40mdialparties.agi[0;37;40m") in new stack
[Oct 29 13:26:16] VERBOSE[2907] logger.c: -- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
[Oct 29 13:26:16] VERBOSE[2910] logger.c: == Manager 'admin' logged on from 127.0.0.1
[Oct 29 13:26:16] VERBOSE[2907] logger.c: dialparties.agi: Starting New Dialparties.agi
[Oct 29 13:26:16] VERBOSE[2911] logger.c: == Manager 'admin' logged on from 127.0.0.1
[Oct 29 13:26:16] VERBOSE[2907] logger.c: dialparties.agi: Caller ID name is 'Stas' number is '2002'
[Oct 29 13:26:16] VERBOSE[2907] logger.c: dialparties.agi: Methodology of ring is 'ringallv2'
[Oct 29 13:26:16] VERBOSE[2907] logger.c: -- dialparties.agi: Added extension 1000 to extension map
[Oct 29 13:26:16] VERBOSE[2907] logger.c: -- dialparties.agi: Extension 1000 cf is disabled
[Oct 29 13:26:16] VERBOSE[2907] logger.c: -- dialparties.agi: Extension 1000 do not disturb is disabled
[Oct 29 13:26:17] VERBOSE[2907] logger.c: -- dialparties.agi: dbset CALLTRACE/1000 to 2002
[Oct 29 13:26:17] VERBOSE[2907] logger.c: -- dialparties.agi: Filtered ARG3: 1000
[Oct 29 13:26:17] VERBOSE[2911] logger.c: == Manager 'admin' logged off from 127.0.0.1
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- <SIP/2002-0944da38>AGI Script dialparties.agi completed, returning 0
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [s@macro-dial:7] [1;36;40mDial[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40mSIP/1000,22,trwM(auto-blkvm)[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: == Using SIP RTP TOS bits 184
[Oct 29 13:26:18] VERBOSE[2907] logger.c: == Using SIP RTP CoS mark 5
[Oct 29 13:26:18] VERBOSE[2907] logger.c: == Using SIP VRTP TOS bits 136
[Oct 29 13:26:18] VERBOSE[2907] logger.c: == Using SIP VRTP CoS mark 6
[Oct 29 13:26:18] WARNING[2907] app_dial.c: Unable to create channel of type 'SIP' (cause 20 - Unknown)
[Oct 29 13:26:18] VERBOSE[2907] logger.c: == Everyone is busy/congested at this time (1:0/0/1)
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [s@macro-dial:8] [1;36;40mSet[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40mDIALSTATUS=CHANUNAVAIL[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [s@macro-dial:9] [1;36;40mGosubIf[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40m0?CHANUNAVAIL,1[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [1000@from-internal:17] [1;36;40mGoto[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40mnextstep[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Goto (from-internal,1000,19)
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [1000@from-internal:19] [1;36;40mSet[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40mRingGroupMethod=[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [1000@from-internal:20] [1;36;40mGotoIf[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40m0?nodest[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [1000@from-internal:21] [1;36;40mSet[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40m__NODEST=[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [1000@from-internal:22] [1;36;40mDBdel[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40mBLKVM/1000/SIP/2002-0944da38[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- DBdel: family=BLKVM, key=1000/SIP/2002-0944da38
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [1000@from-internal:23] [1;36;40mGoto[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40mcallback,1,1[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Goto (callback,1,1)
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [1@callback:1] [1;36;40mSet[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40mCALL=2002[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [1@callback:2] [1;36;40mSet[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40mDESTINATION=ext-meetme.3000.1[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [1@callback:3] [1;36;40mSet[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40mSLEEP=2[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [1@callback:4] [1;36;40mSystem[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40m/var/lib/asterisk/bin/callback 2002 ext-meetme.3000.1 2 &[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: -- Executing [1@callback:5] [1;36;40mHangup[0;37;40m("[1;35;40mSIP/2002-0944da38[0;37;40m", "[1;35;40m[0;37;40m") in new stack
[Oct 29 13:26:18] VERBOSE[2907] logger.c: == Spawn extension (callback, 1, 5) exited non-zero on 'SIP/2002-0944da38'
|
|