This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sip BYE | |
BYE sip:172.18.15.132:5060 SIP/2.0 | |
Via: SIP/2.0/UDP 45.77.203.6:5066;rport;branch=z9hG4bKPja4d691b6-4605-459d-bc88-ca811b33084a | |
From: "Ambiorix" <sip:[email protected]>;tag=f14b225b-58b4-48de-8254-78d939e6141b | |
To: <sip:[email protected]>;tag=18426641_6772d868_e74bb600-520d-46de-ad77-822985dec5dc | |
Call-ID: 9834c53d-54a3-497f-92d5-f9ae0f94bf2d | |
CSeq: 15065 BYE | |
Route: <sip:54.172.60.3:5060;lr;ftag=f14b225b-58b4-48de-8254-78d939e6141b> | |
Reason: Q.850;cause=16 | |
Max-Forwards: 70 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<--- Transmitting SIP request (462 bytes) to UDP:54.172.60.3:5060 ---> | |
OPTIONS sip:asteriskpjsip.pstn.us1.twilio.com:5060 SIP/2.0 | |
Via: SIP/2.0/UDP 192.168.101.99:5066;rport;branch=z9hG4bKPj6280c4e9-e1e3-4231-9690-757d3902a9d3 | |
From: <sip:[email protected]>;tag=7d6268d8-ac8c-44e4-aa9c-83a30558c19c | |
To: <sip:asteriskpjsip.pstn.us1.twilio.com> | |
Contact: <sip:[email protected]:5066> | |
Call-ID: 70d477f6-c823-4293-8b95-91deff2c7030 | |
CSeq: 48289 OPTIONS | |
Max-Forwards: 70 | |
User-Agent: Asterisk PBX 16.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux | |
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config | |
reboot | |
MAKE SURE SELINUX IS DISABLED running the next command | |
sestatus | |
yum -y update | |
yum -y groupinstall core base "Development Tools" | |
yum install -y make wget openssl-devel ncurses-devel newt-devel libxml2-devel kernel-devel gcc gcc-c++ sqlite-devel | |
cd /usr/src/ | |
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum install epel-release | |
Install dependencies | |
yum install unixODBC-devel | |
yum install unixODBC | |
yum install python-devel | |
yum install python-pip | |
yum install MySQL-python | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://community.asterisk.org/t/call-detail-records-are-not-saving-in-cdr/76743/6 | |
Install packages | |
apt-get install unixodbc-dev unixodbc-bin unixodbc | |
/etc/odbc.ini | |
[asterisk-mysql] | |
Description = MySQL connection to ‘asterisk’ database | |
Driver = MySQL | |
Database = asterisk | |
Server = localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
same=>n,GotoIf($[$["${profile_id:0:-1}"= "6"] & $["${version:0:-1}"<"7"]]?from-internal,970040015,1) | |
same=>n,GotoIf($[$["${profile_id:0:-1}"= "6"] & $["${version:0:-1}">="7"] & $["${version:0:-1}"<="8"]]?from-internal,970040010,1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[recording] | |
exten=>_x.,1,Answer() | |
same=>n,Set(path=/var/www/html/surf/) | |
same =>n(2),read(edit,${path}${EXTEN:1},1,,) | |
same=>n,GotoIf($["${edit}"="5"]?auth) | |
same=>n,hangup() | |
same=>n(auth),authenticate(1973) | |
same=>n(rec),playback(pls-enter-num-message-after-tone) | |
same=>n,Record(${path}${EXTEN:1}.wav,,,k) | |
same=>n,playback(${path}${EXTEN:1}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exten=>001,1,Answer() | |
same=>n,Noop(${CALLERID(num)}) | |
same=>n,Set(ARG1=${CALLERID(num)}) | |
same=>n,Noop( len of ${LEN(${ARG1})}) | |
same=>n,ExecIf($[${LEN(${ARG1})}= 11]?Set(CALLERID(num)=${ARG1:0:7}${RAND(1000,9999)})) | |
same=>n,ExecIf($[${LEN(${ARG1})}> 11]?Set(CALLERID(num)=${ARG1:0:7})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$file="/etc/asterisk/data.txt"; | |
$data=$argv[1]."\n"; | |
$data.="$argv[2]"; | |
file_put_contents("$file", $data,FILE_APPEND); | |
?> | |
Dial paln | |
[writting] | |
exten=>_1011,1,Noop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The ${EXTEN} variable properly has the syntax ${EXTEN:x:y}, where x is the starting position and y is the number of digits to return. Given the following dial string: | |
94169671111 | |
we can extract the following digit strings using the ${EXTEN:x:y} construct: | |
${EXTEN:1:3} would contain 416 | |
${EXTEN:4:7} would contain 9671111 | |
${EXTEN:-4:4} would start four digits from the end and return four digits, giving us 1111 | |
${EXTEN:2:-4} would start two digits in and exclude the last four digits, giving us 16967 | |
${EXTEN:-6:-4} would start six digits from the end and exclude the last four digits, giving us 67 | |
${EXTEN:1} would give us everything after the first digit, or 4169671111 (if the number of digits to return is left blank, it will return the entire remaining string) | |
This is a very powerful construct, but most of these variations are not very common in normal use. For the most part, you will be using ${EXTEN} (or perhaps ${EXTEN:1} if you need to strip off an external access code). |
OlderNewer