asterisk -gvvvvvvvvvvvvvvv | tee /tmp/debug.log
cat /tmp/asteriskdebug.log | grep -i error
Soporte & Consultoria
Soporte Remoto y Consultoria skype : ambiorixg12.
Nota no se brinda ningun tipo de consulta o soporte fuera del blog de forma gratuita
domingo, 30 de agosto de 2015
sábado, 29 de agosto de 2015
TRUNK and DID setup
<?php
echo "<center><h2>Caller ID & Trunk setup. <h2></center>";
// asignar permisos chmod 777 /var/www/cid.conf
// asignar permisos chmod 777 /var/www/trunk.conf
if(isset($_POST[submit])&& strlen($_POST[cid])>0 && strlen($_POST[trunk])>0 ){
$myfile = fopen("/var/www/cid.conf", "w") or die("Unable to open file!");
$cid=$_POST[cid];
fwrite($myfile,$cid);
fclose($myfile);
echo "<strong> Selected caller id : $cid</strong><br>";
$myfile1 = fopen("/var/www/trunk.conf", "w") or die("Unable to open file!");
$trunk=$_POST[trunk];
fwrite($myfile1,$trunk);
fclose($myfile1);
echo "<strong>Selected trunk : $trunk</strong>";
}
?>
<body>
<center>
<div class="login-help">
<p>Click here to <a href="cid.php"> Go to the main panel </a>.</p>
</div>
<section class="container">
<div class="login">
<h1>Add Caller ID</h1> <form enctype="multipart/form-data" action="cid.php" method="POST" onsubmit="return val(this)">
<p><input type="text" name="cid" value="" placeholder="caller id"></p>
<p><input type="text" name="trunk" value="" placeholder="trunk"></p>
<p class="submit"><input type="submit" name="submit" value="Done"></p>
</center>
</form>
</div>
</section>
</body>
</html>
####################
[outbound]
exten=>_7.,1,Noop()
same=>n,Set(CID=${SHELL(cat /var/www/cid.conf)})
same=>n,Set(CALLERID(num)=${CID})
same=>n,Set(TRUNK=${SHELL(cat /var/www/trunk.conf)})
same=>n,Dial(SIP/${EXTEN:1}@${TRUNK},25)
same=>n,hangup()
echo "<center><h2>Caller ID & Trunk setup. <h2></center>";
// asignar permisos chmod 777 /var/www/cid.conf
// asignar permisos chmod 777 /var/www/trunk.conf
$myfile = fopen("/var/www/cid.conf", "w") or die("Unable to open file!");
$cid=$_POST[cid];
fwrite($myfile,$cid);
fclose($myfile);
echo "<strong> Selected caller id : $cid</strong><br>";
$myfile1 = fopen("/var/www/trunk.conf", "w") or die("Unable to open file!");
$trunk=$_POST[trunk];
fwrite($myfile1,$trunk);
fclose($myfile1);
echo "<strong>Selected trunk : $trunk</strong>";
}
?>
<center>
<div class="login-help">
<p>Click here to <a href="cid.php"> Go to the main panel </a>.</p>
</div>
<section class="container">
<div class="login">
<h1>Add Caller ID</h1> <form enctype="multipart/form-data" action="cid.php" method="POST" onsubmit="return val(this)">
<p><input type="text" name="cid" value="" placeholder="caller id"></p>
<p><input type="text" name="trunk" value="" placeholder="trunk"></p>
<p class="submit"><input type="submit" name="submit" value="Done"></p>
</center>
</form>
</div>
</section>
</body>
</html>
####################
[outbound]
exten=>_7.,1,Noop()
same=>n,Set(CID=${SHELL(cat /var/www/cid.conf)})
same=>n,Set(CALLERID(num)=${CID})
same=>n,Set(TRUNK=${SHELL(cat /var/www/trunk.conf)})
same=>n,Dial(SIP/${EXTEN:1}@${TRUNK},25)
same=>n,hangup()
lunes, 10 de agosto de 2015
Callid based on extension number
[did-exten]
exten=>_15619230427,1,Dial(SIP/101)
exten=>_15619230443,1,Dial(SIP/102)
exten=>_15619230473,1,Dial(SIP/103)
exten=>_15619230474,1,Dial(SIP/104)
exten=>_15619230475,1,Dial(SIP/105)
exten=>_15619230485,1,Dial(SIP/106)
exten=>_15619230490,1,Dial(SIP/107)
exten=>_15619230660,1,Dial(SIP/108)
exten=>_15619238301,1,Dial(SIP/109)
exten=>_15619480726,1,Dial(SIP/110)
[outbound]
exten=>_x.,1,Gosub(cid-exten,${CALLERID(num)},1)
exten=>_x.,2,Dial(SIP/rapidvox/${EXTEN})
[cid-exten]
exten =>101,1,ExecIf($["${CALLERID(NUM)}"= "101"]?Set(CALLERID(num)=15619230427))
same => n,Return
exten =>102,1,ExecIf($["${CALLERID(NUM)}"= "102"]?Set(CALLERID(num)=15619230443))
same => n,Return
exten =>103,1,ExecIf($["${CALLERID(NUM)}"= "103"]?Set(CALLERID(num)=15619230473))
same => n,Return
exten =>104,1,ExecIf($["${CALLERID(NUM)}"= "104"]?Set(CALLERID(num)=15619230474))
same => n,Return
exten =>105,1,ExecIf($["${CALLERID(NUM)}"= "105"]?Set(CALLERID(num)=15619230475))
same => n,Return
exten =>106,1,ExecIf($["${CALLERID(NUM)}"= "106"]?Set(CALLERID(num)=15619230485))
same => n,Return
exten =>107,1,ExecIf($["${CALLERID(NUM)}"= "107"]?Set(CALLERID(num)=15619230490))
same => n,Return
exten =>108,1,ExecIf($["${CALLERID(NUM)}"= "108"]?Set(CALLERID(num)=15619230660))
same => n,Return
exten =>109,1,ExecIf($["${CALLERID(NUM)}"= "109"]?Set(CALLERID(num)=15619238301))
same => n,Return
exten =>110,1,ExecIf($["${CALLERID(NUM)}"= "110"]?Set(CALLERID(num)=15619480726))
same => n,Return
exten=>_15619230427,1,Dial(SIP/101)
exten=>_15619230443,1,Dial(SIP/102)
exten=>_15619230473,1,Dial(SIP/103)
exten=>_15619230474,1,Dial(SIP/104)
exten=>_15619230475,1,Dial(SIP/105)
exten=>_15619230485,1,Dial(SIP/106)
exten=>_15619230490,1,Dial(SIP/107)
exten=>_15619230660,1,Dial(SIP/108)
exten=>_15619238301,1,Dial(SIP/109)
exten=>_15619480726,1,Dial(SIP/110)
[outbound]
exten=>_x.,1,Gosub(cid-exten,${CALLERID(num)},1)
exten=>_x.,2,Dial(SIP/rapidvox/${EXTEN})
[cid-exten]
exten =>101,1,ExecIf($["${CALLERID(NUM)}"= "101"]?Set(CALLERID(num)=15619230427))
same => n,Return
exten =>102,1,ExecIf($["${CALLERID(NUM)}"= "102"]?Set(CALLERID(num)=15619230443))
same => n,Return
exten =>103,1,ExecIf($["${CALLERID(NUM)}"= "103"]?Set(CALLERID(num)=15619230473))
same => n,Return
exten =>104,1,ExecIf($["${CALLERID(NUM)}"= "104"]?Set(CALLERID(num)=15619230474))
same => n,Return
exten =>105,1,ExecIf($["${CALLERID(NUM)}"= "105"]?Set(CALLERID(num)=15619230475))
same => n,Return
exten =>106,1,ExecIf($["${CALLERID(NUM)}"= "106"]?Set(CALLERID(num)=15619230485))
same => n,Return
exten =>107,1,ExecIf($["${CALLERID(NUM)}"= "107"]?Set(CALLERID(num)=15619230490))
same => n,Return
exten =>108,1,ExecIf($["${CALLERID(NUM)}"= "108"]?Set(CALLERID(num)=15619230660))
same => n,Return
exten =>109,1,ExecIf($["${CALLERID(NUM)}"= "109"]?Set(CALLERID(num)=15619238301))
same => n,Return
exten =>110,1,ExecIf($["${CALLERID(NUM)}"= "110"]?Set(CALLERID(num)=15619480726))
same => n,Return
viernes, 7 de agosto de 2015
Asterisk Click to call script
Web call URL
http://54.149.226.168/click/click.php?dest=18002342120&exten=101
// Calling Script
<?php
$dest=$_GET["dest"];
$exten=$_GET["exten"];
$pbx="127.0.0.1";
$timeout=30;
$socket = fsockopen($pbx,"5038", $errno, $errstr, $timeout);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: admin\r\n"); //
fputs($socket, "Secret: 123456\r\n\r\n"); //
//
$wrets=fgets($socket,128);
echo $wrets;
fputs($socket, "Action: Originate\r\n" );
fputs($socket, "Channel: SIP/$exten\r\n" );
fputs($socket, "Exten: $dest\r\n" );
fputs($socket, "Context: outbound\r\n" );
fputs($socket, "Priority: 1\r\n" );
fputs($socket, "CallerID: $dest\r\n" );
fputs($socket, "Async: yes\r\n\r\n" );
fputs($socket, "Action: Logoff\r\n\r\n");
sleep (1);
$wrets=fgets($socket,128);
?>
Dial Plan
[outbound]
exten=>_x.,1,Dial(SIP/r1/${EXTEN})
http://54.149.226.168/click/click.php?dest=18002342120&exten=101
// Calling Script
<?php
$dest=$_GET["dest"];
$exten=$_GET["exten"];
$pbx="127.0.0.1";
$timeout=30;
$socket = fsockopen($pbx,"5038", $errno, $errstr, $timeout);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: admin\r\n"); //
fputs($socket, "Secret: 123456\r\n\r\n"); //
//
$wrets=fgets($socket,128);
echo $wrets;
fputs($socket, "Action: Originate\r\n" );
fputs($socket, "Channel: SIP/$exten\r\n" );
fputs($socket, "Exten: $dest\r\n" );
fputs($socket, "Context: outbound\r\n" );
fputs($socket, "Priority: 1\r\n" );
fputs($socket, "CallerID: $dest\r\n" );
fputs($socket, "Async: yes\r\n\r\n" );
fputs($socket, "Action: Logoff\r\n\r\n");
sleep (1);
$wrets=fgets($socket,128);
?>
Dial Plan
[outbound]
exten=>_x.,1,Dial(SIP/r1/${EXTEN})
miércoles, 5 de agosto de 2015
setting callerid based on extension range
[from-internal-custom]
exten => 1234,1,Playback(demo-congrats) ; extensions can dial 1234
exten => 1234,2,Hangup()
exten=>_1NXXNXXXXXX,1,Noop(${CALLERID(NUM):0:1})
same=> n,ExecIf($["${CALLERID(NUM):0:1}"= "7"]?Set(CALLERID(all)=MOREHAIR<13525081099>))
same=> n,ExecIf($["${CALLERID(NUM):0:1}"= "8"]?Set(CALLERID(all)=TonerRefillKits<18005273712>))
same=> n,ExecIf($["${CALLERID(NUM):0:1}"= "9"]?Set(CALLERID(all)=LASERGROUP<13523433804>))
same=>n,Dial(SIP/${EXTEN}@Flowroute)
exten=>_NXXNXXXXXX,1,Noop(${CALLERID(NUM):0:1})
same=> n,ExecIf($["${CALLERID(NUM):0:1}"= "7"]?Set(CALLERID(all)=MOREHAIR<13525081099>))
same=> n,ExecIf($["${CALLERID(NUM):0:1}"= "8"]?Set(CALLERID(all)=TonerRefillKits<18005273712>))
same=> n,ExecIf($["${CALLERID(NUM):0:1}"= "9"]?Set(CALLERID(all)=LASERGROUP<13523433804>))
same=>n,Dial(SIP/1${EXTEN}@Flowroute)
exten => 1234,1,Playback(demo-congrats) ; extensions can dial 1234
exten => 1234,2,Hangup()
exten=>_1NXXNXXXXXX,1,Noop(${CALLERID(NUM):0:1})
same=> n,ExecIf($["${CALLERID(NUM):0:1}"= "7"]?Set(CALLERID(all)=MOREHAIR<13525081099>))
same=> n,ExecIf($["${CALLERID(NUM):0:1}"= "8"]?Set(CALLERID(all)=TonerRefillKits<18005273712>))
same=> n,ExecIf($["${CALLERID(NUM):0:1}"= "9"]?Set(CALLERID(all)=LASERGROUP<13523433804>))
same=>n,Dial(SIP/${EXTEN}@Flowroute)
exten=>_NXXNXXXXXX,1,Noop(${CALLERID(NUM):0:1})
same=> n,ExecIf($["${CALLERID(NUM):0:1}"= "7"]?Set(CALLERID(all)=MOREHAIR<13525081099>))
same=> n,ExecIf($["${CALLERID(NUM):0:1}"= "8"]?Set(CALLERID(all)=TonerRefillKits<18005273712>))
same=> n,ExecIf($["${CALLERID(NUM):0:1}"= "9"]?Set(CALLERID(all)=LASERGROUP<13523433804>))
same=>n,Dial(SIP/1${EXTEN}@Flowroute)
Suscribirse a:
Entradas (Atom)