This file contains hidden or 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
| Install dependencies | |
| yum install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel | |
| yum install mysql-connector-odbc | |
| /etc/odbc.ini | |
| [asterisk-mysql] | |
| Description = MySQL connection to 'asterisk' database | |
| Driver = MySQL | |
| Database = asterisk |
This file contains hidden or 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
| confbridge Hack() | |
| Counting users on a conf | |
| asterisk -x " confbridge list 5001" | awk '{print $1}' | grep -w SIP | wc -l | |
| listing channels on a conf | |
| asterisk -x " confbridge list 5001" | awk '{print $1}' | grep -w SIP |
This file contains hidden or 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
| cat full* | grep [9002-9018] | grep -i Registered | grep -i chan_sip > /var/www/html/register.log |
This file contains hidden or 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
| asterisk -x "channel originate Local/18097143489@myoutbound extension s@moh" | |
| asterisk -x "channel originate Local/103@home extension s@moh" | |
| [myoutbound] | |
| exten=>_x.,1,verbose( calling to ${EXTEN}) | |
| same=>n,Set(CALLERID(num)=${calleridnumber}) ;callerid to use | |
| same=>n,Dial(SIP/${EXTEN}@trunk,25) ;trunk to use |
This file contains hidden or 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 | |
| $channel=shell_exec("asterisk -x \" core show channels\" | awk '{print $1}' | awk '/SIP/{print}'"); | |
| $channelist=explode("\n",$channel); | |
| foreach($channelist as $key=> $value) { | |
| if (preg_match("/\bSIP\b/i", $value,$match)){ | |
| echo "$key : $value\n"; | |
| } |
This file contains hidden or 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
| [survey1] | |
| exten=>_991,1,Answer() | |
| same=>n,Playback(/var/lib/asterisk/agi-bin/survey/welcomesurvey) | |
| same=>n(q1),read(q1,/var/lib/asterisk/agi-bin/survey/pregunta1,1) | |
| same => n,GotoIf($[${q1}>5]?q1) | |
| same=>n(q2),read(q2,/var/lib/asterisk/agi-bin/survey/pregunta2,1) | |
| same => n,GotoIf($[${q2}>5]?q2) | |
| same=>n(q3),read(q3,/var/lib/asterisk/agi-bin/survey/pregunta3,1) | |
| same => n,GotoIf($[${q3}>5]?q3) | |
| same=>n,Playback(/var/lib/asterisk/agi-bin/survey/goodbyesurvey) |
This file contains hidden or 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
| Let's say SIP device have a call with 6000 just run the following command | |
| Playing the sound | |
| vultr*CLI> originate Local/6005@alert application playback demo-thanks | |
| ;; This context inject the audio | |
| [alert] | |
| exten=>_x.,1,Noop() | |
| same => n,ChanSpy(PJSIP/${EXTEN},Bq) |
This file contains hidden or 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
| ;;;;;;;;;;;;;;confirmation call;;;;;;;;;;;;;;;;;;;;;;; | |
| [confirmation_call_original2] | |
| exten=>_.,1,Answer() | |
| same=>n(wish),Set(message=pls-entr-num-uwish2-call) | |
| same=>n(rec),read(exten,${message},4,,,5) | |
| same=>n,GotoIf($["${exten}"=""]?wish) | |
| same=>n,Playback(pls-rcrd-name-at-tone) | |
| same=>n,Record(/root/demo/recording/${UNIQUEID}.wav,,20,y) |
This file contains hidden or 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=>_6XXX,1,NoCDR() | |
| same=>n,Noop(${EXTEN} ${CHANNEL} ${CDR(dstchannel)}) | |
| same=>n,Set(__DYNAMIC_FEATURES=transf) | |
| exten=>_6XXX,n,Dial(PJSIP/${EXTEN}) | |
| ;;;;custom transfer | |
This file contains hidden or 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 headers | |
| [sipheader] | |
| exten=>_x.,1,Noop(reading from header ${PJSIP_HEADER(read,from)}) | |
| same=>n,Set(from=${PJSIP_HEADER(read,from)}) | |
| same=>n,Set(fromip=${CUT(from,>,1)}) | |
| same=>n,Set(ip=${SHELL(php /root/cut.php "${fromip}")}) | |
| same=>n,Set(pseudodid=${CUT(from,@,1)}) | |
| same=>n,Noop(${ip}) | |