====== Liens importants ====== * [[http://www.voip-info.org/wiki/view/Asterisk+Detailed+Variable+List|Liste des variables]] * [[http://www.voip-info.org/wiki/view/Asterisk+variables|Variables (encore)]] * [[http://www.voip-info.org/wiki/view/Asterisk+functions|Liste des fonctions]] * [[http://www.voip-info.org/wiki/view/Asterisk+standard+extensions|Extensions (s,t,h...)]] * MeetMe * [[http://www.voip-info.org/wiki/view/Asterisk+cmd+MeetMe|Cmd MeetMe]] * [[http://www.voip-info.org/wiki/index.php?page_id=1199|MeetMeAdmin]] * Fichier de CallBack * [[http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out|Call black]] * [[http://www.the-asterisk-book.com/unstable/call-file.html|Call File]] * Features * [[http://www.voip-info.org/wiki/view/Asterisk+config+features.conf|Exemples d'usage des Features]] * [[http://www.voip-info.org/wiki/view/Asterisk+n-way+call+HOWTO|Autre exemple...]] * [[http://www.voip-info.org/wiki/view/Asterisk+-+documentation+of+application+commands|Les commandes Asterisk]] * [[http://www.moreau37.fr/logiciels/asterisk/|Ce M. Moreau il est bien !]] * GSM * http://www.moreau37.fr/chan_mobile-avec-2-mobiles/ * http://www.asterisk-france.org/showthread.php/1068-Utiliser-un-mobile-gsm-en-tant-que-passerelle-pointeurs * http://www.asterisk-france.org/showthread.php/2199-R%C3%A9ception-et-envoie-SMS * http://www.raspberry-asterisk.org/documentation/gsm-voip-gateway-with-chan_dongle/ * SPA3102 * http://www.asterisk-france.org/showthread.php/1104-aide-pour-parametrage-spa3102-deriere-freebox * AntiRobots * http://www.asterisk-france.org/showthread.php/1871-Commande-AMD-sur-appels-sortants * http://www.asterisk-france.org/showthread.php/2103-diffuser-une-webradio-en-musique-d-attente * XMPP/Jabber * http://www.asterisk-france.org/showthread.php/2847-Asterisk-GTalk-%28via-Jabber%29-lt-not-authorized-gt * https://wiki.asterisk.org/wiki/display/AST/Calling+using+Google * http://www.asterisk-france.org/showthread.php/2350-Basculer-automatiquement-d-un-trunk-a-un-autre-si-il-est-HS-ou-occup%C3%A9 * DoorPhone * Bien chercher là ca en parles : http://www.asterisk-france.org/showthread.php/1982-Parlophones-Afficher-le-num%C3%A9ro-appel%C3%A9-et-pas-l-extension * [[http://www.asterisk-france.org/showthread.php/2191-2-scripts-offerts|Géoloc sur CallerId && Monitoring Trunk]] * Sécu * http://www.asterisk-france.org/showthread.php/2842-Cr%C3%A9er-un-service-appel-de-minuterie-avec-Asterisk * https://blog.ls20.com/securing-your-asterisk-voip-server-with-iptables/ * http://www.asterisk-france.org/showthread.php/2905-S%C3%A9curiser-un-serveur-asterisk-recapitulatif * http://www.asterisk-france.org/showthread.php/2842-Cr%C3%A9er-un-service-appel-de-minuterie-avec-Asterisk * http://www.packtpub.com/article/primer-to-agi-asterisk-gateway-interface * SNOM * http://wiki.snom.com/Interoperability/PBX/Asterisk * http://www.voip-info.org/wiki/view/Asterisk+phone+snom * http://asterisk.snom.com/index.php/Asterisk_1.4/Intercom * http://wiki.snom.com/Category:HowTo:Intercom * http://wiki.snom.com/FAQ/How_to_make_Asterisk_send_INVITEs_to_trigger_the_phone_for_Intercom * Parler GoogleTts * Ne pas oublier un paquet : http://www.asterisk-france.org/showthread.php/2175-TTS-googletts-agi-marche-mais-pas-de-son * http://zaf.github.io/asterisk-googletts/ * http://denisrosenkranz.com/tuto-asterisk-mettre-en-place-un-menu-interactif-ivr-avec-googletts/ * VoiceMail * https://github.com/lgaetz/freepbx-VoicemailBLF * http://asterisk.mdaniel.net/2006/10/13/voicemail-app-modifications/ * http://asterisk.mdaniel.net/2006/12/06/mwi-notification/ * http://www.asterisk-france.org/archives_net/archive/index.php/t-1296.html * http://pbxinaflash.com/docs/ * Pager'n Co * http://www.freepbx.org/support/documentation/module-documentation/paging-and-intercom * http://denisrosenkranz.com/tuto-asterisk-mise-en-place-dun-utilitaire-de-creation-dannonces-daccueils/ * http://denisrosenkranz.com/tuto-asterisk-enregistrer-sa-voix-pour-creer-un-ivr-personnalise/ * http://denisrosenkranz.com/tuto-asterisk-se-connecter-a-un-fournisseur-sip-et-groupes-dappels/ * http://www.touteladomotique.com/index.php?option=com_content&view=article&id=641:2012111201&catid=79:informatique&Itemid=90 ====== Exemple d'un CallBack ====== asterisk@laotseu:~$ cat /tmp/hello-world.call Channel: SIP/FXO1/99306XXXXXXXX MaxRetries: 3 RetryTime: 60 WaitTime: 30 Context: interne Extension: 900 Priority: 1 Ca marche comme ca: (chez M...) asterisk@laotseu:~$ sleep 600; cp /tmp/hello-world.call /var/spool/asterisk/outgoing/ ====== Tester en SIP par l'exemple ====== Ceci est un cut'n paste en provenance de [[http://www.asterisk-france.org/showthread.php/1010-Temps-validit%C3%A9-authentification-SIP]] Pour les tests de la mémoire il faut bien utiliser toute la chaîne d’authentification, REGISTER 401 REGISTER, sinon le test est mauvais. Je vais te donner la commande de 'sipsak' qui est capable de s’enregistrer avec le mot de passe: /usr/bin/sipsak -U -d -n -x 3700 -C sip:3397075xxxx@83.xx.xx.xx:5060 -s sip:3397075xxxx@sip.domaine.fr:5060 -vvv -a MOTDEPASSE -H 83.xx.xx.xx.xx En details: * -C = TON URI (ton contact) * -s = Destination (ton asterisk) * -a mot de passe de ton compte. ====== Iterations sur une chaine ====== exten => 914,1,NoOp(On apprend a compter a partir de ${ADLPALL}) exten => 914,n,Set(i=1) exten => 914,n,Set(j=${CUT(ADLPALL,&,${i})}) exten => 914,n,While(${LEN(${j})} > 0) exten => 914,n,NoOp(ICI ON TRAITE LE TRUC DU MACHIN ${j} ${i}) exten => 914,n,Set(i=$[${i} + 1]) exten => 914,n,Set(j=${CUT(ADLPALL,&,${i})}) exten => 914,n,EndWhile exten => 914,n,HangUp ====== Creer une macro, et l'utiliser ====== La macro [macro-itexten] exten => s,1,NoOp(On apprend a compter a partir de ${ARG1}) exten => s,n,Set(k=${ARG1}) exten => s,n,Set(i=1) exten => s,n,Set(j=${CUT(k,&,${i})}) exten => s,n,While(${LEN(${j})} > 0) exten => s,n,NoOp(ICI ON TRAITE LE TRUC DU MACHIN ${j} ${i}) exten => s,n,Set(i=$[${i} + 1]) exten => s,n,Set(j=${CUT(k,&,${i})}) exten => s,n,EndWhile exten => s,n,HangUp Son appel exten => 915,1,NoOp(Pouette) exten => 915,n,Macro(itexten,${ADLPALL}) ====== Adlp' Tools ====== ===== Macro de creation des fichiers de callback ===== Cette macro evite de : - Faire appel a un AGI specialisé pour faire un call-back - Recoder systematiquement la creation d'un call-back [macro-CallBackScript] ;;;;; Macro(CallBackScript,SIP/pouette,"Pouette",MaxRetries-RetryTime-WaitTime-Account,Quand,Extention@Context,SetVars) ;;;;; Macro(CallBackScript,SIP/pouette,"Pouette",MaxRetries-RetryTime-WaitTime-Account,Quand,Application ,Params ) ;;;;; 1 2 3 4 5 6 ;;;;; * Specify where and how to call ;;;;; A o Channel: : Channel to use for the call. ;;;;; A o CallerID: "name" Caller ID, Please note: It may not work if you do not respect the format: CallerID: "Some Name" <1234> ;;;;; B1o MaxRetries: Number of retries before failing (not including the initial attempt, e.g. 0 = total of 1 attempt to make the call). Default is 0. ;;;;; B2o RetryTime: Seconds between retries, Don't hammer an unavailable phone. Default is 300 (5 min). ;;;;; B3o WaitTime: Seconds to wait for an answer. Default is 45. ;;;;; B4o Account: Set the account code to use. ;;;;; * If the call answers, connect it here: ;;;;; C o Context: Context in extensions.conf ;;;;; C o Extension: Extension definition in extensions.conf ;;;;; o Priority: Priority of extension to start with ;;;;; C o Set: Set a variable for use in the extension logic (example: file1=/tmp/to ); in Asterisk 1.0.x use 'SetVar' instead of 'Set' ;;;;; D o Application: Asterisk Application to run (use instead of specifiying context, extension and priority) ;;;;; D o Data: The options to be passed to application ;;;;; * New (?) in Asterisk 1.4 ;;;;; o Set: Can now also write to dialplan functions like CDR() ;;;;; o AlwaysDelete: Yes/No - If the file's modification time is in the future, the call file will not be deleted ;;;;; o Archive: Yes/No - Move to subdir "outgoing_done" with "Status: value", where value can be Completed, Expired or Failed. exten => s,1,NoOp(Puttin) exten => s,n,Set(FiEx=${RAND(1,10000)}) exten => s,n,Set(MaxRet=${CUT(ARG3,-,1)}) exten => s,n,Set(MaxRet=${IF(${LEN(${MaxRet})} ? ${MaxRet} : 0)}) exten => s,n,Set(RetryT=${CUT(ARG3,-,2)}) exten => s,n,Set(RetryT=${IF(${LEN(${RetryT})} ? ${RetryT} : 200)}) exten => s,n,Set(WaitTi=${CUT(ARG3,-,3)}) exten => s,n,Set(WaitTi=${IF(${LEN(${WaitTi})} ? ${WaitTi} : 45)}) exten => s,n,Set(Accoun=${CUT(ARG3,-,4)}) exten => s,n,Set(Accoun=${IF(${LEN(${Accoun})} ? ${Accoun} : ScriptEd)}) exten => s,n,Set(A=Channel: ${ARG1}\\nCallerID: ${ARG2}\\nMaxRetries: ${MaxRet}\\nRetryTime: ${RetryT}\\nWaitTime: ${WaitTi}\\nAccount: ${Accoun}\\n) exten => s,n,Set(Cont=${CUT(ARG5,@,2)}) exten => s,n,Set(Exte=${CUT(ARG5,@,1)}) exten => s,n,Set(B=Context: ${Cont}\\nExtension: ${Exte}\\nPriority: 1\\n${ARG6}) exten => s,n,Set(C=Application: ${ARG5}\\nData: ${ARG6}) exten => s,n,Set(i=7) exten => s,n,While(${LEN(${ARG${i}})}) exten => s,n,Set(C=${C},${ARG${i}}) exten => s,n,Set(i=$[${i} + 1]) exten => s,n,EndWhile exten => s,n,Set(SysC=${IF(${LEN(${Cont})>0}?B:C)}) exten => s,n,system(echo "${A}${${SysC}}" >/tmp/recall.call-${FiEx}) exten => s,n,GotoIf($[${LEN(${ARG4})}=0]?touchfait) exten => s,n,Set(Touh=${ARG4}) exten => s,n,GotoIf($[${LEN(${CUT(ARG4,+,2)})}=0]?noaddi) exten => s,n,Set(i=${CUT(ARG4,+,2)}) exten => s,n,Set(j=${STRFTIME(${EPOCH},,%Y%m%d%H%M)}) exten => s,n,Set(Touh=${MATH(${i}+${j})}) exten => s,n,Set(Touh=${CUT(Touh,.,1)}) exten => s,n(noaddi),system(touch -t ${Touh} /tmp/recall.call-${FiEx}) exten => s,n(touchfait),NoOp(On va tenter de faire quelquechose de drole, ou pas...) exten => s,n,system(mv /tmp/recall.call-${FiEx} /var/spool/asterisk/outgoing/) TODO: Mettre des exemples d'appel Ci-joint des exemples d'usage de la macro [interne] exten => 913,1,NoOp(On apprend a compter) exten => 913,n,Macro(CallBackScript,SIP/z6poi,,,,echo) exten => 913,n,HangUp() exten => 914,1,NoOp(On apprend a compter) exten => 914,n,Macro(CallBackScript,SIP/z6poi,,,,repondeur@interne) exten => 914,n,HangUp() exten => 915,1,NoOp(On apprend a compter) exten => 915,n,Macro(CallBackScript,SIP/z6poi,,,+5,Voicemail,1234,b) exten => 915,n,HangUp() exten => 916,1,NoOp(On demontre la conference) exten => 916,n,Macro(InMeetifAvailable,Chambre,${ADLPALLI},a Couchee) exten => 916,n,HangUp exten => repondeur,1,NoOp(Zi repondeur) exten => repondeur,n,Voicemail(1234,b) exten => repondeur,n,HangUp ===== Selection de ligne sortante par priorité ===== Cette macro evite de : - d'utiliser les autres methodes de selection d'un groupe de ligne Elle va - Tester si la ligne est disponible - Si elle l'est elle passe l'appel dessus - Sinon elle passe a la suivante Conseil - Placer dans la derniere ligne en fait un appel vers un PlayBack...