├── .gitignore ├── .gitmodules ├── README.md ├── ansible.cfg ├── ansible ├── files │ ├── .env │ └── asterisk │ │ └── etc │ │ ├── acl.conf │ │ ├── adsi.conf │ │ ├── agents.conf │ │ ├── alarmreceiver.conf │ │ ├── alsa.conf │ │ ├── amd.conf │ │ ├── app_mysql.conf │ │ ├── app_skel.conf │ │ ├── ari.conf │ │ ├── ast_debug_tools.conf │ │ ├── asterisk.adsi │ │ ├── asterisk.conf │ │ ├── calendar.conf │ │ ├── ccss.conf │ │ ├── cdr.conf │ │ ├── cdr_adaptive_odbc.conf │ │ ├── cdr_custom.conf │ │ ├── cdr_manager.conf │ │ ├── cdr_mysql.conf │ │ ├── cdr_odbc.conf │ │ ├── cdr_pgsql.conf │ │ ├── cdr_sqlite3_custom.conf │ │ ├── cdr_syslog.conf │ │ ├── cdr_tds.conf │ │ ├── cel.conf │ │ ├── cel_custom.conf │ │ ├── cel_odbc.conf │ │ ├── cel_pgsql.conf │ │ ├── cel_sqlite3_custom.conf │ │ ├── cel_tds.conf │ │ ├── chan_dahdi.conf │ │ ├── chan_mobile.conf │ │ ├── cli.conf │ │ ├── cli_aliases.conf │ │ ├── cli_permissions.conf │ │ ├── codecs.conf │ │ ├── confbridge.conf │ │ ├── config_test.conf │ │ ├── console.conf │ │ ├── dbsep.conf │ │ ├── dnsmgr.conf │ │ ├── dsp.conf │ │ ├── dundi.conf │ │ ├── enum.conf │ │ ├── extensions.ael │ │ ├── extensions.conf │ │ ├── extensions.lua │ │ ├── extensions_minivm.conf │ │ ├── features.conf │ │ ├── festival.conf │ │ ├── followme.conf │ │ ├── func_odbc.conf │ │ ├── hep.conf │ │ ├── http.conf │ │ ├── iax.conf │ │ ├── iaxprov.conf │ │ ├── indications.conf │ │ ├── logger.conf │ │ ├── manager.conf │ │ ├── manager.d │ │ └── admin.conf │ │ ├── meetme.conf │ │ ├── mgcp.conf │ │ ├── minivm.conf │ │ ├── misdn.conf │ │ ├── modules.conf │ │ ├── motif.conf │ │ ├── musiconhold.conf │ │ ├── muted.conf │ │ ├── ooh323.conf │ │ ├── osp.conf │ │ ├── oss.conf │ │ ├── phone.conf │ │ ├── phoneprov.conf │ │ ├── pjproject.conf │ │ ├── pjsip.conf │ │ ├── pjsip_notify.conf │ │ ├── pjsip_wizard.conf │ │ ├── queuerules.conf │ │ ├── queues.conf │ │ ├── res_config_mysql.conf │ │ ├── res_config_sqlite.conf │ │ ├── res_config_sqlite3.conf │ │ ├── res_corosync.conf │ │ ├── res_curl.conf │ │ ├── res_fax.conf │ │ ├── res_ldap.conf │ │ ├── res_odbc.conf │ │ ├── res_parking.conf │ │ ├── res_pgsql.conf │ │ ├── res_pktccops.conf │ │ ├── res_snmp.conf │ │ ├── res_stun_monitor.conf │ │ ├── rtp.conf │ │ ├── say.conf │ │ ├── sip.conf │ │ ├── sip_notify.conf │ │ ├── skinny.conf │ │ ├── sla.conf │ │ ├── smdi.conf │ │ ├── sorcery.conf │ │ ├── ss7.timers │ │ ├── stasis.conf │ │ ├── statsd.conf │ │ ├── telcordia-1.adsi │ │ ├── test_sorcery.conf │ │ ├── udptl.conf │ │ ├── unistim.conf │ │ ├── users.conf │ │ ├── voicemail.conf │ │ ├── vpb.conf │ │ └── xmpp.conf ├── inventories │ └── production └── playbook.yml ├── composer.json ├── composer.lock ├── dashboard.sh ├── deploy.sh ├── log └── .gitkeep ├── public └── static │ ├── css │ ├── bootstrap-grid.min.css │ ├── bootstrap-grid.min.css.map │ ├── bootstrap-reboot.min.css │ ├── bootstrap-reboot.min.css.map │ ├── bootstrap.min.css │ ├── bootstrap.min.css.map │ └── cardinal.css │ ├── favicon.ico │ ├── index.html │ └── js │ └── vue.js ├── server.php └── src └── Callcenter ├── AsteriskManager.php ├── BaseAsteriskManager.php ├── Callcenter.php ├── CallcenterEvent.php ├── Model ├── Agent.php ├── Call.php ├── Connection.php ├── Report.php └── Statistics.php ├── Report └── File.php ├── ReportInterface.php └── WebsocketHandler.php /.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | log/*.log 3 | .idea 4 | ansible/*.retry 5 | report.csv 6 | /.env 7 | nohup.out 8 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ansible/roles/ansible-role-redis"] 2 | path = ansible/roles/ansible-role-redis 3 | url = https://github.com/geerlingguy/ansible-role-redis.git 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Simple Asterisk callcenter with PHP and Vue.js 2 | 3 | [Click here for slides from Astricon 2018 presentation (Slideshare)](https://www.slideshare.net/mor10am/simple-callcenter-platform-with-php) 4 | 5 | ## Deploy 6 | 7 | ``` 8 | $> ansible-playbook ansible/playbook.yml -i ansible/inventories/production 9 | ``` 10 | 11 | ## Server process and frontend 12 | 13 | ``` 14 | $> php server.php 15 | ``` 16 | 17 | It will listen to Asterisk AMI on ```tcp://callcenter.local:5038``` 18 | and create a Websocket server on ```tcp://callcenter.local:8080/callcenter``` 19 | 20 | The webpage dashboard is served by builtin Asterisk HTTP server 21 | at ```http://callcenter.local:8088/static/index.html``` 22 | 23 | ```callcenter.local``` is added to ```/etc/hosts``` 24 | 25 | The settings for the server is defined in ```.env``` as: 26 | 27 | ```bash 28 | WSSERVERADDRESS=callcenter.local 29 | WSSERVERPORT=8080 30 | ASTERISKSERVER=tcp://localhost:5038 31 | AMI_USERNAME=admin 32 | AMI_PASSWORD=password 33 | REDIS_SERVER=127.0.0.1 34 | ENV=development 35 | ``` 36 | 37 | The webpage will connect to the websocket server and on connection 38 | get the current state of the the backend server process. 39 | 40 | ## Changes from default configuration files in Asterisk: 41 | 42 | * sip.conf 43 | 44 | ``` 45 | tcpenable=yes 46 | transport=tcp,udp 47 | autocreatepeer=yes 48 | 49 | [phones] 50 | type=friend 51 | host=dynamic 52 | port=5060 53 | sipreinvite=no 54 | transport=tcp,udp 55 | secret=password 56 | callevents=yes 57 | directmedia=no 58 | insecure=invite,port 59 | ``` 60 | 61 | * manager.d/admin.conf 62 | 63 | ``` 64 | [admin] 65 | secret = password 66 | read = call,agent,user,security 67 | write = call,command,agent,user,originate 68 | ``` 69 | 70 | * http.conf 71 | 72 | ``` 73 | enabled=yes 74 | bindaddr=0.0.0.0 75 | bindport=8088 76 | enablestatic=yes 77 | redirect= / /static/index.html 78 | ``` 79 | 80 | * queues.conf 81 | 82 | ``` 83 | [q-callcenter] 84 | strategy=random 85 | joinempty=yes 86 | leavewhenempty=no 87 | ringinuse=no 88 | 89 | setinterfacevar=yes 90 | setqueueentryvar=yes 91 | setqueuevar=yes 92 | 93 | timeout = 60 94 | retry = 10 95 | wrapuptime=15 96 | 97 | autopause=yes 98 | 99 | reportholdtime=yes 100 | announce-position=yes 101 | announce-holdtime=yes 102 | queue-callswaiting = queue-callswaiting 103 | queue-thankyou = queue-thankyou 104 | queue-youarenext = queue-youarenext 105 | periodic-announce = queue-periodic-announce 106 | periodic-announce-frequency=30 107 | announce-frequency=45 108 | ``` 109 | 110 | * extensions.ael 111 | 112 | Empty 113 | 114 | * extension.lua 115 | 116 | Empty 117 | -------------------------------------------------------------------------------- /ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | timeout=10 3 | 4 | [ssh_connection] 5 | pipelining = false 6 | scp_if_ssh = true 7 | host_key_checking = true 8 | -------------------------------------------------------------------------------- /ansible/files/.env: -------------------------------------------------------------------------------- 1 | WSSERVERADDRESS=callcenter.local 2 | WSSERVERPORT=8080 3 | ASTERISKSERVER=tcp://localhost:5038 4 | AMI_USERNAME=admin 5 | AMI_PASSWORD=password 6 | REDIS_SERVER=127.0.0.1 7 | ENV=production 8 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/acl.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Named Access Control Lists (ACLs) 3 | ; 4 | ; A convenient way to share acl definitions 5 | ; 6 | ; This configuration file is read on startup 7 | ; 8 | ; CLI Commands 9 | ; ----------------------------------------------------------- 10 | ; acl show Show all named ACLs configured 11 | ; acl show Show contents of a particular named ACL 12 | ; reload acl Reload configuration file 13 | ; 14 | ; Any configuration that uses ACLs which has been made to be able to use named 15 | ; ACLs will specify a named ACL with the 'acl' option in its configuration in 16 | ; a similar fashion to the usual 'permit' and 'deny' options. Example: 17 | ; acl=my_named_acl 18 | ; 19 | ; Multiple named ACLs can be applied by either comma separating the arguments or 20 | ; just by adding additional ACL lines. Example: 21 | ; acl=my_named_acl 22 | ; acl=my_named_acl2 23 | ; 24 | ; or 25 | ; 26 | ; acl=my_named_acl,my_named_acl2 27 | ; 28 | ; ACLs specified by name are evaluated independently from the ACL specified via 29 | ; permit/deny. In order for an address to pass a given ACL, it must pass both 30 | ; the ACL specified by permit/deny for a given item as well as any named ACLs 31 | ; that were specified. 32 | ; 33 | ;[example_named_acl1] 34 | ;deny=0.0.0.0/0.0.0.0 35 | ;permit=209.16.236.0 36 | ;permit=209.16.236.1 37 | ; 38 | ;[example_named_acl2] 39 | ;permit=0.0.0.0/0.0.0.0 40 | ;deny=10.24.20.171 41 | ;deny=10.24.20.103 42 | ;deny=209.16.236.1 43 | ; 44 | ; example_named_acl1 above shows an example of whitelisting. When whitelisting, the 45 | ; named ACLs should follow a deny that blocks everything (like deny=0.0.0.0/0.0.0.0) 46 | ; The following example explains how combining the ACLs works: 47 | ; 48 | ; [example_item_with_acl] 49 | ; acl=example_named_acl1 50 | ; acl=example_named_acl2 51 | ; 52 | ; Suppose 209.16.236.0 tries to communicate and the ACL for that example is applied to it... 53 | ; First, example_named_acl1 is evaluated. The address is allowed by that ACL. 54 | ; Next, example_named_acl2 is evaluated. The address isn't blocked by example_named_acl2 55 | ; either, so it passes. 56 | ; 57 | ; Suppose instead 209.16.236.1 tries to communicate and the same ACL is applied. 58 | ; First, example_named_acl1 is evaluated and the address is allowed. 59 | ; However, it is blocked by example_named_acl2, so the address is blocked from the combined 60 | ; ACL. 61 | ; 62 | ; Similarly, the permits/denies in specific configurations that make up an ACL definition 63 | ; are also treated as a separate ACL for evaluation. So if we change the example above to: 64 | ; 65 | ; [example_item_with_acl] 66 | ; acl=example_named_acl1 67 | ; acl=example_named_acl2 68 | ; deny=209.16.236.0 69 | ; 70 | ; Then 209.16.236.0 will be rejected by the non-named component of the combined ACL even 71 | ; though it passes the two named components. 72 | ; 73 | ; 74 | ; Named ACLs can use ipv6 addresses just like normal ACLs. 75 | ;[ipv6_example_1] 76 | ;deny = :: 77 | ;permit = ::1/128 78 | ; 79 | ;[ipv6_example_2] 80 | ;permit = fe80::21d:bad:fad:2323 81 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/adsi.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Sample ADSI Configuration file 3 | ; 4 | [intro] 5 | alignment = center 6 | greeting => Welcome to the 7 | greeting => Asterisk 8 | greeting => Open Source PBX 9 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/agents.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Agent pool configuration 3 | ; 4 | 5 | [general] 6 | ; The general section of this config is not currently used, but reserved 7 | ; for future use. 8 | 9 | ;[agent-id] 10 | ; Define ackcall to require the agent to give a DTMF acknowledgement 11 | ; when the agent receives a call. 12 | ; The channel variable AGENTACKCALL overrides on agent login. 13 | ; Default is "no". 14 | ;ackcall=no 15 | ; 16 | ; Set what DTMF key sequence the agent should use to acknowledge a call. 17 | ; The channel variable AGENTACCEPTDTMF overrides on agent login. 18 | ; This option is ignored unless ackcall is enabled. 19 | ; Default is "#". 20 | ;acceptdtmf=## 21 | ; 22 | ; Set how many seconds a call for the agent has to wait for the agent to 23 | ; acknowledge the call before the agent is automatically logged off. If 24 | ; set to zero then the call will wait forever for the agent to acknowledge. 25 | ; The channel variable AGENTAUTOLOGOFF overrides on agent login. 26 | ; This option is ignored unless ackcall is enabled. 27 | ; Default is 0. 28 | ;autologoff=15 29 | ; 30 | ; Set the minimum amount of time after disconnecting a call before 31 | ; the agent can receive a new call in milliseconds. 32 | ; The channel variable AGENTWRAPUPTIME overrides on agent login. 33 | ; Default is 0. 34 | ;wrapuptime=5000 35 | ; 36 | ; Set the musiconhold class for the agent. 37 | ; Default is "default". 38 | ;musiconhold=default 39 | ; 40 | ; Enable recording calls the agent takes automatically by invoking the 41 | ; DTMF automixmon feature when the agent connects to a caller. 42 | ; See features.conf.sample for information about the automixmon feature. 43 | ; Default is "no". 44 | ;recordagentcalls=yes 45 | ; 46 | ; The sound file played to alert the agent when a call is present. 47 | ; Default is "beep". 48 | ;custom_beep=beep 49 | ; 50 | ; A friendly name for the agent used in log messages. 51 | ; Default is "". 52 | ;fullname=Mark Spencer 53 | ; 54 | ; -------------------------------------------------- 55 | ; 56 | ; This section contains example agent definitions: 57 | ; 58 | ; Define a template called my-agents: 59 | ;[my-agents](!) 60 | ;autologoff=15 61 | ;ackcall=yes 62 | ;acceptdtmf=## 63 | ; 64 | ; Define agent 1001 using the my-agents template: 65 | ;[1001](my-agents) 66 | ;fullname=Mark Spencer 67 | ; 68 | ; Define agent 1002 using the my-agents template: 69 | ;[1002](my-agents) 70 | ;fullname=Will Meadows 71 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/alarmreceiver.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; alarmreceiver.conf 3 | ; 4 | ; Sample configuration file for the Asterisk alarm receiver application. 5 | ; 6 | 7 | 8 | [general] 9 | 10 | ; 11 | ; Specify a timestamp format for the metadata section of the event files 12 | ; Default is %a %b %d, %Y @ %H:%M:%S %Z 13 | 14 | timestampformat = %a %b %d, %Y @ %H:%M:%S %Z 15 | 16 | ; 17 | ; Specify a command to execute when the caller hangs up 18 | ; 19 | ; Default is none 20 | ; 21 | 22 | ;eventcmd = yourprogram -yourargs ... 23 | 24 | ; 25 | ; Specify a spool directory for the event files. This setting is required 26 | ; if you want the app to be useful. Event files written to the spool 27 | ; directory will be of the template event-XXXXXX, where XXXXXX is a random 28 | ; and unique alphanumeric string. 29 | ; 30 | ; Default is none, and the events will be dropped on the floor. 31 | ; 32 | 33 | eventspooldir = /tmp 34 | 35 | ; 36 | ; The alarmreceiver app can either log the events one-at-a-time to individual 37 | ; files in the spool directory, or it can store them until the caller 38 | ; disconnects and write them all to one file. 39 | ; 40 | ; The default setting for logindividualevents is no. 41 | ; 42 | 43 | logindividualevents = no 44 | 45 | ; 46 | ; The timeout for receiving the first DTMF digit is adjustable from 1000 msec. 47 | ; to 10000 msec. The default is 2000 msec. Note: if you wish to test the 48 | ; receiver by entering digits manually, set this to a reasonable time out 49 | ; like 10000 milliseconds. 50 | 51 | fdtimeout = 2000 52 | 53 | ; 54 | ; The timeout for receiving subsequent DTMF digits is adjustable from 55 | ; 110 msec. to 4000 msec. The default is 200 msec. Note: if you wish to test 56 | ; the receiver by entering digits manually, set this to a reasonable time out 57 | ; like 4000 milliseconds. 58 | ; 59 | 60 | sdtimeout = 200 61 | 62 | ; 63 | ; Wait for the connection to settle post-answer. Adjustable from 500 msec. to 10000 msec. 64 | ; The default is 1250 msec. 65 | ; 66 | 67 | answait = 1250 68 | 69 | ; When logging individual events it may be desirable to skip grouping of metadata 70 | 71 | ;no_group_meta = yes 72 | 73 | ; 74 | ; The loudness of the ACK and Kissoff tones is adjustable from 100 to 8192. 75 | ; The default is 8192. This shouldn't need to be messed with, but is included 76 | ; just in case there are problems with signal levels. 77 | ; 78 | 79 | loudness = 8192 80 | 81 | ; 82 | ; The db-family setting allows the user to capture statistics on the number of 83 | ; calls, and the errors the alarm receiver sees. The default is for no 84 | ; db-family name to be defined and the database logging to be turned off. 85 | ; 86 | 87 | ;db-family = yourfamily: 88 | 89 | ; 90 | ; End of alarmreceiver.conf 91 | ; 92 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/alsa.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Open Sound System Console Driver Configuration File 3 | ; 4 | [general] 5 | ; 6 | ; Automatically answer incoming calls on the console? Choose yes if 7 | ; for example you want to use this as an intercom. 8 | ; 9 | autoanswer=yes 10 | ; 11 | ; Default context (is overridden with @context syntax) 12 | ; 13 | context=local 14 | ; 15 | ; Default extension to call 16 | ; 17 | extension=s 18 | ; 19 | ; Default language 20 | ; 21 | ;language=en 22 | ; 23 | ; Default Music on Hold class to use when this channel is placed on hold in 24 | ; the case that the music class is not set on the channel with 25 | ; Set(CHANNEL(musicclass)=whatever) in the dialplan and the peer channel 26 | ; putting this one on hold did not suggest a class to use. 27 | ; 28 | ;mohinterpret=default 29 | ; 30 | ; Silence suppression can be enabled when sound is over a certain threshold. 31 | ; The value for the threshold should probably be between 500 and 2000 or so, 32 | ; but your mileage may vary. Use the echo test to evaluate the best setting. 33 | ;silencesuppression = yes 34 | ;silencethreshold = 1000 35 | ; 36 | ; To set which ALSA device to use, change this parameter 37 | ;input_device=hw:0,0 38 | ;output_device=hw:0,0 39 | 40 | ; 41 | ; Default mute state (can also be toggled via CLI) 42 | ;mute=true 43 | 44 | ; 45 | ; If enabled, no audio capture device will be opened. This is useful on 46 | ; systems where there will be no return audio path, such as overhead pagers. 47 | ;noaudiocapture=true 48 | 49 | ; ----------------------------- JITTER BUFFER CONFIGURATION -------------------------- 50 | ; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of an 51 | ; ALSA channel. Defaults to "no". An enabled jitterbuffer will 52 | ; be used only if the sending side can create and the receiving 53 | ; side can not accept jitter. The ALSA channel can't accept jitter, 54 | ; thus an enabled jitterbuffer on the receive ALSA side will always 55 | ; be used if the sending side can create jitter. 56 | 57 | ; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds. 58 | 59 | ; jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is 60 | ; resynchronized. Useful to improve the quality of the voice, with 61 | ; big jumps in/broken timestamps, usually sent from exotic devices 62 | ; and programs. Defaults to 1000. 63 | 64 | ; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a SIP 65 | ; channel. Two implementations are currently available - "fixed" 66 | ; (with size always equals to jbmax-size) and "adaptive" (with 67 | ; variable size, actually the new jb of IAX2). Defaults to fixed. 68 | 69 | ; jbtargetextra = 40 ; This option only affects the jb when 'jbimpl = adaptive' is set. 70 | ; The option represents the number of milliseconds by which the new 71 | ; jitter buffer will pad its size. the default is 40, so without 72 | ; modification, the new jitter buffer will set its size to the jitter 73 | ; value plus 40 milliseconds. increasing this value may help if your 74 | ; network normally has low jitter, but occasionally has spikes. 75 | 76 | ; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no". 77 | ; ---------------------------------------------------------------------------------- 78 | 79 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/amd.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Answering Machine Detection Configuration 3 | ; 4 | 5 | [general] 6 | total_analysis_time = 5000 ; Maximum time allowed for the algorithm to decide 7 | ; on whether the audio represents a HUMAN, or a MACHINE 8 | silence_threshold = 256 ; If the average level of noise in a sample does not reach 9 | ; this value, from a scale of 0 to 32767, then we will consider 10 | ; it to be silence. 11 | 12 | ; Greeting ; 13 | initial_silence = 2500 ; Maximum silence duration before the greeting. 14 | ; If exceeded, then the result is detection as a MACHINE. 15 | after_greeting_silence = 800 ; Silence after detecting a greeting. 16 | ; If exceeded, then the result is detection as a HUMAN 17 | greeting = 1500 ; Maximum length of a greeting. If exceeded, then the 18 | ; result is detection as a MACHINE. 19 | 20 | ; Word detection ; 21 | min_word_length = 100 ; Minimum duration of Voice to considered as a word 22 | maximum_word_length = 5000 ; Maximum duration of a single Voice utterance allowed. 23 | between_words_silence = 50 ; Minimum duration of silence after a word to consider 24 | ; the audio what follows as a new word 25 | 26 | maximum_number_of_words = 3 ; Maximum number of words in the greeting 27 | ; If REACHED, then the result is detection as a MACHINE 28 | ; WARNING: Releases prior to January 1 2016 documented 29 | ; maximum_number_of_words as 'if exceeded, then MACHINE', 30 | ; which did not reflect the true functionality. In Asterisk 14, 31 | ; this functionality will change to reflect the variables' name. 32 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/app_mysql.conf: -------------------------------------------------------------------------------- 1 | ; Configuration file for the MYSQL app addon 2 | 3 | [general] 4 | ; 5 | ; Nullvalue governs how NULL values are returned from the database. In 6 | ; previous versions, the special NULL value was returned as the "NULL" 7 | ; string. We now provide an option for the behavior, configured globally. 8 | ; nullstring - the string "NULL" 9 | ; emptystring - the string "" 10 | ; null - unset the variable 11 | ; 12 | ; WARNING: setting nullvalue=null may have undesireable consequences, in 13 | ; particular if you use subroutines in AEL or the LOCAL() variable construct. 14 | ; You have been warned. Don't complain if you use that setting in combination 15 | ; with Gosub or AEL and get buggy behavior. 16 | ; 17 | nullvalue = nullstring 18 | 19 | ; If set, autoclear will destroy allocated statement and connection resources 20 | ; when the channel ends. For most usage of the MYSQL app, this is what you 21 | ; want, but it's conceivable that somebody is sharing MYSQL connections across 22 | ; multiple channels, in which case, this should be set to 'no'. Defaults to 23 | ; 'no', as this was the original behavior. 24 | autoclear=yes 25 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/app_skel.conf: -------------------------------------------------------------------------------- 1 | [general] 2 | games=3 3 | cheat=no 4 | 5 | [sounds] 6 | prompt=please-enter-your,number,queue-less-than 7 | wrong_guess=vm-pls-try-again 8 | right_guess=auth-thankyou 9 | too_high=high 10 | too_low=low 11 | lose=vm-goodbye 12 | 13 | [easy] 14 | max_number=10 15 | max_guesses=4 16 | 17 | [medium] 18 | max_number=100 19 | max_guesses=6 20 | 21 | [hard] 22 | max_number=1000 23 | max_guesses=7 24 | 25 | [nightmare] 26 | max_number=1000 27 | max_guesses=1 28 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/ari.conf: -------------------------------------------------------------------------------- 1 | [general] 2 | enabled = yes ; When set to no, ARI support is disabled. 3 | ;pretty = no ; When set to yes, responses from ARI are 4 | ; ; formatted to be human readable. 5 | ;allowed_origins = ; Comma separated list of allowed origins, for 6 | ; ; Cross-Origin Resource Sharing. May be set to * to 7 | ; ; allow all origins. 8 | ;auth_realm = ; Realm to use for authentication. Defaults to Asterisk 9 | ; ; REST Interface. 10 | ; 11 | ; Default write timeout to set on websockets. This value may need to be adjusted 12 | ; for connections where Asterisk must write a substantial amount of data and the 13 | ; receiving clients are slow to process the received information. Value is in 14 | ; milliseconds; default is 100 ms. 15 | ;websocket_write_timeout = 100 16 | 17 | ;[username] 18 | ;type = user ; Specifies user configuration 19 | ;read_only = no ; When set to yes, user is only authorized for 20 | ; ; read-only requests. 21 | ; 22 | ;password = ; Crypted or plaintext password (see password_format). 23 | ; 24 | ; password_format may be set to plain (the default) or crypt. When set to crypt, 25 | ; crypt(3) is used to validate the password. A crypted password can be generated 26 | ; using mkpasswd -m sha-512. 27 | ; 28 | ; When set to plain, the password is in plaintext. 29 | ; 30 | ;password_format = plain 31 | 32 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/ast_debug_tools.conf: -------------------------------------------------------------------------------- 1 | # 2 | # This file is used by the Asterisk debug tools. 3 | # Unlike other Asterisk config files, this one is 4 | # "sourced" by bash and must adhere to bash semantics. 5 | # 6 | 7 | # A list of coredumps and/or coredump search patterns. 8 | # Bash extended globs are enabled and any resulting files 9 | # that aren't actually coredumps are silently ignored 10 | # so you can be liberal with the globs. 11 | # 12 | # If your patterns contains spaces be sure to only quote 13 | # the portion of the pattern that DOESN'T contain wildcard 14 | # expressions. If you quote the whole pattern, it won't 15 | # be expanded and the glob characters will be treated as 16 | # literals. 17 | # 18 | # The exclusion of files ending ".txt" is just for 19 | # demonstration purposes as non-coredumps will be ignored 20 | # anyway. 21 | COREDUMPS=(/tmp/core[-._]asterisk!(*.txt) /tmp/core[-._]$(hostname)!(*.txt)) 22 | 23 | # Date command for the "running" coredump and tarballs. 24 | # DATEFORMAT will be executed to get the timestamp. 25 | # Don't put quotes around the format string or they'll be 26 | # treated as literal characters. Also be aware of colons 27 | # in the output as you can't upload files with colons in 28 | # the name to Jira. 29 | # 30 | # Unix timestamp 31 | #DATEFORMAT='date +%s.%N' 32 | # 33 | # Unix timestamp on *BSD/MacOS after installing coreutils 34 | #DATEFORMAT='gdate +%s.%N' 35 | # 36 | # Readable GMT 37 | #DATEFORMAT='date -u +%FT%H-%M-%S%z' 38 | # 39 | # Readable Local time 40 | DATEFORMAT='date +%FT%H-%M-%S%z' 41 | 42 | # A list of log files and/or log file search patterns using the 43 | # same syntax as COREDUMPS. 44 | # 45 | LOGFILES=(/var/log/asterisk/messages* /var/log/asterisk/queue* \ 46 | /var/log/asterisk/debug* /var/log/asterisk/security*) 47 | 48 | # ast_loggrabber converts POSIX timestamps to readable format 49 | # using this Python strftime format string. If not specified 50 | # or an empty string, no format covnersion is done. 51 | LOG_DATEFORMAT="%m/%d-%H:%M:%S.%f" 52 | 53 | # The timezone to use when converting POSIX timestamps to 54 | # readable format. It can be specified in "/" 55 | # format or in abbreviation format such as "CST6CDT". If not 56 | # specified, the "local" timezone is used. 57 | # LOG_TIMEZONE= 58 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/asterisk.adsi: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk default ADSI script 3 | ; 4 | ; 5 | ; Begin with the preamble requirements 6 | ; 7 | DESCRIPTION "Asterisk PBX" ; Name of vendor 8 | VERSION 0x00 ; Version of stuff 9 | ;SECURITY "_AST" ; Security code 10 | SECURITY 0X9BDBF7AC ; Security code 11 | FDN 0x0000000F ; Descriptor number 12 | 13 | ; 14 | ; Flags 15 | ; 16 | FLAG "nocallwaiting" 17 | 18 | ; 19 | ; Predefined strings 20 | ; 21 | DISPLAY "titles" IS "** Asterisk PBX **" 22 | DISPLAY "talkingto" IS "Call active." JUSTIFY LEFT 23 | DISPLAY "callname" IS "$Call1p" JUSTIFY LEFT 24 | DISPLAY "callnum" IS "$Call1s" JUSTIFY LEFT 25 | DISPLAY "incoming" IS "Incoming call!" JUSTIFY LEFT 26 | DISPLAY "ringing" IS "Calling... " JUSTIFY LEFT 27 | DISPLAY "callended" IS "Call ended." JUSTIFY LEFT 28 | DISPLAY "missedcall" IS "Missed call." JUSTIFY LEFT 29 | DISPLAY "busy" IS "Busy." JUSTIFY LEFT 30 | DISPLAY "reorder" IS "Reorder." JUSTIFY LEFT 31 | DISPLAY "cwdisabled" IS "Callwait disabled" 32 | DISPLAY "empty" IS "asdf" 33 | 34 | ; 35 | ; Begin soft key definitions 36 | ; 37 | KEY "callfwd" IS "CallFwd" OR "Call Forward" 38 | OFFHOOK 39 | VOICEMODE 40 | WAITDIALTONE 41 | SENDDTMF "*60" 42 | GOTO "offHook" 43 | ENDKEY 44 | 45 | KEY "vmail_OH" IS "VMail" OR "Voicemail" 46 | OFFHOOK 47 | VOICEMODE 48 | WAITDIALTONE 49 | SENDDTMF "8500" 50 | ENDKEY 51 | 52 | KEY "vmail" IS "VMail" OR "Voicemail" 53 | SENDDTMF "8500" 54 | ENDKEY 55 | 56 | KEY "backspace" IS "BackSpc" OR "Backspace" 57 | BACKSPACE 58 | ENDKEY 59 | 60 | KEY "cwdisable" IS "CWDsble" OR "Disable Call Wait" 61 | SENDDTMF "*70" 62 | SETFLAG "nocallwaiting" 63 | SHOWDISPLAY "cwdisabled" AT 4 64 | TIMERCLEAR 65 | TIMERSTART 1 66 | ENDKEY 67 | 68 | KEY "cidblock" IS "CIDBlk" OR "Block Callerid" 69 | SENDDTMF "*67" 70 | SETFLAG "nocallwaiting" 71 | ENDKEY 72 | 73 | ; 74 | ; Begin main subroutine 75 | ; 76 | 77 | SUB "main" IS 78 | IFEVENT NEARANSWER THEN 79 | CLEAR 80 | SHOWDISPLAY "titles" AT 1 NOUPDATE 81 | SHOWDISPLAY "talkingto" AT 2 NOUPDATE 82 | SHOWDISPLAY "callname" AT 3 83 | SHOWDISPLAY "callnum" AT 4 84 | GOTO "stableCall" 85 | ENDIF 86 | IFEVENT OFFHOOK THEN 87 | CLEAR 88 | CLEARFLAG "nocallwaiting" 89 | CLEARDISPLAY 90 | SHOWDISPLAY "titles" AT 1 91 | SHOWKEYS "vmail" 92 | SHOWKEYS "cidblock" 93 | SHOWKEYS "cwdisable" UNLESS "nocallwaiting" 94 | GOTO "offHook" 95 | ENDIF 96 | IFEVENT IDLE THEN 97 | CLEAR 98 | SHOWDISPLAY "titles" AT 1 99 | SHOWKEYS "vmail_OH" 100 | ENDIF 101 | IFEVENT CALLERID THEN 102 | CLEAR 103 | ; SHOWDISPLAY "titles" AT 1 NOUPDATE 104 | ; SHOWDISPLAY "incoming" AT 2 NOUPDATE 105 | SHOWDISPLAY "callname" AT 3 NOUPDATE 106 | SHOWDISPLAY "callnum" AT 4 107 | ENDIF 108 | IFEVENT RING THEN 109 | CLEAR 110 | SHOWDISPLAY "titles" AT 1 NOUPDATE 111 | SHOWDISPLAY "incoming" AT 2 112 | ENDIF 113 | IFEVENT ENDOFRING THEN 114 | SHOWDISPLAY "missedcall" AT 2 115 | CLEAR 116 | SHOWDISPLAY "titles" AT 1 117 | SHOWKEYS "vmail_OH" 118 | ENDIF 119 | IFEVENT TIMER THEN 120 | CLEAR 121 | SHOWDISPLAY "empty" AT 4 122 | ENDIF 123 | ENDSUB 124 | 125 | SUB "offHook" IS 126 | IFEVENT FARRING THEN 127 | CLEAR 128 | SHOWDISPLAY "titles" AT 1 NOUPDATE 129 | SHOWDISPLAY "ringing" AT 2 NOUPDATE 130 | SHOWDISPLAY "callname" at 3 NOUPDATE 131 | SHOWDISPLAY "callnum" at 4 132 | ENDIF 133 | IFEVENT FARANSWER THEN 134 | CLEAR 135 | SHOWDISPLAY "talkingto" AT 2 136 | GOTO "stableCall" 137 | ENDIF 138 | IFEVENT BUSY THEN 139 | CLEAR 140 | SHOWDISPLAY "titles" AT 1 NOUPDATE 141 | SHOWDISPLAY "busy" AT 2 NOUPDATE 142 | SHOWDISPLAY "callname" at 3 NOUPDATE 143 | SHOWDISPLAY "callnum" at 4 144 | ENDIF 145 | IFEVENT REORDER THEN 146 | CLEAR 147 | SHOWDISPLAY "titles" AT 1 NOUPDATE 148 | SHOWDISPLAY "reorder" AT 2 NOUPDATE 149 | SHOWDISPLAY "callname" at 3 NOUPDATE 150 | SHOWDISPLAY "callnum" at 4 151 | ENDIF 152 | ENDSUB 153 | 154 | SUB "stableCall" IS 155 | IFEVENT REORDER THEN 156 | SHOWDISPLAY "callended" AT 2 157 | ENDIF 158 | ENDSUB 159 | 160 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/asterisk.conf: -------------------------------------------------------------------------------- 1 | [directories](!) 2 | astetcdir => /etc/asterisk 3 | astmoddir => /usr/lib/asterisk/modules 4 | astvarlibdir => /var/lib/asterisk 5 | astdbdir => /var/lib/asterisk 6 | astkeydir => /var/lib/asterisk 7 | astdatadir => /usr/share/asterisk 8 | astagidir => /usr/share/asterisk/agi-bin 9 | astspooldir => /var/spool/asterisk 10 | astrundir => /var/run/asterisk 11 | astlogdir => /var/log/asterisk 12 | astsbindir => /usr/sbin 13 | 14 | [options] 15 | ;verbose = 3 16 | ;debug = 3 17 | ;alwaysfork = yes ; Same as -F at startup. 18 | ;nofork = yes ; Same as -f at startup. 19 | ;quiet = yes ; Same as -q at startup. 20 | ;timestamp = yes ; Same as -T at startup. 21 | ;execincludes = yes ; Support #exec in config files. 22 | ;console = yes ; Run as console (same as -c at startup). 23 | ;highpriority = yes ; Run realtime priority (same as -p at 24 | ; startup). 25 | ;initcrypto = yes ; Initialize crypto keys (same as -i at 26 | ; startup). 27 | ;nocolor = yes ; Disable console colors. 28 | ;dontwarn = yes ; Disable some warnings. 29 | ;dumpcore = yes ; Dump core on crash (same as -g at startup). 30 | ;languageprefix = yes ; Use the new sound prefix path syntax. 31 | ;systemname = my_system_name ; Prefix uniqueid with a system name for 32 | ; Global uniqueness issues. 33 | ;autosystemname = yes ; Automatically set systemname to hostname, 34 | ; uses 'localhost' on failure, or systemname if 35 | ; set. 36 | ;mindtmfduration = 80 ; Set minimum DTMF duration in ms (default 80 ms) 37 | ; If we get shorter DTMF messages, these will be 38 | ; changed to the minimum duration 39 | ;maxcalls = 10 ; Maximum amount of calls allowed. 40 | ;maxload = 0.9 ; Asterisk stops accepting new calls if the 41 | ; load average exceed this limit. 42 | ;maxfiles = 1000 ; Maximum amount of openfiles. 43 | ;minmemfree = 1 ; In MBs, Asterisk stops accepting new calls if 44 | ; the amount of free memory falls below this 45 | ; watermark. 46 | ;cache_record_files = yes ; Cache recorded sound files to another 47 | ; directory during recording. 48 | ;record_cache_dir = /tmp ; Specify cache directory (used in conjunction 49 | ; with cache_record_files). 50 | ;transmit_silence = yes ; Transmit silence while a channel is in a 51 | ; waiting state, a recording only state, or 52 | ; when DTMF is being generated. Note that the 53 | ; silence internally is generated in raw signed 54 | ; linear format. This means that it must be 55 | ; transcoded into the native format of the 56 | ; channel before it can be sent to the device. 57 | ; It is for this reason that this is optional, 58 | ; as it may result in requiring a temporary 59 | ; codec translation path for a channel that may 60 | ; not otherwise require one. 61 | ;transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of 62 | ; directly. 63 | ;runuser = asterisk ; The user to run as. 64 | ;rungroup = asterisk ; The group to run as. 65 | ;lightbackground = yes ; If your terminal is set for a light-colored 66 | ; background. 67 | ;forceblackbackground = yes ; Force the background of the terminal to be 68 | ; black, in order for terminal colors to show 69 | ; up properly. 70 | ;defaultlanguage = en ; Default language 71 | documentation_language = en_US ; Set the language you want documentation 72 | ; displayed in. Value is in the same format as 73 | ; locale names. 74 | ;hideconnect = yes ; Hide messages displayed when a remote console 75 | ; connects and disconnects. 76 | ;lockconfdir = no ; Protect the directory containing the 77 | ; configuration files (/etc/asterisk) with a 78 | ; lock. 79 | ;stdexten = gosub ; How to invoke the extensions.conf stdexten. 80 | ; macro - Invoke the stdexten using a macro as 81 | ; done by legacy Asterisk versions. 82 | ; gosub - Invoke the stdexten using a gosub as 83 | ; documented in extensions.conf.sample. 84 | ; Default gosub. 85 | ;live_dangerously = no ; Enable the execution of 'dangerous' dialplan 86 | ; functions from external sources (AMI, 87 | ; etc.) These functions (such as SHELL) are 88 | ; considered dangerous because they can allow 89 | ; privilege escalation. 90 | ; Default no 91 | ;entityid=00:11:22:33:44:55 ; Entity ID. 92 | ; This is in the form of a MAC address. 93 | ; It should be universally unique. 94 | ; It must be unique between servers communicating 95 | ; with a protocol that uses this value. 96 | ; This is currently is used by DUNDi and 97 | ; Exchanging Device and Mailbox State 98 | ; using protocols: XMPP, Corosync and PJSIP. 99 | ;rtp_pt_dynamic = 96 ; Normally the Dynamic RTP Payload Type numbers 100 | ; are 96-127, which allow 32 formats. When you 101 | ; use more and receive the message "No Dynamic 102 | ; RTP mapping available", extend the dynamic 103 | ; range by going for 35 (or 0) instead of 96. 104 | ; This allows 29 (or 64) more formats. 96 is the 105 | ; default because any number below might be 106 | ; rejected by a remote implementation; although 107 | ; no such broken implementation is known, yet. 108 | 109 | ; Changing the following lines may compromise your security. 110 | ;[files] 111 | ;astctlpermissions = 0660 112 | ;astctlowner = root 113 | ;astctlgroup = apache 114 | ;astctl = asterisk.ctl 115 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/calendar.conf: -------------------------------------------------------------------------------- 1 | ;[calendar1] 2 | ;type = ical ; type of calendar--currently supported: ical, caldav, exchange, or ews 3 | ;url = https://example.com/home/jdoe/Calendar/ ; URL to shared calendar (Zimbra example) 4 | ;user = jdoe ; web username 5 | ;secret = supersecret ; web password 6 | ;refresh = 15 ; refresh calendar every n minutes 7 | ;timeframe = 60 ; number of minutes of calendar data to pull for each refresh period 8 | ; ; should always be >= refresh 9 | ; 10 | ; You can set up res_calendar to execute a call upon an upcoming busy status 11 | ; The following fields are available from the ${CALENDAR_EVENT()} dialplan function: 12 | ; 13 | ; summary : The VEVENT Summary property or Exchange subject 14 | ; description : The text description of the vent 15 | ; organizer : The organizer of the event 16 | ; location : The location field of the event 17 | ; calendar : The name of the calendar tied to the event 18 | ; uid : The unique ID for this event 19 | ; start : Start time of the event 20 | ; end : The end time of the event 21 | ; busystate : 0=FREE, 1=TENTATIVE, 2=BUSY 22 | ; 23 | ;autoreminder = 10 ; Override event-defined reminder before each busy status (in mins) 24 | ; 25 | ;channel = SIP/60001 ; Channel to dial 26 | ;context = default ; Context to connect to on answer 27 | ;extension = 123 ; Extension to connect to on answer 28 | ; 29 | ; or 30 | ; 31 | ;app = Playback ; Application to execute on answer (instead of context/extension) 32 | ;appdata = tt-weasels ; Data part of application to execute on answer 33 | ; 34 | ;waittime = 30 ; How long to wait for an answer, defaults to 30 seconds 35 | ; 36 | ; Channel variables can be set on the notification channel. The format is 37 | ; setvar=name=value. Variable subsitution is done on the value to allow the use of dialplan 38 | ; functions like CALENDAR_EVENT. The variables are set in order, so one can use the value 39 | ; of earlier variables in the definition of later ones. 40 | ; 41 | ;setvar = CALLERID(name)=${CALENDAR_EVENT(summary)} 42 | 43 | ;[calendar2] 44 | ; Note: Support for Exchange Server 2003 45 | ; 46 | ;type = exchange ; type of calendar--currently supported: ical, caldav, exchange, or ews 47 | ;url = https://example.com/exchange/jdoe ; URL to MS Exchange OWA for user (usually includes exchange/user) 48 | ;user = jdoe ; Exchange username 49 | ;secret = mysecret ; Exchange password 50 | ;refresh = 15 ; refresh calendar every n minutes 51 | ;timeframe = 60 ; number of minutes of calendar data to pull for each refresh period 52 | ; ; should always be >= refresh 53 | ; 54 | ; You can set up res_calendar to execute a call upon an upcoming busy status 55 | ;autoreminder = 10 ; Override event-defined reminder before each busy status (in mins) 56 | ; 57 | ;channel = SIP/1234 ; Channel to dial 58 | ;context = default ; Context to connect to on answer 59 | ;extension = 1234 ; Extension to connect to on answer 60 | ; 61 | ; or 62 | ; 63 | ;[calendar3] 64 | ; Note: Support for Exchange Server 2007+ 65 | ; 66 | ;type = ews ; type of calendar--currently supported: ical, caldav, exchange, or ews 67 | ;url = https://example.com/ews/Exchange.asmx ; URL to MS Exchange EWS 68 | ;user = jdoe ; Exchange username 69 | ;secret = mysecret ; Exchange password 70 | ;refresh = 15 ; refresh calendar every n minutes 71 | ;timeframe = 60 ; number of minutes of calendar data to pull for each refresh period 72 | ; ; should always be >= refresh 73 | ; 74 | ; You can set up res_calendar to execute a call upon an upcoming busy status 75 | ;autoreminder = 10 ; Override event-defined reminder before each busy status (in mins) 76 | ; 77 | ;channel = SIP/1234 ; Channel to dial 78 | ;context = default ; Context to connect to on answer 79 | ;extension = 1234 ; Extension to connect to on answer 80 | ; 81 | ; or 82 | ; 83 | ;app = Playback ; Application to execute on answer (instead of context/extension) 84 | ;appdata = tt-weasels ; Data part of application to execute on answer 85 | ; 86 | ;waittime = 30 ; How long to wait for an answer, defaults to 30 seconds 87 | 88 | ;[calendar4] 89 | ;type = caldav ; type of calendar--currently supported: ical, caldav, exchange, or ews 90 | ;url = https://www.google.com/calendar/dav/username@gmail.com/events/ ; Main GMail calendar (the trailing slash is significant!) 91 | ;user = jdoe@gmail.com ; username 92 | ;secret = mysecret ; password 93 | ;refresh = 15 ; refresh calendar every n minutes 94 | ;timeframe = 60 ; number of minutes of calendar data to pull for each refresh period 95 | ; ; should always be >= refresh 96 | ; 97 | ; You can set up res_calendar to execute a call upon an upcoming busy status 98 | ;autoreminder = 10 ; Override event-defined reminder before each busy status (in mins) 99 | ; 100 | ;channel = SIP/1234 ; Channel to dial 101 | ;context = default ; Context to connect to on answer 102 | ;extension = 1234 ; Extension to connect to on answer 103 | ; 104 | ; or 105 | ; 106 | ;app = Playback ; Application to execute on answer (instead of context/extension) 107 | ;appdata = tt-weasels ; Data part of application to execute on answer 108 | ; 109 | ;waittime = 30 ; How long to wait for an answer, defaults to 30 seconds 110 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cdr_adaptive_odbc.conf: -------------------------------------------------------------------------------- 1 | ; The point of this module is to allow you log whatever you like in terms of 2 | ; the CDR variables. Do you want to log uniqueid? Then simply ensure that 3 | ; your table has that column. If you don't want the column, ensure that it 4 | ; does not exist in the table structure. If you'd like to call uniqueid 5 | ; something else in your table, simply provide an alias in the configuration 6 | ; file that maps the standard CDR field name (uniqueid) to whatever column 7 | ; name you like. Perhaps you'd like some extra CDR values logged that aren't 8 | ; in the standard repertoire of CDR variables (some that come to mind are 9 | ; certain values used for LCR: route, per_minute_cost, and per_minute_price). 10 | ; Simply set those CDR variables in your dialplan, i.e. Set(CDR(route)=27), 11 | ; ensure that a corresponding column exists in your table, and cdr_adaptive_odbc 12 | ; will do the rest. 13 | ; 14 | ; This configuration defines the connections and tables for which CDRs may 15 | ; be populated. Each context specifies a different CDR table to be used. 16 | ; 17 | ; The columns in the tables should match up word-for-word (case-insensitive) 18 | ; to the CDR variables set in the dialplan. The natural advantage to this 19 | ; system is that beyond setting up the configuration file to tell you what 20 | ; tables to look at, there isn't anything more to do beyond creating the 21 | ; columns for the fields that you want, and populating the corresponding 22 | ; CDR variables in the dialplan. For the builtin variables only, you may 23 | ; create aliases for the real column name. 24 | ; 25 | ; Please note that after adding columns to the database, it is necessary to 26 | ; reload this module to get the new column names and types read. 27 | ; 28 | ; Warning: if you specify two contexts with exactly the same connection and 29 | ; table names, you will get duplicate records in that table. So be careful. 30 | ; 31 | 32 | ;[first] 33 | ;connection=mysql1 34 | ;table=cdr 35 | 36 | ;[second] 37 | ;connection=mysql1 38 | ;table=extracdr 39 | 40 | ;[third] 41 | ;connection=sqlserver 42 | ;table=AsteriskCDR 43 | ;schema=public ; for databases which support schemas 44 | ;usegmtime=yes ; defaults to no 45 | ;alias src => source 46 | ;alias channel => source_channel 47 | ;alias dst => dest 48 | ;alias dstchannel => dest_channel 49 | ; 50 | ; Any filter specified MUST match exactly or the CDR will be discarded 51 | ;filter accountcode => somename 52 | ;filter src => 123 53 | ; Negative filters are also now available 54 | ;filter src != 456 55 | ; 56 | ; Additionally, we now support setting static values per column. The reason 57 | ; for this is to allow different sections to specify different values for 58 | ; a certain named column, presumably separated by filters. 59 | ;static "Some Special Value" => identifier_code 60 | 61 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cdr_custom.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Mappings for custom config file 3 | ; 4 | ; To get your CSV output in a format tailored to your liking, uncomment the 5 | ; following lines and look for the output in the cdr-custom directory (usually 6 | ; in /var/log/asterisk). Depending on which mapping you uncomment, you may see 7 | ; Master.csv, Simple.csv, or both. 8 | ; 9 | ;[mappings] 10 | ;Master.csv => ${CSV_QUOTE(${CDR(clid)})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dst)})},${CSV_QUOTE(${CDR(dcontext)})},${CSV_QUOTE(${CDR(channel)})},${CSV_QUOTE(${CDR(dstchannel)})},${CSV_QUOTE(${CDR(lastapp)})},${CSV_QUOTE(${CDR(lastdata)})},${CSV_QUOTE(${CDR(start)})},${CSV_QUOTE(${CDR(answer)})},${CSV_QUOTE(${CDR(end)})},${CSV_QUOTE(${CDR(duration)})},${CSV_QUOTE(${CDR(billsec)})},${CSV_QUOTE(${CDR(disposition)})},${CSV_QUOTE(${CDR(amaflags)})},${CSV_QUOTE(${CDR(accountcode)})},${CSV_QUOTE(${CDR(uniqueid)})},${CSV_QUOTE(${CDR(userfield)})},${CDR(sequence)} 11 | ; 12 | ; High Resolution Time for billsec and duration fields 13 | ;Master.csv => ${CSV_QUOTE(${CDR(clid)})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dst)})},${CSV_QUOTE(${CDR(dcontext)})},${CSV_QUOTE(${CDR(channel)})},${CSV_QUOTE(${CDR(dstchannel)})},${CSV_QUOTE(${CDR(lastapp)})},${CSV_QUOTE(${CDR(lastdata)})},${CSV_QUOTE(${CDR(start)})},${CSV_QUOTE(${CDR(answer)})},${CSV_QUOTE(${CDR(end)})},${CSV_QUOTE(${CDR(duration,f)})},${CSV_QUOTE(${CDR(billsec,f)})},${CSV_QUOTE(${CDR(disposition)})},${CSV_QUOTE(${CDR(amaflags)})},${CSV_QUOTE(${CDR(accountcode)})},${CSV_QUOTE(${CDR(uniqueid)})},${CSV_QUOTE(${CDR(userfield)})},${CDR(sequence)} 14 | ;Simple.csv => ${CSV_QUOTE(${EPOCH})},${CSV_QUOTE(${CDR(src)})},${CSV_QUOTE(${CDR(dst)})} 15 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cdr_manager.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk Call Management CDR 3 | ; 4 | [general] 5 | enabled = no 6 | 7 | ; The "mappings" category can be used to define additional "key: value" pairs 8 | ; that will be included in the manager event. (after AccountCode, Source, etc). 9 | ; 10 | ; Each line like "varname => label" will include a "label: ${CDR(varname)}" 11 | ; in the generated event where ${CDR(varname)} its replaced with its value 12 | ; 13 | ;[mappings] 14 | ;rate => Rate 15 | ;carrier => Carrier 16 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cdr_mysql.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Note - if the database server is hosted on the same machine as the 3 | ; asterisk server, you can achieve a local Unix socket connection by 4 | ; setting hostname=localhost 5 | ; 6 | ; port and sock are both optional parameters. If hostname is specified 7 | ; and is not "localhost" (you can use address 127.0.0.1 instead), then 8 | ; cdr_mysql will attempt to connect to the port specified or use the 9 | ; default port. If hostname is not specified or if hostname is 10 | ; "localhost", then cdr_mysql will attempt to connect to the socket file 11 | ; specified by sock or otherwise use the default socket file. 12 | ; 13 | ;[global] 14 | ;hostname=database.host.name 15 | ;dbname=asteriskcdrdb 16 | ;table=cdr 17 | ;password=password 18 | ;user=asteriskcdruser 19 | ;port=3306 20 | ;sock=/tmp/mysql.sock 21 | ; By default CDRs are logged in the system's time zone 22 | ;cdrzone=UTC ; log CDRs with UTC 23 | ;usegmtime=yes ;log date/time in GMT. Default is "no" 24 | ;cdrzone=America/New_York ; or use a specific time zone 25 | ; 26 | ; If your system's locale differs from mysql database character set, 27 | ; cdr_mysql can damage non-latin characters in CDR variables. Use this 28 | ; option to protect your data. 29 | ;charset=koi8r 30 | ; 31 | ; Older versions of cdr_mysql set the calldate field to whenever the 32 | ; record was posted, rather than the start date of the call. This flag 33 | ; reverts to the old (incorrect) behavior. Note that you'll also need 34 | ; to comment out the "start=calldate" alias, below, to use this. 35 | ;compat=no 36 | ; 37 | ; ssl connections (optional) 38 | ;ssl_ca= 39 | ;ssl_cert= 40 | ;ssl_key= 41 | ; 42 | ; You may also configure the field names used in the CDR table. 43 | ; 44 | [columns] 45 | ;static "" => 46 | ;alias => 47 | alias start => calldate 48 | ;alias clid => 49 | ;alias src => 50 | ;alias dst => 51 | ;alias dcontext => 52 | ;alias channel => 53 | ;alias dstchannel => 54 | ;alias lastapp => 55 | ;alias lastdata => 56 | ;alias duration => 57 | ;alias billsec => 58 | ;alias disposition => 59 | ;alias amaflags => 60 | ;alias accountcode => 61 | ;alias userfield => 62 | ;alias uniqueid => 63 | 64 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cdr_odbc.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; cdr_odbc.conf 3 | ; 4 | 5 | ;[global] 6 | ;dsn=MySQL-test 7 | ;loguniqueid=yes 8 | ;dispositionstring=yes 9 | ;table=cdr ;"cdr" is default table name 10 | ;usegmtime=no ; set to "yes" to log in GMT 11 | ;hrtime=yes ;Enables microsecond accuracy with the billsec and duration fields 12 | ;newcdrcolumns=yes ; Enable logging of post-1.8 CDR columns (peeraccount, linkedid, sequence) 13 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cdr_pgsql.conf: -------------------------------------------------------------------------------- 1 | ; Sample Asterisk config file for CDR logging to PostgresSQL 2 | ; 3 | ; Note that you can use TLS connections to your database server. 4 | ; This is configured for your PostgreSQL client installation 5 | ; on this system (check for pgsessions.conf) 6 | 7 | [global] 8 | ;hostname=localhost 9 | ;port=5432 10 | ;dbname=asterisk 11 | ;password=password 12 | ;user=postgres 13 | ;appname=asterisk ; Postgres application_name support (optional). Whitespace not allowed. 14 | ;table=cdr ;SQL table where CDRs will be inserted 15 | ;encoding=LATIN9 ; Encoding of logged characters in Asterisk 16 | ;timezone=UTC ; Uncomment if you want datetime fields in UTC/GMT 17 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cdr_sqlite3_custom.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Mappings for custom config file 3 | ; 4 | [master] ; currently, only file "master.db" is supported, with only one table at a time. 5 | ;table => cdr 6 | ;columns => calldate, clid, dcontext, channel, dstchannel, lastapp, lastdata, duration, billsec, disposition, amaflags, accountcode, uniqueid, userfield, test 7 | ;values => '${CDR(start)}','${CDR(clid)}','${CDR(dcontext)}','${CDR(channel)}','${CDR(dstchannel)}','${CDR(lastapp)}','${CDR(lastdata)}','${CDR(duration)}','${CDR(billsec)}','${CDR(disposition)}','${CDR(amaflags)}','${CDR(accountcode)}','${CDR(uniqueid)}','${CDR(userfield)}','${CDR(test)}' 8 | 9 | ;Enable High Resolution Times for billsec and duration fields 10 | ;values => '${CDR(start)}','${CDR(clid)}','${CDR(dcontext)}','${CDR(channel)}','${CDR(dstchannel)}','${CDR(lastapp)}','${CDR(lastdata)}','${CDR(duration,f)}','${CDR(billsec,f)}','${CDR(disposition)}','${CDR(amaflags)}','${CDR(accountcode)}','${CDR(uniqueid)}','${CDR(userfield)}','${CDR(test)}' 11 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cdr_syslog.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk Call Detail Records (CDR) - Syslog Backend 3 | ; 4 | 5 | ; The cdr_syslog module writes CDRs using the facilities provided by syslog. 6 | ; 7 | ; Not only must you configure cdr_syslog from this file (cdr_syslog.conf) but 8 | ; you will also need to make changes to your /etc/syslog.conf before CDRs will 9 | ; be written to syslog. 10 | ; 11 | ; As an example, you can add the following to /etc/syslog.conf: 12 | ; 13 | ; local4.info /var/log/asterisk-cdr.log 14 | ; 15 | ; And then instruct syslogd to re-read the configuration file by sending it a 16 | ; HUP signal. On Linux this can be done like this: 17 | ; 18 | ; kill -HUP `cat /var/run/syslogd.pid` 19 | ; 20 | ; Finally, you will need to uncomment the [cdr-simple] section below, and restart 21 | ; Asterisk. When calls are placed, you should start seeing records appear in 22 | ; /var/log/asterisk-cdr.log. 23 | 24 | [general] 25 | ; Facility 26 | ; 27 | ; The 'facility' keyword specifies the syslog facility to use when writing out 28 | ; CDRs. 29 | ; 30 | ; Accepted values: One of the following: 31 | ; user, local0, local1, local2, local3, local4, local5, local6 32 | ; and local7. 33 | ; 34 | ; Note: Depending on your platform, the following may also be 35 | ; available: 36 | ; auth, authpriv, cron, daemon, ftp, kern, lpr, mail, 37 | ; news, syslog, and uucp. 38 | ; 39 | ; Default value: local4 40 | 41 | ;facility=local0 42 | 43 | ; Priority 44 | ; 45 | ; Use the 'priority' keyword to select which of the syslog priority levels to 46 | ; use when logging CDRs. 47 | ; 48 | ; Accepted values: One of the following: 49 | ; alert, crit, debug, emerg, err, info, notice, warning 50 | ; Default value: info 51 | 52 | ;priority=warn 53 | 54 | ; Note: The settings for 'facility' and 'priority' in the [general] section 55 | ; define the default values for all of the logging locations created 56 | ; below in separate sections. 57 | 58 | ;[cdr-master] 59 | ;facility = local5 60 | ;priority = debug 61 | 62 | ; Template 63 | ; 64 | ; The 'template' value allows you to specify a custom format for messages 65 | ; written to syslog. This is similar to how cdr_custom is configured. 66 | ; 67 | ; Allowed values: A diaplan style string. 68 | ; Default value: None, this is required field. 69 | ; 70 | ; Note: Because of the way substitution is done, the only meaningful values 71 | ; available when the record is logged are those available via the CDR() 72 | ; dialplan function. All other channel variables will be unavailable. 73 | 74 | ;template = "${CDR(clid)}","${CDR(src)}","${CDR(dst)}","${CDR(dcontext)}","${CDR(channel)}","${CDR(dstchannel)}","${CDR(lastapp)}","${CDR(lastdata)}","${CDR(start)}","${CDR(answer)}","${CDR(end)}","${CDR(duration)}","${CDR(billsec)}","${CDR(disposition)}","${CDR(amaflags)}","${CDR(accountcode)}","${CDR(uniqueid)}","${CDR(userfield)}" 75 | 76 | ; High Resolution Time for billsec and duration fields 77 | ;template = "${CDR(clid)}","${CDR(src)}","${CDR(dst)}","${CDR(dcontext)}","${CDR(channel)}","${CDR(dstchannel)}","${CDR(lastapp)}","${CDR(lastdata)}","${CDR(start)}","${CDR(answer)}","${CDR(end)}","${CDR(duration,f)}","${CDR(billsec,f)}","${CDR(disposition)}","${CDR(amaflags)}","${CDR(accountcode)}","${CDR(uniqueid)}","${CDR(userfield)}" 78 | ;[cdr-simple] 79 | 80 | ; Since we don't specify a facility or priority for this logging location, the 81 | ; records will use the defaults specified in the [general] section. 82 | 83 | ;template = "We received a call from ${CDR(src)}" 84 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cdr_tds.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk Call Detail Records (CDR) - FreeTDS Backend 3 | ; 4 | 5 | ;[global] 6 | 7 | ; Connection 8 | ; 9 | ; Use the 'connection' keyword to specify one of the instance names from your 10 | ; 'freetds.conf' file. Note that 'freetds.conf' is not an Asterisk 11 | ; configuration file, but one specific to the FreeTDS library. See the FreeTDS 12 | ; documentation on 'freetds.conf' for more information: 13 | ; 14 | ; http://www.freetds.org/userguide/freetdsconf.htm 15 | ; 16 | ; Accepted values: One of the connections specified in freetds.conf 17 | 18 | ;connection=ConnectionFromFreeTDSConf 19 | 20 | ; Database Name 21 | ; 22 | ; The 'dbname' keyword specifies the database name to use when logging CDRs. 23 | ; 24 | ; Accepted values: Any valid database name 25 | 26 | ;dbname=AsteriskCDRs 27 | 28 | ; Database Table Name 29 | ; 30 | ; The 'table' keyword identifies which database table is used to log CDRs. 31 | ; 32 | ; Accepted value: Any valid table name 33 | ; Default value: If not specified, a table named 'cdr' is assumed 34 | 35 | ;table=cdr 36 | 37 | ; Credentials 38 | ; 39 | ; The 'username' and 'password' keywords specify the user credentials that 40 | ; Asterisk should use when connecting to the database. 41 | ; 42 | ; Accepted value: Any valid username and password 43 | 44 | ;username=mangUsr 45 | ;password= 46 | 47 | ; Language 48 | ; 49 | ; The 'language' keyword changes the language which are used for error and 50 | ; information messages returned by SQL Server. Each database and user has their 51 | ; own default value, and this default can be overriden here. 52 | ; 53 | ; Accepted value: Any language installed on the target SQL Server. 54 | ; Default value: us_english 55 | 56 | ;language=us_english 57 | 58 | ; Character Set 59 | ; 60 | ; The 'charset' setting is used to change the character set used when connecting 61 | ; to the database server. Each database and database user has their own 62 | ; character set setting, and this default can be overriden here. 63 | ; 64 | ; Accepted value: Any valid character set available on the target SQL server. 65 | ; Default value: iso_1 66 | 67 | ;charset=BIG5 68 | 69 | ; High Resolution Times 70 | ; 71 | ; The 'hrtime' setting is used to store high resolution (sub second) times for 72 | ; billsec and duration fields. 73 | ; 74 | ; Accepted value: true or false 75 | ; Default value: false 76 | 77 | ;hrtime=false 78 | 79 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cel.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk Channel Event Logging (CEL) 3 | ; 4 | 5 | ; Channel Event Logging is a mechanism to provide fine-grained event information 6 | ; that can be used to generate billing information. Such event information can 7 | ; be recorded to various backend modules. 8 | ; 9 | 10 | [general] 11 | 12 | ; CEL Activation 13 | ; 14 | ; Use the 'enable' keyword to turn CEL on or off. 15 | ; 16 | ; Accepted values: yes and no 17 | ; Default value: no 18 | 19 | ;enable=yes 20 | 21 | ; Application Tracking 22 | ; 23 | ; Use the 'apps' keyword to specify the list of applications for which you want 24 | ; to receive CEL events. This is a comma separated list of Asterisk dialplan 25 | ; applications, such as Dial, Queue, and Park. 26 | ; 27 | ; Accepted values: A comma separated list of Asterisk dialplan applications 28 | ; Default value: none 29 | ; 30 | ; Note: You may also use 'all' which will result in CEL events being reported 31 | ; for all Asterisk applications. This may affect Asterisk's performance 32 | ; significantly. 33 | 34 | apps=dial,park 35 | 36 | ; Event Tracking 37 | ; 38 | ; Use the 'events' keyword to specify the list of events which you want to be 39 | ; raised when they occur. This is a comma separated list of the values in the 40 | ; table below. 41 | ; 42 | ; Accepted values: A comma separated list of one or more of the following: 43 | ; ALL -- Generate entries on all events 44 | ; CHAN_START -- The time a channel was created 45 | ; CHAN_END -- The time a channel was terminated 46 | ; ANSWER -- The time a channel was answered (ie, phone taken off-hook) 47 | ; HANGUP -- The time at which a hangup occurred 48 | ; BRIDGE_ENTER -- The time a channel was connected into a conference room 49 | ; BRIDGE_EXIT -- The time a channel was removed from a conference room 50 | ; APP_START -- The time a tracked application was started 51 | ; APP_END -- the time a tracked application ended 52 | ; PARK_START -- The time a call was parked 53 | ; PARK_END -- Unpark event 54 | ; BLINDTRANSFER -- When a blind transfer is initiated 55 | ; ATTENDEDTRANSFER -- When an attended transfer is initiated 56 | ; PICKUP -- This channel picked up the specified channel 57 | ; FORWARD -- This channel is being forwarded somewhere else 58 | ; LINKEDID_END -- The last channel with the given linkedid is retired 59 | ; USER_DEFINED -- Triggered from the dialplan, and has a name given by the 60 | ; user 61 | ; LOCAL_OPTIMIZE -- A local channel pair is optimizing away. 62 | ; 63 | ; Default value: none 64 | ; (Track no events) 65 | 66 | events=APP_START,CHAN_START,CHAN_END,ANSWER,HANGUP,BRIDGE_ENTER,BRIDGE_EXIT 67 | 68 | ; Date Format 69 | ; 70 | ; Use the 'dateformat' keyword to specify the date format used when CEL events 71 | ; are raised. 72 | ; 73 | ; Accepted values: A strftime format string (see man strftime) 74 | ; 75 | ; Example: "%F %T" 76 | ; -> This gives the date and time in the format "2009-06-23 17:02:35" 77 | ; 78 | ; If this option is not specified, the default format is "." 79 | ; since epoch. The microseconds field will always be 6 digits in length, meaning it 80 | ; may have leading zeros. 81 | ; 82 | ;dateformat = %F %T 83 | 84 | ; 85 | ; Asterisk Manager Interface (AMI) CEL Backend 86 | ; 87 | [manager] 88 | 89 | ; AMI Backend Activation 90 | ; 91 | ; Use the 'enable' keyword to turn CEL logging to the Asterisk Manager Interface 92 | ; on or off. 93 | ; 94 | ; Accepted values: yes and no 95 | ; Default value: no 96 | ;enabled=yes 97 | 98 | ; Use 'show_user_defined' to put "USER_DEFINED" in the EventName header, 99 | ; instead of (by default) just putting the user defined event name there. 100 | ; When enabled the UserDefType header is added for user defined events to 101 | ; provide the user defined event name. 102 | ; 103 | ;show_user_defined=yes 104 | 105 | ; 106 | ; RADIUS CEL Backend 107 | ; 108 | [radius] 109 | ; 110 | ; Log date/time in GMT 111 | ;usegmtime=yes 112 | ; 113 | ; Set this to the location of the radiusclient-ng configuration file 114 | ; The default is /etc/radiusclient-ng/radiusclient.conf 115 | ;radiuscfg => /usr/local/etc/radiusclient-ng/radiusclient.conf 116 | ; 117 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cel_custom.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk Channel Event Logging (CEL) - Custom CSV Backend 3 | ; 4 | 5 | ; This is the configuration file for the customizable CSV backend for CEL 6 | ; logging. 7 | ; 8 | ; In order to create custom CSV logs for CEL, uncomment the template below 9 | ; (Master.csv) and start Asterisk. Once CEL events are generated, a file will 10 | ; appear in the following location: 11 | ; 12 | ; /var/log/asterisk/cel-custom/Master.csv 13 | ; 14 | ; (Note that /var/log/asterisk is the default and may differ on your system) 15 | ; 16 | ; You can also create more than one template if desired. All logs will appear 17 | ; in the cel-custom directory under your Asterisk logs directory. 18 | ; 19 | 20 | ; 21 | ; Within a mapping, use the CALLERID() and CHANNEL() functions to retrieve 22 | ; details from the CEL event. There are also a few variables created by this 23 | ; module that can be used in a mapping: 24 | ; 25 | ; eventtype - The name of the CEL event. 26 | ; eventtime - The timestamp of the CEL event. 27 | ; eventenum - Like eventtype but is "USER_DEFINED" for a user defined event. 28 | ; userdeftype - User defined event type name from CELGenUserEvent(). 29 | ; eventextra - Extra data included with this CEL event, typically along with 30 | ; an event of type USER_DEFINED from CELGenUserEvent(). 31 | ; BRIDGEPEER - Bridged peer channel name at the time of the CEL event. 32 | ; CHANNEL(peer) could also be used. 33 | ; 34 | [mappings] 35 | ;Master.csv => ${CSV_QUOTE(${eventtype})},${CSV_QUOTE(${eventtime})},${CSV_QUOTE(${CALLERID(name)})},${CSV_QUOTE(${CALLERID(num)})},${CSV_QUOTE(${CALLERID(ANI)})},${CSV_QUOTE(${CALLERID(RDNIS)})},${CSV_QUOTE(${CALLERID(DNID)})},${CSV_QUOTE(${CHANNEL(exten)})},${CSV_QUOTE(${CHANNEL(context)})},${CSV_QUOTE(${CHANNEL(channame)})},${CSV_QUOTE(${CHANNEL(appname)})},${CSV_QUOTE(${CHANNEL(appdata)})},${CSV_QUOTE(${CHANNEL(amaflags)})},${CSV_QUOTE(${CHANNEL(accountcode)})},${CSV_QUOTE(${CHANNEL(uniqueid)})},${CSV_QUOTE(${CHANNEL(linkedid)})},${CSV_QUOTE(${BRIDGEPEER})},${CSV_QUOTE(${CHANNEL(userfield)})},${CSV_QUOTE(${userdeftype})},${CSV_QUOTE(${eventextra})} 36 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cel_odbc.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk Channel Event Logging (CEL) - Adaptive ODBC Backend 3 | ; 4 | 5 | ; General module options category. 6 | [general] 7 | ; Use 'show_user_defined' to put "USER_DEFINED" in the eventtype field, 8 | ; instead of (by default) just putting the user defined event name there. 9 | ; 10 | ;show_user_defined=yes 11 | 12 | ; This configuration defines the connections and tables for which CEL records 13 | ; may be populated. Each context specifies a different CEL table to be used. 14 | ; 15 | ; The columns in the tables should match up word-for-word (case-insensitive) to 16 | ; the CEL variables set in the dialplan. The natural advantage to this system 17 | ; is that beyond setting up the configuration file to tell you what tables to 18 | ; look at, there isn't anything more to do beyond creating the columns for the 19 | ; fields that you want, and populating the corresponding CEL variables in the 20 | ; dialplan. 21 | ; 22 | ; Please note that after adding columns to the database, it is necessary to 23 | ; reload this module to get the new column names and types read. 24 | ; 25 | ; Warning: if you specify two contexts with exactly the same connection and 26 | ; table names, you will get duplicate records in that table. So be careful. 27 | ; 28 | ; CEL FIELDS: 29 | ; eventtype 30 | ; CHANNEL_START = 1 31 | ; CHANNEL_END = 2 32 | ; HANGUP = 3 33 | ; ANSWER = 4 34 | ; APP_START = 5 35 | ; APP_END = 6 36 | ; BRIDGE_START = 7 37 | ; BRIDGE_END = 8 38 | ; CONF_START = 9 39 | ; CONF_END = 10 40 | ; PARK_START = 11 41 | ; PARK_END = 12 42 | ; BLINDTRANSFER = 13 43 | ; ATTENDEDTRANSFER = 14 44 | ; TRANSFER = 15 45 | ; HOOKFLASH = 16 46 | ; 3WAY_START = 17 47 | ; 3WAY_END = 18 48 | ; CONF_ENTER = 19 49 | ; CONF_EXIT = 20 50 | ; USER_DEFINED = 21 51 | ; LINKEDID_END = 22 52 | ; BRIDGE_UPDATE = 23 53 | ; PICKUP = 24 54 | ; FORWARD = 25 55 | ; eventtime (timeval, includes microseconds) 56 | ; userdeftype (set only if eventtype == USER_DEFINED) 57 | ; cid_name 58 | ; cid_num 59 | ; cid_ani 60 | ; cid_rdnis 61 | ; cid_dnid 62 | ; exten 63 | ; context 64 | ; channame 65 | ; appname 66 | ; appdata 67 | ; accountcode 68 | ; peeraccount 69 | ; uniqueid 70 | ; linkedid 71 | ; amaflags (an int) 72 | ; userfield 73 | ; peer 74 | ; extra 75 | 76 | ; The point of this module is to allow you log whatever you like in terms of the 77 | ; CEL variables. Do you want to log uniqueid? Then simply ensure that your 78 | ; table has that column. If you don't want the column, ensure that it does not 79 | ; exist in the table structure. If you'd like to call uniqueid something else 80 | ; in your table, simply provide an alias in this file that maps the standard CEL 81 | ; field name (uniqueid) to whatever column name you like. 82 | 83 | ;[first] 84 | ;connection=mysql1 85 | ;table=cel 86 | 87 | ;[second] 88 | ;connection=mysql1 89 | ;table=extracel 90 | 91 | ;[third] 92 | ;connection=sqlserver 93 | ;table=AsteriskCEL 94 | ;usegmtime=yes ; defaults to no 95 | ;allowleapsecond=no ; allow leap second in SQL column for eventtime, default yes. 96 | ;alias src => source 97 | ;alias channel => source_channel 98 | ;alias dst => dest 99 | ;alias dstchannel => dest_channel 100 | 101 | ; Any filter specified MUST match exactly or the event will be discarded 102 | ;filter accountcode => somename 103 | ;filter src => 123 104 | 105 | ; Additionally, we now support setting static values per column. Reason 106 | ; for this is to allow different sections to specify different values for 107 | ; a certain named column, presumably separated by filters. 108 | ;static "Some Special Value" => identifier_code 109 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cel_pgsql.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk Channel Event Logging (CEL) - PostgreSQL Backend 3 | ; 4 | 5 | ; Sample Asterisk config file for CEL logging to PostgreSQL 6 | ; 7 | ; CEL field names: 8 | ; 9 | ; eventtype 10 | ; CHANNEL_START = 1 11 | ; CHANNEL_END = 2 12 | ; HANGUP = 3 13 | ; ANSWER = 4 14 | ; APP_START = 5 15 | ; APP_END = 6 16 | ; BRIDGE_START = 7 17 | ; BRIDGE_END = 8 18 | ; CONF_START = 9 19 | ; CONF_END = 10 20 | ; PARK_START = 11 21 | ; PARK_END = 12 22 | ; BLINDTRANSFER = 13 23 | ; ATTENDEDTRANSFER = 14 24 | ; TRANSFER = 15 25 | ; HOOKFLASH = 16 26 | ; 3WAY_START = 17 27 | ; 3WAY_END = 18 28 | ; CONF_ENTER = 19 29 | ; CONF_EXIT = 20 30 | ; USER_DEFINED = 21 31 | ; LINKEDID_END = 22 32 | ; BRIDGE_UPDATE = 23 33 | ; PICKUP = 24 34 | ; FORWARD = 25 35 | ; eventtime (timeval, includes microseconds) 36 | ; userdeftype (set only if eventtype == USER_DEFINED) 37 | ; cid_name 38 | ; cid_num 39 | ; cid_ani 40 | ; cid_rdnis 41 | ; cid_dnid 42 | ; exten 43 | ; context 44 | ; channame 45 | ; appname 46 | ; appdata 47 | ; accountcode 48 | ; peeraccount 49 | ; uniqueid 50 | ; linkedid 51 | ; amaflags (an int) 52 | ; userfield 53 | ; peer 54 | ; extra 55 | 56 | [global] 57 | ; Use 'show_user_defined' to put "USER_DEFINED" in the eventtype field, 58 | ; instead of (by default) just putting the user defined event name there. 59 | ; 60 | ;show_user_defined=yes 61 | 62 | ;hostname=localhost 63 | ;port=5432 64 | ;dbname=asterisk 65 | ;password=password 66 | ;user=postgres 67 | ;table=cel ;SQL table where CEL's will be inserted 68 | ;appname=asterisk ; Postgres application_name support (optional). Whitespace not allowed. -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cel_sqlite3_custom.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk Channel Event Logging (CEL) - SQLite 3 Backend 3 | ; 4 | 5 | ; 6 | ; Mappings for sqlite3 config file 7 | ; 8 | ; Within a mapping, use the CALLERID() and CHANNEL() functions to retrieve 9 | ; details from the CEL event. There are also a few variables created by this 10 | ; module that can be used in a mapping: 11 | ; 12 | ; eventtype - The name of the CEL event. 13 | ; eventtime - The timestamp of the CEL event. 14 | ; eventenum - Like eventtype but is "USER_DEFINED" for a user defined event. 15 | ; userdeftype - User defined event type name from CELGenUserEvent(). 16 | ; eventextra - Extra data included with this CEL event, typically along with 17 | ; an event of type USER_DEFINED from CELGenUserEvent(). 18 | ; BRIDGEPEER - Bridged peer channel name at the time of the CEL event. 19 | ; CHANNEL(peer) could also be used. 20 | ; 21 | ;[master] ; currently, only file "master.db" is supported, with only one table at a time. 22 | ;table => cel 23 | ;columns => eventtype, eventtime, cidname, cidnum, cidani, cidrdnis, ciddnid, context, exten, channame, appname, appdata, amaflags, accountcode, uniqueid, userfield, peer, userdeftype, eventextra 24 | ;values => '${eventtype}','${eventtime}','${CALLERID(name)}','${CALLERID(num)}','${CALLERID(ANI)}','${CALLERID(RDNIS)}','${CALLERID(DNID)}','${CHANNEL(context)}','${CHANNEL(exten)}','${CHANNEL(channame)}','${CHANNEL(appname)}','${CHANNEL(appdata)}','${CHANNEL(amaflags)}','${CHANNEL(accountcode)}','${CHANNEL(uniqueid)}','${CHANNEL(userfield)}','${BRIDGEPEER}','${userdeftype}','${eventextra}' 25 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cel_tds.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk Channel Event Logging (CEL) - FreeTDS Backend 3 | ; 4 | 5 | ;[global] 6 | 7 | ; Connection 8 | ; 9 | ; Use the 'connection' keyword to specify one of the instance names from your 10 | ; 'freetds.conf' file. Note that 'freetds.conf' is not an Asterisk 11 | ; configuration file, but one specific to the FreeTDS library. See the FreeTDS 12 | ; documentation on 'freetds.conf' for more information: 13 | ; 14 | ; http://www.freetds.org/userguide/freetdsconf.htm 15 | ; 16 | ; Accepted values: One of the connections specified in freetds.conf 17 | 18 | ;connection=ConnectionFromFreeTDSConf 19 | 20 | ; Database Name 21 | ; 22 | ; The 'dbname' keyword specifies the database name to use when logging CEL 23 | ; records. 24 | ; 25 | ; Accepted values: Any valid database name 26 | 27 | ;dbname=MalicoHN 28 | 29 | ; Database Table Name 30 | ; 31 | ; The 'table' keyword identifies which database table is used to log CEL 32 | ; records. 33 | ; 34 | ; Accepted value: Any valid table name 35 | ; Default value: If not specified, a table named 'cel' is assumed 36 | 37 | ;table=cel 38 | 39 | ; Credentials 40 | ; 41 | ; The 'username' and 'password' keywords specify the user credentials that 42 | ; Asterisk should use when connecting to the database. 43 | ; 44 | ; Accepted value: Any valid username and password 45 | 46 | ;username=mangUsr 47 | ;password= 48 | 49 | ; Language 50 | ; 51 | ; The 'language' keyword changes the language which are used for error and 52 | ; information messages returned by SQL Server. Each database and user has their 53 | ; own default value, and this default can be overriden here. 54 | ; 55 | ; Accepted value: Any language installed on the target SQL Server. 56 | ; Default value: Server default 57 | 58 | ;language=us_english 59 | 60 | ; Character Set 61 | ; 62 | ; The 'charset' setting is used to change the character set used when connecting 63 | ; to the database server. Each database and database user has their own 64 | ; character set setting, and this default can be overriden here. 65 | ; 66 | ; Accepted value: Any valid character set available on the target server. 67 | ; Default value: Server setting 68 | 69 | ;charset=BIG5 70 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/chan_mobile.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; chan_mobile.conf 3 | ; configuration file for chan_mobile 4 | ; 5 | 6 | [general] 7 | interval=30 ; Number of seconds between trying to connect to devices. 8 | 9 | ; The following is a list of adapters we use. 10 | ; id must be unique and address is the bdaddr of the adapter from hciconfig. 11 | ; Each adapter may only have one device (headset or phone) connected at a time. 12 | ; Add an [adapter] entry for each adapter you have. 13 | 14 | [adapter] 15 | id=blue 16 | address=00:09:DD:60:01:A3 17 | ;forcemaster=yes ; attempt to force adapter into master mode. default is no. 18 | ;alignmentdetection=yes ; enable this if you sometimes get 'white noise' on asterisk side of the call 19 | ; its a bug in the bluetooth adapter firmware, enabling this will compensate for it. 20 | ; default is no. 21 | 22 | [adapter] 23 | id=dlink 24 | address=00:80:C8:35:52:78 25 | 26 | ; The following is a list of the devices we deal with. 27 | ; Every device listed below will be available for calls in and out of Asterisk. 28 | ; Each device needs an adapter=xxxx entry which determines which bluetooth adapter is used. 29 | ; Use the CLI command 'mobile search' to discover devices. 30 | ; Use the CLI command 'mobile show devices' to see device status. 31 | ; 32 | ; To place a call out through a mobile phone use Dial(Mobile/[device]/NNN.....) or Dial(Mobile/gn/NNN......) in your dialplan. 33 | ; To call a headset use Dial(Mobile/[device]). 34 | 35 | [LGTU550] 36 | address=00:E0:91:7F:46:44 ; the address of the phone 37 | port=4 ; the rfcomm port number (from mobile search) 38 | context=incoming-mobile ; dialplan context for incoming calls 39 | adapter=dlink ; adapter to use 40 | group=1 ; this phone is in channel group 1 41 | ;sms=no ; support SMS, defaults to yes 42 | ;nocallsetup=yes ; set this only if your phone reports that it supports call progress notification, but does not do it. Motorola L6 for example. 43 | 44 | [blackberry] 45 | address=00:60:57:32:7E:B2 46 | port=2 47 | context=incoming-mobile 48 | adapter=dlink 49 | group=1 50 | ;blackberry=yes ; set this if you are using a blackberry device 51 | 52 | [6310i] 53 | address=00:60:57:32:7E:B1 54 | port=13 55 | context=incoming-mobile 56 | adapter=dlink 57 | group=1 ; this phone is in channel group 1 also. 58 | 59 | [headset] 60 | address=00:0B:9E:11:AE:C6 61 | port=1 62 | type=headset ; This is a headset, not a Phone ! 63 | adapter=blue 64 | 65 | [headset1] 66 | address=00:0B:9E:11:74:A5 67 | port=1 68 | type=headset 69 | adapter=dlink 70 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cli.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk CLI configuration 3 | ; 4 | 5 | [startup_commands] 6 | ; 7 | ; Any commands listed in this section will get automatically executed 8 | ; when Asterisk starts as a daemon or foreground process (-c). 9 | ; 10 | ;sip set debug on = yes 11 | ;core set verbose 3 = yes 12 | ;core set debug 1 = yes 13 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/cli_permissions.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; CLI permissions configuration example for Asterisk 3 | ; 4 | ; All the users that you want to connect with asterisk using 5 | ; rasterisk, should have write/read access to the 6 | ; asterisk socket (asterisk.ctl). You could change the permissions 7 | ; of this file in 'asterisk.conf' config parameter: 'astctlpermissions' (0666) 8 | ; found on the [files] section. 9 | ; 10 | ; general options: 11 | ; 12 | ; default_perm = permit | deny 13 | ; This is the default permissions to apply for a user that 14 | ; does not has a permissions definided. 15 | ; 16 | ; user options: 17 | ; permit = | all ; allow the user to run 'command' | 18 | ; ; allow the user to run 'all' the commands 19 | ; deny = | all ; disallow the user to run 'command' | 20 | ; ; disallow the user to run 'all' commands. 21 | ; 22 | 23 | [general] 24 | 25 | default_perm=permit ; To leave asterisk working as normal 26 | ; we should set this parameter to 'permit' 27 | ; 28 | ; Follows the per-users permissions configs. 29 | ; 30 | ; This list is read in the sequence that is being written, so 31 | ; In this example the user 'eliel' is allow to run only the following 32 | ; commands: 33 | ; sip show peer 34 | ; core set debug 35 | ; core set verbose 36 | ; If the user is not specified, the default_perm option will be apply to 37 | ; every command. 38 | ; 39 | ; Notice that you can also use regular expressions to allow or deny access to a 40 | ; certain command like: 'core show application D*'. In this example the user will be 41 | ; allowed to view the documentation for all the applications starting with 'D'. 42 | ; Another regular expression could be: 'channel originate SIP/[0-9]* extension *' 43 | ; allowing the user to use 'channel originate' on a sip channel and with the 'extension' 44 | ; parameter and avoiding the use of the 'application' parameter. 45 | ; 46 | ; We can also use the templates syntax: 47 | ; [supportTemplate](!) 48 | ; deny=all 49 | ; permit=sip show ; all commands starting with 'sip show' will be allowed 50 | ; permit=core show 51 | ; 52 | ; You can specify permissions for a local group instead of a user, 53 | ; just put a '@' and we will know that is a group. 54 | ; IMPORTANT NOTE: Users permissions overwrite group permissions. 55 | ; 56 | ;[@adm] 57 | ;deny=all 58 | ;permit=sip 59 | ;permit=core 60 | ; 61 | ; 62 | ;[eliel] 63 | ;deny=all 64 | ;permit=sip show peer 65 | ;deny=sip show peers 66 | ;permit=core set 67 | ; 68 | ; 69 | ;User 'tommy' inherits from template 'supportTemplate': 70 | ; deny=all 71 | ; permit=sip show 72 | ; permit=core show 73 | ;[tommy](supportTemplate) 74 | ;permit=core set debug 75 | ;permit=dialplan show 76 | ; 77 | ; 78 | ;[mark] 79 | ;deny=all 80 | ;permit=all 81 | ; 82 | ; 83 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/config_test.conf: -------------------------------------------------------------------------------- 1 | ; Config to test config parsing 2 | ; global and item have values that differ from defaults 3 | ; global_defaults and item_defualts are to show all defaults are set 4 | ; there should be an option for every default type, and a custom type 5 | 6 | [global] 7 | intopt=-1 8 | uintopt=1 9 | timelenopt1=1ms 10 | timelenopt2=1s 11 | timelenopt3=1m 12 | timelenopt4=1h 13 | doubleopt=0.1 14 | sockaddropt=1.2.3.4:1234 15 | boolopt=true 16 | boolflag1=true 17 | boolflag2=false 18 | boolflag3=true 19 | deny=0.0.0.0/0 20 | permit=1.2.3.4/32 21 | codecopt=!all,ulaw,g729 22 | stropt=test 23 | customopt=yes 24 | 25 | [global_defaults] 26 | 27 | [item] 28 | intopt=-1 29 | uintopt=1 30 | timelenopt1=1 31 | timelenopt2=1 32 | timelenopt3=1 33 | timelenopt4=1 34 | doubleopt=0.1 35 | sockaddropt=1.2.3.4:1234 36 | boolopt=true 37 | boolflag1=true 38 | boolflag2=false 39 | boolflag3=true 40 | acldenyopt=0.0.0.0/0 41 | aclpermitopt=1.2.3.4/32 42 | codecopt=!all,ulaw,g729 43 | stropt=test 44 | customopt=yes 45 | 46 | [item_defaults] 47 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/console.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Configuration for chan_console, a cross-platform console channel driver. 3 | ; 4 | 5 | [general] 6 | 7 | ; Set this option to "yes" to enable automatically answering calls on the 8 | ; console. This is very useful if the console is used as an intercom. 9 | ; The default value is "no". 10 | ; 11 | ;autoanswer = no 12 | 13 | ; Set the default context to use for outgoing calls. This can be overridden by 14 | ; dialing some extension@context, unless the overridecontext option is enabled. 15 | ; The default is "default". 16 | ; 17 | ;context = default 18 | 19 | ; Set the default extension to use for outgoing calls. The default is "s". 20 | ; 21 | ;extension = s 22 | 23 | ; Set the default CallerID for created channels. 24 | ; 25 | ;callerid = MyName Here <(256) 428-6000> 26 | 27 | ; Set the default language for created channels. 28 | ; 29 | ;language = en 30 | 31 | ; If you set overridecontext to 'yes', then the whole dial string 32 | ; will be interpreted as an extension, which is extremely useful 33 | ; to dial SIP, IAX and other extensions which use the '@' character. 34 | ; The default is "no". 35 | ; 36 | ;overridecontext = no ; if 'no', the last @ will start the context 37 | ; if 'yes' the whole string is an extension. 38 | 39 | 40 | ; Default Music on Hold class to use when this channel is placed on hold in 41 | ; the case that the music class is not set on the channel with 42 | ; Set(CHANNEL(musicclass)=whatever) in the dialplan and the peer channel 43 | ; putting this one on hold did not suggest a class to use. 44 | ; 45 | ;mohinterpret=default 46 | 47 | ; ----------------------------- JITTER BUFFER CONFIGURATION -------------------------- 48 | ; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of an 49 | ; Console channel. Defaults to "no". An enabled jitterbuffer will 50 | ; be used only if the sending side can create and the receiving 51 | ; side can not accept jitter. The Console channel can't accept jitter, 52 | ; thus an enabled jitterbuffer on the receive Console side will always 53 | ; be used if the sending side can create jitter. 54 | 55 | ; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds. 56 | 57 | ; jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is 58 | ; resynchronized. Useful to improve the quality of the voice, with 59 | ; big jumps in/broken timestamps, usually sent from exotic devices 60 | ; and programs. Defaults to 1000. 61 | 62 | ; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a Console 63 | ; channel. Two implementations are currently available - "fixed" 64 | ; (with size always equals to jbmax-size) and "adaptive" (with 65 | ; variable size, actually the new jb of IAX2). Defaults to fixed. 66 | 67 | ; jbtargetextra = 40 ; This option only affects the jb when 'jbimpl = adaptive' is set. 68 | ; The option represents the number of milliseconds by which the new 69 | ; jitter buffer will pad its size. the default is 40, so without 70 | ; modification, the new jitter buffer will set its size to the jitter 71 | ; value plus 40 milliseconds. increasing this value may help if your 72 | ; network normally has low jitter, but occasionally has spikes. 73 | 74 | ; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no". 75 | ; ---------------------------------------------------------------------------------- 76 | 77 | 78 | ; 79 | ; Any configuration context defined beyond the [general] section configures 80 | ; specific devices for use. 81 | ; 82 | 83 | [default] 84 | input_device = default ; When configuring an input device and output device, 85 | output_device = default ; use the name that you see when you run the "console 86 | ; list available" CLI command. If you say "default", the 87 | ; system default input and output devices will be used. 88 | autoanswer = no 89 | context = default 90 | extension = s 91 | callerid = MyName Here <(256) 428-6000> 92 | language = en 93 | overridecontext = no 94 | mohinterpret = default 95 | active = yes ; This option should only be set for one console. 96 | ; It means that it is the active console to be 97 | ; used from the Asterisk CLI. 98 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/dbsep.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Configuration file for dbsep.cgi 3 | # 4 | # The purpose of this file is to provide realtime access to a database, 5 | # possibly through ODBC, without needing to load the ODBC drivers into 6 | # Asterisk, since there are several backend drivers which are rather 7 | # buggy. 8 | # 9 | # We accomplish this separation by using the res_config_curl realtime 10 | # driver to connect to a server running dbsep.cgi (or another, which 11 | # implements the same protocol). 12 | # 13 | # This file contains the information necessary to configure dbsep.cgi. 14 | # 15 | # 16 | # Once installed to a web server, you'll need to preload func_curl.so 17 | # and res_config_curl.so in modules.conf and configure extconfig.conf: 18 | # 19 | # voicemail => curl,http://server/path/to/dbsep.cgi/voicemail 20 | # sippeers => curl,http://server/path/to/dbsep.cgi/sippeers 21 | # 22 | 23 | # The Data Source Name, as specified by the Perl DBI module. 24 | # Typically, this will be along the lines of 'DBI:mysql:astdbname[:dbhostname]' or 'DBI:Pg:dbname=astdbname;hostname=dbhostname' 25 | dsn=somedsn 26 | 27 | # Connected database user 28 | dbuser=someuser 29 | 30 | # And its password 31 | dbpass=password 32 | 33 | # For most databases, this is fine. Set to 'no' for Sybase or MS SQL Server. 34 | backslash_is_escape=yes 35 | 36 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/dnsmgr.conf: -------------------------------------------------------------------------------- 1 | [general] 2 | ;enable=yes ; enable creation of managed DNS lookups 3 | ; default is 'no' 4 | ;refreshinterval=1200 ; refresh managed DNS lookups every seconds 5 | ; default is 300 (5 minutes) -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/dsp.conf: -------------------------------------------------------------------------------- 1 | [default] 2 | ; 3 | ; Length of sound (in milliseconds) before a period of silence is considered 4 | ; to be a change from talking to silence or a period of noise converts silence 5 | ; to talking. [default=256] 6 | ; 7 | ;silencethreshold=256 8 | 9 | ; DTMF Reverse Twist and Normal Twist is the difference in power between the row and column energies. 10 | ; 11 | ; Normal Twist is where the row energy is greater than the column energy. 12 | ; Reverse Twist is where the column energy is greater. 13 | ; 14 | ; Power level difference between frequencies for different Administrations/RPOAs 15 | ; Power Gain equiv 16 | ; normal reverse dB's 17 | ; AT&T(default) 6.31 2.51 8dB(normal), 4dB(reverse) 18 | ; NTT 3.16 3.16 Max. 5dB 19 | ; Danish 3.98 3.98 Max. 6dB 20 | ; Australian 10.0 10.0 Max. 10dB 21 | ; Brazilian 7.94 7.94 Max. 9dB 22 | ; ETSI 3.98 3.98 Max. 6dB 23 | 24 | ;previous version compatible AT&T values 25 | ; RADIO_RELAX disabled, and relaxdtmf=no 26 | ; 6.30 2.50 7.99dB(normal), 3.98dB(reverse) 27 | ; RADIO_RELAX disabled, and relaxdtmf=yes 28 | ; 6.30 4.00 7.99dB(normal), 6.02dB(reverse) 29 | ; RADIO_RELAX enabled, and relaxdtmf=no 30 | ; 6.30 2.50 7.99dB(normal), 3.984dB(reverse) 31 | ; RADIO_RELAX enabled, and relaxdtmf=yes 32 | ; 6.30 6.50 7.99dB(normal), 8.13dB(reverse) 33 | 34 | ;If you don't know what these mean, don't change them. 35 | ;dtmf_normal_twist=6.31 36 | ;dtmf_reverse_twist=2.51 37 | ;relax_dtmf_normal_twist=6.31 38 | ;relax_dtmf_reverse_twist=3.98 39 | 40 | ;successive number hits/misses of 12.75ms before a digit/nodigit is considered valid 41 | ;dtmf_hits_to_begin=2 42 | ;dtmf_misses_to_end=3 43 | 44 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/enum.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; ENUM Configuration for resolving phone numbers over DNS 3 | ; 4 | ; Sample config for Asterisk 5 | ; This file is reloaded at "module reload enum" in the CLI 6 | ; 7 | [general] 8 | ; 9 | ; The search list for domains may be customized. Domains are searched 10 | ; in the order they are listed here. 11 | ; 12 | search => e164.arpa 13 | ; 14 | ; If you'd like to use the E.164.org public ENUM registry in addition 15 | ; to the official e164.arpa one, uncomment the following line 16 | ; 17 | ;search => e164.org 18 | ; 19 | ; As there are more H323 drivers available you have to select to which 20 | ; drive a H323 URI will map. Default is "H323". 21 | ; 22 | h323driver => H323 23 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/extensions.ael: -------------------------------------------------------------------------------- 1 | 2 | context not-in-use { 3 | } 4 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/extensions.lua: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/festival.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Festival Configuration 3 | ; 4 | [general] 5 | ; 6 | ; Host which runs the festival server (default : localhost); 7 | ; 8 | ;host=localhost 9 | ; 10 | ; Port on host where the festival server runs (default : 1314) 11 | ; 12 | ;port=1314 13 | ; 14 | ; Use cache (yes, no - defaults to no) 15 | ; 16 | ;usecache=yes 17 | ; 18 | ; If usecache=yes, a directory to store waveform cache files. 19 | ; The cache is never cleared (yet), so you must take care of cleaning it 20 | ; yourself (just delete any or all files from the cache). 21 | ; THIS DIRECTORY *MUST* EXIST and must be writable from the asterisk process. 22 | ; Defaults to /tmp/ 23 | ; 24 | ;cachedir=/var/lib/asterisk/festivalcache/ 25 | ; 26 | ; Festival command to send to the server. 27 | ; Defaults to: (tts_textasterisk "%s" 'file)(quit)\n 28 | ; %s is replaced by the desired text to say. The command MUST end with a 29 | ; (quit) directive, or the cache handling mechanism will hang. Do not 30 | ; forget the \n at the end. 31 | ; 32 | ;festivalcommand=(tts_textasterisk "%s" 'file)(quit)\n 33 | ; 34 | ; 35 | 36 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/followme.conf: -------------------------------------------------------------------------------- 1 | ; Find-Me / Follow-Me Configuration File 2 | [general] 3 | ; 4 | featuredigittimeout=>5000 5 | ; The number of ms to wait for a digit input for the callee on whether to take the call or 6 | ; not before we consider them "done" entering digits. 7 | ; 8 | takecall=>1 9 | ; The global default keypress for the callee to take taking the current call. This can be 10 | ; a single digit or multiple digits. Default is "1". 11 | ; Note this string must not be a substring of declinecall. 12 | ; 13 | declinecall=>2 14 | ; The global default keypress for the callee to decline taking the current call. This can 15 | ; be a single digit or multiple digits. Default is "2". 16 | ; Note this string must not be a substring of takecall. 17 | ; 18 | call_from_prompt=>followme/call-from 19 | ; The global default for the 'Incoming call from' message. 20 | ; 21 | norecording_prompt=>followme/no-recording 22 | ; The global default for the 'You have an incoming call' message when the caller elects 23 | ; not to leave their name or the option isn't set for them to do so. 24 | ; 25 | options_prompt=>followme/options 26 | ; The global default for the 'Press 1 to accept this call or press 2 to decline it' message. 27 | ; 28 | pls_hold_prompt=>followme/pls-hold-while-try 29 | ; The global default for 'Please hold while we try and connect your call' message. 30 | ; 31 | status_prompt=>followme/status 32 | ; The global default for 'The party you're calling isn't at their desk' message. 33 | ; 34 | sorry_prompt=>followme/sorry 35 | ; The global default for 'I'm sorry, but we were unable to locate your party' message. 36 | ; 37 | ; 38 | [default] 39 | musicclass=>default 40 | ; The moh class that should be used for the caller while they are waiting to be connected. 41 | context=>default 42 | ; The context to dial the numbers from 43 | number=>01233456,25 44 | ; The a follow-me number to call. The format is: 45 | ; number=> [,[,]] 46 | ; You can specify as many of these numbers as you like. They will be dialed in the 47 | ; order that you specify them in the config file OR as specified with the order field 48 | ; on the number prompt. As you can see from the example, forked dialing of multiple 49 | ; numbers in the same step is supported with this application if you'd like to dial 50 | ; multiple numbers in the same followme step. 51 | ; 52 | ; The timeout value is the amount of time allowed between the time the dialing step 53 | ; starts and the callee answers. The callee then has until the timeout of the last 54 | ; step to make a choice on whether to take the call or not. That being the case, 55 | ; you may want to make the timeout on the last step longer to give enough time to 56 | ; make the choice to accept or not. 57 | takecall=>1 58 | ; The keypress for the callee to take taking the current call. This can be 59 | ; a single digit or multiple digits. Default is the global default. 60 | ; Note this string must not be a substring of declinecall. 61 | ; 62 | declinecall=>2 63 | ; The keypress for the callee to decline taking the current call. This can 64 | ; be a single digit or multiple digits. Default is the global default. 65 | ; Note this string must not be a substring of takecall. 66 | ; 67 | call_from_prompt=>followme/call-from 68 | ; The 'Incoming call from' message prompt. Default is the global default. 69 | ; 70 | norecording_prompt=>followme/no-recording 71 | ; The 'You have an incoming call' message prompt when the caller elects 72 | ; not to leave their name or the option isn't set for them to do so. Default 73 | ; is the global default. 74 | ; 75 | options_prompt=>followme/options 76 | ; The 'Press 1 to accept this call or press 2 to decline it' message prompt. 77 | ; Default is the global default. 78 | ; 79 | pls_hold_prompt=>followme/pls-hold-while-try 80 | ; The 'Please hold while we try and connect your call' message prompt. 81 | ; Default is the global default. 82 | ; 83 | status_prompt=>followme/status 84 | ; The 'The party you're calling isn't at their desk' message prompt. 85 | ; Default is the global default. 86 | ; 87 | sorry_prompt=>followme/sorry 88 | ; The 'I'm sorry, but we were unable to locate your party' message prompt. Default 89 | ; is the global default. 90 | 91 | 92 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/hep.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; res_hep Module configuration for Asterisk 3 | ; 4 | 5 | ; 6 | ; Note that this configuration file is consumed by res_hep, which is responsible 7 | ; for the HEPv3 protocol manipulation and managing the connection to the Homer 8 | ; capture server. Additional modules provide specific messages to be sent to 9 | ; the Homer server: 10 | ; - res_hep_pjsip: Send SIP messages transmitted/received by the PJSIP stack 11 | ; - res_hep_rtcp: Send RTCP information (all channels) 12 | ; 13 | 14 | ; All settings are currently set in the general section. 15 | [general] 16 | enabled = no ; Enable/disable forwarding of packets to a 17 | ; HEP server. Default is "yes". 18 | capture_address = 192.168.1.1:9061 ; The address of the HEP capture server. 19 | capture_password = foo ; If specified, the authorization passsword 20 | ; for the HEP server. If not specified, no 21 | ; authorization password will be sent. 22 | capture_id = 1234 ; A unique integer identifier for this 23 | ; server. This ID will be embedded sent 24 | ; with each packet from this server. 25 | uuid_type = call-id ; Specify the preferred source for the Homer 26 | ; correlation UUID. Valid options are: 27 | ; - 'call-id' for the PJSIP or chan_sip SIP 28 | ; Call-ID 29 | ; - 'channel' for the Asterisk channel name 30 | ; Note: If 'call-id' is specified but the 31 | ; channel is not PJSIP or chan_sip then the 32 | ; Asterisk channel name will be used instead. 33 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/http.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk Builtin mini-HTTP server 3 | ; 4 | ; 5 | ; Note about Asterisk documentation: 6 | ; If Asterisk was installed from a tarball, then the HTML documentation should 7 | ; be installed in the static-http/docs directory which is 8 | ; (/var/lib/asterisk/static-http/docs) on linux by default. If the Asterisk 9 | ; HTTP server is enabled in this file by setting the "enabled", "bindaddr", 10 | ; and "bindport" options, then you should be able to view the documentation 11 | ; remotely by browsing to: 12 | ; http://:/static/docs/index.html 13 | ; 14 | [general] 15 | ; 16 | ; The name of the server, advertised in both the Server field in HTTP 17 | ; response message headers, as well as the
element in certain HTTP 18 | ; response message bodies. If not furnished here, "Asterisk/{version}" will be 19 | ; used as a default value for the Server header field and the
20 | ; element. Setting this property to a blank value will result in the omission 21 | ; of the Server header field from HTTP response message headers and the 22 | ;
element from HTTP response message bodies. 23 | ; 24 | servername=Asterisk 25 | ; 26 | ; Whether HTTP/HTTPS interface is enabled or not. Default is no. 27 | ; This also affects manager/rawman/mxml access (see manager.conf) 28 | ; 29 | enabled=yes 30 | ; 31 | ; Address to bind to, both for HTTP and HTTPS. You MUST specify 32 | ; a bindaddr in order for the HTTP server to run. There is no 33 | ; default value. 34 | ; 35 | bindaddr=0.0.0.0 36 | ; 37 | ; Port to bind to for HTTP sessions (default is 8088) 38 | ; 39 | bindport=8088 40 | ; 41 | ; Prefix allows you to specify a prefix for all requests 42 | ; to the server. The default is blank. If uncommented 43 | ; all requests must begin with /asterisk 44 | ; 45 | ;prefix=asterisk 46 | ; 47 | ; sessionlimit specifies the maximum number of httpsessions that will be 48 | ; allowed to exist at any given time. (default: 100) 49 | ; 50 | ;sessionlimit=100 51 | ; 52 | ; session_inactivity specifies the number of milliseconds to wait for 53 | ; more data over the HTTP connection before closing it. 54 | ; 55 | ; Default: 30000 56 | ;session_inactivity=30000 57 | ; 58 | ; session_keep_alive specifies the number of milliseconds to wait for 59 | ; the next HTTP request over a persistent connection. 60 | ; 61 | ; Set to 0 to disable persistent HTTP connections. 62 | ; Default: 15000 63 | ;session_keep_alive=15000 64 | ; 65 | ; Whether Asterisk should serve static content from static-http 66 | ; Default is no. 67 | ; 68 | enablestatic=yes 69 | ; 70 | ; Redirect one URI to another. This is how you would set a 71 | ; default page. 72 | ; Syntax: redirect= 73 | ; For example, if you are using the Asterisk-gui, 74 | ; it is convenient to enable the following redirect: 75 | ; 76 | redirect = / /static/index.html 77 | ; 78 | ; HTTPS support. In addition to enabled=yes, you need to 79 | ; explicitly enable tls, define the port to use, 80 | ; and have a certificate somewhere. 81 | ;tlsenable=yes ; enable tls - default no. 82 | ;tlsbindaddr=0.0.0.0:8089 ; address and port to bind to - default is bindaddr and port 8089. 83 | ; 84 | ;tlscertfile= ; path to the certificate file (*.pem) only. 85 | ;tlsprivatekey= ; path to private key file (*.pem) only. 86 | ; If no path is given for tlscertfile or tlsprivatekey, default is to look in current 87 | ; directory. If no tlsprivatekey is given, default is to search tlscertfile for private key. 88 | ; 89 | ; To produce a certificate you can e.g. use openssl. This places both the cert and 90 | ; private in same .pem file. 91 | ; openssl req -new -x509 -days 365 -nodes -out /tmp/foo.pem -keyout /tmp/foo.pem 92 | ; 93 | ; tlscipher= ; The list of allowed ciphers 94 | ; ; if none are specified the following cipher 95 | ; ; list will be used instead: 96 | ; ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384: 97 | ; ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256: 98 | ; kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA: 99 | ; ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384: 100 | ; ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA: 101 | ; DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA: 102 | ; AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA: 103 | ; AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH: 104 | ; !EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA 105 | ; 106 | ; tlsdisablev1=yes ; Disable TLSv1 support - if not set this defaults to "yes" 107 | ; tlsdisablev11=yes ; Disable TLSv1.1 support - if not set this defaults to "no" 108 | ; tlsdisablev12=yes ; Disable TLSv1.2 support - if not set this defaults to "no" 109 | ; 110 | ; tlsservercipherorder=yes ; Use the server preference order instead of the client order 111 | ; ; Defaults to "yes" 112 | ; 113 | ; The post_mappings section maps URLs to real paths on the filesystem. If a 114 | ; POST is done from within an authenticated manager session to one of the 115 | ; configured POST mappings, then any files in the POST will be placed in the 116 | ; configured directory. 117 | ; 118 | ;[post_mappings] 119 | ; 120 | ; NOTE: You need a valid HTTP AMI mansession_id cookie with the manager 121 | ; config permission to POST files. 122 | ; 123 | ; In this example, if the prefix option is set to "asterisk", then using the 124 | ; POST URL: /asterisk/uploads will put files in /var/lib/asterisk/uploads/. 125 | ;uploads = /var/lib/asterisk/uploads/ 126 | ; 127 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/iaxprov.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; IAX2 Provisioning Information 3 | ; 4 | ; Contains provisioning information for templates and for specific service 5 | ; entries. 6 | ; 7 | ; Templates provide a group of settings from which provisioning takes place. 8 | ; A template may be based upon any template that has been specified before 9 | ; it. If the template that an entry is based on is not specified then it is 10 | ; presumed to be 'default' (unless it is the first of course). 11 | ; 12 | ; Templates which begin with 'si-' are used for provisioning units with 13 | ; specific service identifiers. For example the entry "si-000364000126" 14 | ; would be used when the device with the corresponding service identifier of 15 | ; "000364000126" attempts to register or make a call. 16 | ; 17 | [default] 18 | ; 19 | ; The port number the device should use to bind to. The default is 4569. 20 | ; 21 | ;port=4569 22 | ; 23 | ; server is our PRIMARY server for registration and placing calls 24 | ; 25 | ;server=192.168.69.3 26 | ; 27 | ; altserver is the BACKUP server for registration and placing calls in the 28 | ; event the primary server is unavailable. 29 | ; 30 | ;altserver=192.168.69.4 31 | ; 32 | ; port is the port number to use for IAX2 outbound. The connections to the 33 | ; server and altserver -- default is of course 4569. 34 | ;serverport=4569 35 | ; 36 | ; language is the preferred language for the device 37 | ; 38 | ;language=en 39 | ; 40 | ; codec is the requested codec. The iaxy supports ulaw and adpcm 41 | ; 42 | codec=ulaw 43 | ; 44 | ; flags is a comma separated list of flags which the device should 45 | ; use and may contain any of the following keywords: 46 | ; 47 | ; "register" - Register with server 48 | ; "secure" - Do not accept calls / provisioning not originated by the server 49 | ; "heartbeat" - Generate status packets on port 9999 sent to 255.255.255.255 50 | ; "debug" - Output extra debugging to port 9999 51 | ; 52 | ; Note that use can use += and -= to adjust parameters 53 | ; 54 | flags=register,heartbeat 55 | ; 56 | ; See https://wiki.asterisk.org/wiki/display/AST/IP+Quality+of+Service for a description of this parameter. 57 | ;tos=ef 58 | ; 59 | ; Example iaxy provisioning 60 | ; 61 | ;[si-000364000126] 62 | ;user=iaxy 63 | ;pass=bitsy 64 | ;flags += debug 65 | 66 | ;[si-000364000127] 67 | ;user=iaxy2 68 | ;pass=bitsy2 69 | ;template=si-000364000126 70 | ;flags += debug 71 | 72 | ; 73 | ;[*] 74 | ; 75 | ; If specified, the '*' provisioning is used for all devices which do not 76 | ; have another provisioning entry within the file. If unspecified, no 77 | ; provisioning will take place for devices which have no entry. DO NOT 78 | ; USE A '*' PROVISIONING ENTRY UNLESS YOU KNOW WHAT YOU'RE DOING. 79 | ; 80 | ;template=default 81 | 82 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/logger.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Logging Configuration 3 | ; 4 | ; In this file, you configure logging to files or to 5 | ; the syslog system. 6 | ; 7 | ; "logger reload" at the CLI will reload configuration 8 | ; of the logging system. 9 | 10 | [general] 11 | ; 12 | ; Customize the display of debug message time stamps 13 | ; this example is the ISO 8601 date format (yyyy-mm-dd HH:MM:SS) 14 | ; 15 | ; see strftime(3) Linux manual for format specifiers. Note that there is also 16 | ; a fractional second parameter which may be used in this field. Use %1q 17 | ; for tenths, %2q for hundredths, etc. 18 | ; 19 | ;dateformat=%F %T ; ISO 8601 date format 20 | ;dateformat=%F %T.%3q ; with milliseconds 21 | ; 22 | ; 23 | ; This makes Asterisk write callids to log messages 24 | ; (defaults to yes) 25 | ;use_callids = no 26 | ; 27 | ; This appends the hostname to the name of the log files. 28 | ;appendhostname = yes 29 | ; 30 | ; This determines whether or not we log queue events to a file 31 | ; (defaults to yes). 32 | ;queue_log = no 33 | ; 34 | ; Determines whether the queue_log always goes to a file, even 35 | ; when a realtime backend is present (defaults to no). 36 | ;queue_log_to_file = yes 37 | ; 38 | ; Set the queue_log filename 39 | ; (defaults to queue_log) 40 | ;queue_log_name = queue_log 41 | ; 42 | ; When using realtime for the queue log, use GMT for the timestamp 43 | ; instead of localtime. The default of this option is 'no'. 44 | ;queue_log_realtime_use_gmt = yes 45 | ; 46 | ; Log rotation strategy: 47 | ; none: Do not perform any logrotation at all. You should make 48 | ; very sure to set up some external logrotate mechanism 49 | ; as the asterisk logs can get very large, very quickly. 50 | ; sequential: Rename archived logs in order, such that the newest 51 | ; has the highest sequence number [default]. When 52 | ; exec_after_rotate is set, ${filename} will specify 53 | ; the new archived logfile. 54 | ; rotate: Rotate all the old files, such that the oldest has the 55 | ; highest sequence number [this is the expected behavior 56 | ; for Unix administrators]. When exec_after_rotate is 57 | ; set, ${filename} will specify the original root filename. 58 | ; timestamp: Rename the logfiles using a timestamp instead of a 59 | ; sequence number when "logger rotate" is executed. 60 | ; When exec_after_rotate is set, ${filename} will 61 | ; specify the new archived logfile. 62 | ;rotatestrategy = rotate 63 | ; 64 | ; Run a system command after rotating the files. This is mainly 65 | ; useful for rotatestrategy=rotate. The example allows the last 66 | ; two archive files to remain uncompressed, but after that point, 67 | ; they are compressed on disk. 68 | ; 69 | ; exec_after_rotate=gzip -9 ${filename}.2 70 | ; 71 | ; 72 | ; For each file, specify what to log. 73 | ; 74 | ; For console logging, you set options at start of 75 | ; Asterisk with -v for verbose and -d for debug 76 | ; See 'asterisk -h' for more information. 77 | ; 78 | ; Directory for log files is configures in asterisk.conf 79 | ; option astlogdir 80 | ; 81 | ; All log messages go to a queue serviced by a single thread 82 | ; which does all the IO. This setting controls how big that 83 | ; queue can get (and therefore how much memory is allocated) 84 | ; before new messages are discarded. 85 | ; The default is 1000 86 | ;logger_queue_limit = 250 87 | ; 88 | ; 89 | [logfiles] 90 | ; 91 | ; Format is "filename" and then "levels" of debugging to be included: 92 | ; debug 93 | ; notice 94 | ; warning 95 | ; error 96 | ; verbose() 97 | ; dtmf 98 | ; fax 99 | ; security 100 | ; 101 | ; Special filename "console" represents the root console 102 | ; 103 | ; Filenames can either be relative to the standard Asterisk log directory 104 | ; (see 'astlogdir' in asterisk.conf), or absolute paths that begin with 105 | ; '/'. 106 | ; 107 | ; Verbose takes an optional argument, in the form of an integer level. 108 | ; Verbose messages with higher levels will not be logged to the file. If 109 | ; the verbose level is not specified, it will log verbose messages following 110 | ; the current level of the root console. 111 | ; 112 | ; Special level name "*" means all levels, even dynamic levels registered 113 | ; by modules after the logger has been initialized (this means that loading 114 | ; and unloading modules that create/remove dynamic logger levels will result 115 | ; in these levels being included on filenames that have a level name of "*", 116 | ; without any need to perform a 'logger reload' or similar operation). 117 | ; Note that there is no value in specifying both "*" and specific level names 118 | ; for a filename; the "*" level means all levels. The only exception is if 119 | ; you need to specify a specific verbose level. e.g, "verbose(3),*". 120 | ; 121 | ; We highly recommend that you DO NOT turn on debug mode if you are simply 122 | ; running a production system. Debug mode turns on a LOT of extra messages, 123 | ; most of which you are unlikely to understand without an understanding of 124 | ; the underlying code. Do NOT report debug messages as code issues, unless 125 | ; you have a specific issue that you are attempting to debug. They are 126 | ; messages for just that -- debugging -- and do not rise to the level of 127 | ; something that merit your attention as an Asterisk administrator. Debug 128 | ; messages are also very verbose and can and do fill up logfiles quickly; 129 | ; this is another reason not to have debug mode on a production system unless 130 | ; you are in the process of debugging a specific issue. 131 | ; 132 | ;debug => debug 133 | ;security => security 134 | console => notice,warning,error 135 | ;console => notice,warning,error,debug 136 | messages => notice,warning,error 137 | ;full => notice,warning,error,debug,verbose,dtmf,fax 138 | 139 | ;syslog keyword : This special keyword logs to syslog facility 140 | ; 141 | ;syslog.local0 => notice,warning,error 142 | ; 143 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/manager.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk Call Management support 3 | ; 4 | 5 | ; By default asterisk will listen on localhost only. 6 | [general] 7 | enabled = yes 8 | port = 5038 9 | bindaddr = 0.0.0.0 10 | 11 | ; No access is allowed by default. 12 | ; To set a password, create a file in /etc/asterisk/manager.d 13 | ; use creative permission games to allow other serivces to create their own 14 | ; files 15 | #include "manager.d/*.conf" 16 | 17 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/manager.d/admin.conf: -------------------------------------------------------------------------------- 1 | 2 | [admin] 3 | secret = password 4 | read = call,agent,user,security 5 | write = call,command,agent,user,originate 6 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/meetme.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Configuration file for MeetMe simple conference rooms for Asterisk of course. 3 | ; 4 | ; This configuration file is read every time you call app meetme() 5 | 6 | [general] 7 | ;audiobuffers=32 ; The number of 20ms audio buffers to be used 8 | ; when feeding audio frames from non-DAHDI channels 9 | ; into the conference; larger numbers will allow 10 | ; for the conference to 'de-jitter' audio that arrives 11 | ; at different timing than the conference's timing 12 | ; source, but can also allow for latency in hearing 13 | ; the audio from the speaker. Minimum value is 2, 14 | ; maximum value is 32. 15 | ; 16 | ; Conferences may be scheduled from realtime? 17 | ;schedule=yes 18 | ; 19 | ; Update realtime when members login/out of the conference 20 | ;logmembercount=no 21 | ; 22 | ; How much earlier than the start time should we allow participants to 23 | ; join the conference (in seconds)? 24 | ;fuzzystart=300 25 | ; 26 | ; If the participants join too early, how much time should we allow 27 | ; to tell them that they've joined too early, rather than telling them 28 | ; the conference simply doesn't exist (in seconds)? 29 | ;earlyalert=3600 30 | ; 31 | ; How many seconds before the scheduled end of the conference should 32 | ; the participants be warned? 33 | ;endalert=120 34 | ; 35 | [rooms] 36 | ; 37 | ; Usage is conf => confno[,pin][,adminpin] 38 | ; 39 | ; Note that once a participant has called the conference, a change to the pin 40 | ; number done in this file will not take effect until there are no more users 41 | ; in the conference and it goes away. When it is created again, it will have 42 | ; the new pin number. 43 | ; 44 | ;conf => 1234 45 | ;conf => 2345,9938 46 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/minivm.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mor10am/callcenter/3a673d9cbb83ef493d7fc8465ebeab64d3db771c/ansible/files/asterisk/etc/minivm.conf -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/modules.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk configuration file 3 | ; 4 | ; Module Loader configuration file 5 | ; 6 | 7 | [modules] 8 | autoload=yes 9 | ; 10 | ; Any modules that need to be loaded before the Asterisk core has been 11 | ; initialized (just after the logger has been initialized) can be loaded 12 | ; using 'preload'. This will frequently be needed if you wish to map all 13 | ; module configuration files into Realtime storage, since the Realtime 14 | ; driver will need to be loaded before the modules using those configuration 15 | ; files are initialized. 16 | ; 17 | ; An example of loading ODBC support would be: 18 | ;preload => res_odbc.so 19 | ;preload => res_config_odbc.so 20 | ; 21 | ; If you want, load the GTK console right away. 22 | ; Don't load the KDE console since 23 | ; it's not as sophisticated right now. 24 | ; 25 | noload => pbx_gtkconsole.so 26 | ;load => pbx_gtkconsole.so 27 | noload => pbx_kdeconsole.so 28 | ; 29 | ; Intercom application is obsoleted by 30 | ; chan_oss. Don't load it. 31 | ; 32 | noload => app_intercom.so 33 | ; 34 | ; The 'modem' channel driver and its subdrivers are 35 | ; obsolete, don't load them. 36 | ; 37 | noload => chan_modem.so 38 | noload => chan_modem_aopen.so 39 | noload => chan_modem_bestdata.so 40 | noload => chan_modem_i4l.so 41 | ; 42 | ; Comment this out (after installing CAPI middleware and hardware 43 | ; drivers) if you have CAPI-able hardware and wish to use it in 44 | ; Asterisk. 45 | ; 46 | noload => chan_capi.so 47 | ; 48 | load => res_musiconhold.so 49 | ; 50 | ; Load either OSS or ALSA, not both 51 | ; By default, load OSS only (automatically) and do not load ALSA 52 | ; 53 | noload => chan_alsa.so 54 | ;noload => chan_oss.so 55 | ; 56 | ; Disable CDR logging to SQLite by default since it writes unconditionally to 57 | ; cdr.db without a way to rotate it. 58 | ; 59 | noload => cdr_sqlite.so 60 | ; 61 | ; These conflict with app_directory.so and each other. 62 | noload => app_directory_odbc.so 63 | ; 64 | ; Enable these if you want to configure Asterisk in a database 65 | ; 66 | noload => res_config_odbc.so 67 | noload => res_config_pgsql.so 68 | ; 69 | ; Module names listed in "global" section will have symbols globally 70 | ; exported to modules loaded after them. 71 | ; 72 | [global] 73 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/motif.conf: -------------------------------------------------------------------------------- 1 | ; Sample configuration file for chan_motif 2 | 3 | ; Transports 4 | ; 5 | ; There are three different transports and protocol derivatives supported by chan_motif. They are in order of preference: 6 | ; Jingle using ICE-UDP, Google Jingle, and Google-V1. 7 | ; 8 | ; Jingle as defined in XEP-0166 supports the widest range of features. It is referred to as "ice-udp" in this file. This is 9 | ; the specification that Jingle clients implement. 10 | ; 11 | ; Google Jingle follows the Jingle specification for signaling but uses a custom transport for media. It is supported 12 | ; by the Google Talk Plug-in in Gmail and by some other Jingle clients. It is referred to as "google" in this file. 13 | ; 14 | ; Google-V1 is the original Google Talk signaling protocol which uses an initial preliminary version of Jingle. 15 | ; It also uses the same custom transport as Google Jingle for media. It is supported by Google Voice, some other Jingle 16 | ; clients, and the Windows Google Talk client. It is referred to as "google-v1" in this file. 17 | ; 18 | ; Incoming sessions will automatically switch to the correct transport once it has been determined. 19 | ; 20 | ; Outgoing sessions are capable of determining if the target is capable of Jingle or a Google transport if the target is 21 | ; in the roster. Unfortunately it is not possible to differentiate between a Google Jingle or Google-V1 capable resource 22 | ; until a session initiate attempt occurs. If a resource is determined to use a Google transport it will initially use 23 | ; Google Jingle but will fall back to Google-V1 if required. 24 | ; 25 | ; If an outgoing session attempt fails due to failure to support the given transport chan_motif will fall back in preference 26 | ; order listed at the beginning of this document until all transports have been exhausted. 27 | ; 28 | 29 | ; Dialing and Resource Selection Strategy 30 | ; 31 | ; Placing a call through an endpoint can be accomplished using the following dial string: 32 | ; 33 | ; Motif// 34 | ; 35 | ; When placing an outgoing call through an endpoint the requested target is searched for in the roster list. If present 36 | ; the first Jingle or Google Jingle capable resource is specifically targetted. Since the capabilities of the resource are 37 | ; known the outgoing session initation will disregard the configured transport and use the determined one. 38 | ; 39 | ; If the target is not found in the roster the target will be used as-is and a session will be initiated using the 40 | ; transport specified in this configuration file. If no transport has been specified the endpoint defaults to ice-udp. 41 | ; 42 | 43 | ; Video Support 44 | ; 45 | ; Support for video does not need to be explicitly enabled. Configuring any video codec on your endpoint will 46 | ; automatically enable it. 47 | 48 | ; DTMF 49 | ; 50 | ; The only supported method for DTMF is RFC2833. This is always enabled on audio streams and negotiated if possible. 51 | 52 | ; Incoming Calls 53 | ; 54 | ; Incoming calls will first look for the extension matching the name of the endpoint in the configured context. If 55 | ; no such extension exists the call will automatically fall back to the "s" extension. 56 | 57 | ; CallerID 58 | ; 59 | ; The incoming caller id number is populated with the username of the caller and the name is populated with the full 60 | ; identity of the caller. If you would like to perform authentication or filtering of incoming calls it is recommended 61 | ; that you use these fields to do so. 62 | ; 63 | ; Outgoing caller id can *not* be set. 64 | ; 65 | ; IMPORTANT: Multiple endpoints using the same connection is *NOT* supported. Doing so may result in broken calls. 66 | 67 | ; Default template for endpoints, to be included in their definition 68 | [default](!) 69 | disallow=all 70 | allow=ulaw 71 | allow=h264 72 | context=incoming-motif ; Default context that incoming sessions will land in 73 | 74 | ;maxicecandidates = 10 ; Maximum number of ICE candidates we will offer 75 | ;maxpayloads = 30 ; Maximum number of payloads we will offer 76 | 77 | ; Sample configuration entry for Jingle 78 | ;[jingle-endpoint](default) 79 | ;transport=ice-udp ; Change the default protocol of outgoing sessions to Jingle ICE-UDP 80 | ;allow=g722 ; Add G.722 as an allowed format since the other side may support it 81 | ;connection=local-jabber-account ; Connection to accept traffic on and send traffic out 82 | ;accountcode=jingle ; Account code for CDR purposes 83 | 84 | ; Sample configuration entry for Google Talk 85 | [gtalk-endpoint](default) 86 | ;transport=google ; Since this is a Google Talk endpoint we want to offer Google Jingle for outgoing sessions 87 | ;connection=gtalk-account 88 | 89 | ; Sample configuration entry for Google Voice 90 | ;[gvoice](default) 91 | ;transport=google-v1 ; Google Voice uses the original Google Talk protocol 92 | ;connection=gvoice-account 93 | 94 | ; Additional options 95 | ; callgroup 96 | ; pickupgroup 97 | ; language 98 | ; musicclass 99 | ; parkinglot 100 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/musiconhold.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Music on Hold -- Sample Configuration 3 | ; 4 | [general] 5 | ;cachertclasses=yes ; use 1 instance of moh class for all users who are using it, 6 | ; decrease consumable cpu cycles and memory 7 | ; disabled by default 8 | 9 | 10 | ; valid mode options: 11 | ; files -- read files from a directory in any Asterisk supported 12 | ; media format 13 | ; quietmp3 -- default 14 | ; mp3 -- loud 15 | ; mp3nb -- unbuffered 16 | ; quietmp3nb -- quiet unbuffered 17 | ; custom -- run a custom application (See examples below) 18 | 19 | ; ========= 20 | ; File-based (native) music on hold 21 | ; ========= 22 | ; 23 | ; This plays files directly from the specified directory, no external 24 | ; processes are required. Files are played in normal sorting order 25 | ; (same as a sorted directory listing), and no volume or other 26 | ; sound adjustments are available. If the file is available in 27 | ; the same format as the channel's codec, then it will be played 28 | ; without transcoding (same as Playback would do in the dialplan). 29 | ; Files can be present in as many formats as you wish, and the 30 | ; 'best' format will be chosen at playback time. 31 | ; 32 | ; The path specified can be either an absolute path (starts with '/'), 33 | ; or a relative path; relative paths are interpreted as being relative 34 | ; to the 'astdatalibdir' in asterisk.conf, which defaults to 35 | ; /var/lib/asterisk. 36 | ; 37 | ; NOTE: 38 | ; If you are not using "autoload" in modules.conf, then you 39 | ; must ensure that the format modules for any formats you wish 40 | ; to use are loaded _before_ res_musiconhold. If you do not do 41 | ; this, res_musiconhold will skip the files it is not able to 42 | ; understand when it loads. 43 | ; 44 | 45 | [default] 46 | mode=files 47 | directory=moh 48 | ; 49 | ;[native-random] 50 | ;mode=files 51 | ;directory=moh 52 | ;digit=# ; If this option is set for a class, then when callers are 53 | ; ; listening to music on hold, they can press this digit, and 54 | ; ; they will switch to listening to this music class. 55 | ;announcement=queue-thankyou ;If this option is set for a class, then 56 | ; ; when callers get put on hold, the specified sound will be 57 | ; ; be played to them. Also, if using modes that Asterisk 58 | ; ; controls the playlist for (files, mp3, etc), the same 59 | ; ; sound will also be played between MOH songs. 60 | ;sort=random ; Sort the files in random order 61 | 62 | ;[native-alphabetical] 63 | ;mode=files 64 | ;directory=moh 65 | ;sort=alpha ; Sort the files in alphabetical order. If this option is 66 | ; ; not specified, the sort order is undefined. 67 | 68 | ; ========= 69 | ; Other (non-native) playback methods 70 | ; ========= 71 | 72 | ;[manual] 73 | ;mode=custom 74 | ; Note that with mode=custom, a directory is not required, such as when reading 75 | ; from a stream. 76 | ;directory=/var/lib/asterisk/mohmp3 77 | ;application=/usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 --mono -s 78 | 79 | ;[ulawstream] 80 | ;mode=custom 81 | ;application=/usr/bin/streamplayer 192.168.100.52 888 82 | ;format=ulaw ; The 'format' option specifies the audio format that the 83 | ; ; 'application' will provide to Asterisk. In this example, 84 | ; ; streamplayer will output ulaw samples so we need to set the 85 | ; ; format to ulaw so that Asterisk knows how to interpret the 86 | ; ; incoming audio. 87 | 88 | ; mpg123 on Solaris does not always exit properly; madplay may be a better 89 | ; choice 90 | ;[solaris] 91 | ;mode=custom 92 | ;directory=/var/lib/asterisk/mohmp3 93 | ;application=/site/sw/bin/madplay -Q -o raw:- --mono -R 8000 -a -12 94 | 95 | ; By default, when res_musiconhold reloads or unloads, it sends a HUP signal 96 | ; to custom applications (and all descendants), waits 100ms, then sends a 97 | ; TERM signal, waits 100ms, then finally sends a KILL signal. An application 98 | ; which is interacting with an external device and/or spawns children of its 99 | ; own may not be able to exit cleanly in the default times, expecially if sent 100 | ; a KILL signal, or if it's children are getting signals directly from 101 | ; res_musiconhoild. To allow extra time, the 'kill_escalation_delay' 102 | ; class option can be used to set the number of milliseconds res_musiconhold 103 | ; waits before escalating kill signals, with the default being the current 104 | ; 100ms. To control to whom the signals are sent, the "kill_method" 105 | ; class option can be set to "process_group" (the default, existing behavior), 106 | ; which sends signals to the application and its descendants directly, or 107 | ; "process" which sends signals only to the application itself. 108 | 109 | ;[sox_from_device] 110 | ;mode=custom 111 | ;directory=/var/lib/asterisk/mohmp3 112 | ;application=/usr/bin/sox -q -t alsa -c 2 -r 48000 hw:1 -c 1 -r 8000 -t raw -s - 113 | ; Wait 500ms before escalating kill signals 114 | ;kill_escalation_delay=500 115 | ; Send signals to just the child process instead of all descendants 116 | ;kill_method=process 117 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/muted.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Sample muted configuration file 3 | # 4 | # Copyright (C) 2004 Digium, Inc. 5 | # 6 | # First you have the host, username, and password 7 | # we use to connect to the asterisk system 8 | # 9 | # What is this? Well, haven't you ever wished you could automatically 10 | # turn down the volume on your stereo, CDPlayer, etc, when a call comes in, 11 | # and then return it to normal when the call ends? Well, this is a possible 12 | # mechanism to make this happen! 13 | # You have to fire up the new utils/muted, which runs as a daemon in the 14 | # background. This daemon connects to asterisk via a manager interface, and 15 | # also reads this config file from /etc/muted.conf. when the channels mentioned 16 | # are activated, it tweaks the sound levels on the sound card(s). 17 | # So, depending on the sound card, you may be able to run all your sound 18 | # generating devices thru your sound card, and use this mechanism to quiet 19 | # them down while you are on the phone. If anyone figures out how to make 20 | # this work with kids, please inform!! 21 | # 22 | host localhost 23 | user user 24 | pass pass 25 | # 26 | # List each channel we're supposed to watch 27 | # 28 | channel DAHDI/1 29 | channel DAHDI/2 30 | channel SIP/mark 31 | # 32 | # Mute level is the percentage of the current volume we should 33 | # lower the music to. 34 | # 35 | mutelevel 20 36 | # 37 | # Smooth fade makes the fadein/fadeout nicer sounding 38 | # 39 | smoothfade 40 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/osp.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Open Settlement Protocol Sample Configuration File 3 | ; 4 | ; This file contains configuration of OSP server providers that are used by the 5 | ; Asterisk OSP module. The section "general" is reserved for global options. 6 | ; All other sections describe specific OSP Providers. The provider "default" 7 | ; is used when no provider is otherwise specified. 8 | ; 9 | ; The "servicepoint" and "source" parameters must be configured. For most 10 | ; implementations the other parameters in this file can be left unchanged. 11 | ; 12 | [general] 13 | ; 14 | ; Enable cryptographic acceleration hardware. 15 | ; The default value is no. 16 | ; 17 | ;accelerate=no 18 | ; 19 | ; Enable security features. 20 | ; If security features are disabled, Asterisk cannot validate signed tokens and 21 | ; all certificate file name parameters are ignored. 22 | ; The default value is no. 23 | ; 24 | ;securityfeatures=no 25 | ; 26 | ; Defines the status of tokens that Asterisk will validate. 27 | ; 0 - signed tokens only 28 | ; 1 - unsigned tokens only 29 | ; 2 - both signed and unsigned 30 | ; The default value is 0, i.e. the Asterisk will only validate signed tokens. 31 | ; If securityfeatures are disabled, Asterisk cannot validate signed tokens. 32 | ; 33 | ;tokenformat=0 34 | ; 35 | ;[default] 36 | ; 37 | ; List all service points (OSP servers) for this provider. 38 | ; Use either domain name or IP address. Most OSP servers use port 5045. 39 | ; 40 | ;servicepoint=http://osptestserver.transnexus.com:5045/osp 41 | ; 42 | ; Define the "source" device for requesting OSP authorization. 43 | ; This value is usually the domain name or IP address of the the Asterisk server. 44 | ; 45 | ;source=domain name or [IP address in brackets] 46 | ; 47 | ; Define path and file name of crypto files. 48 | ; The default path for crypto file is /var/lib/asterisk/keys. If no path is 49 | ; defined, crypto files will in /var/lib/asterisk/keys directory. 50 | ; 51 | ; Specify the private key file name. 52 | ; If this parameter is unspecified or not present, the default name will be the 53 | ; osp.conf section name followed by "-privatekey.pem" (for example: 54 | ; default-privatekey.pem) 55 | ; If securityfeatures are disabled, this parameter is ignored. 56 | ; 57 | ;privatekey=pkey.pem 58 | ; 59 | ; Specify the local certificate file. 60 | ; If this parameter is unspecified or not present, the default name will be the 61 | ; osp.conf section name followed by "- localcert.pem " (for example: 62 | ; default-localcert.pem) 63 | ; If securityfeatures are disabled, this parameter is ignored. 64 | ; 65 | ;localcert=localcert.pem 66 | ; 67 | ; Specify one or more Certificate Authority key file names. If none are listed, 68 | ; a single Certificate Authority key file name is added with the default name of 69 | ; the osp.conf section name followed by "-cacert_0.pem " (for example: 70 | ; default-cacert_0.pem) 71 | ; If securityfeatures are disabled, this parameter is ignored. 72 | ; 73 | ;cacert=cacert_0.pem 74 | ; 75 | ; Configure parameters for OSP communication between Asterisk OSP client and OSP 76 | ; servers. 77 | ; 78 | ; maxconnections: Max number of simultaneous connections to the provider OSP 79 | ; server (default=20) 80 | ; retrydelay: Extra delay between retries (default=0) 81 | ; retrylimit: Max number of retries before giving up (default=2) 82 | ; timeout: Timeout for response in milliseconds (default=500) 83 | ; 84 | ;maxconnections=20 85 | ;retrydelay=0 86 | ;retrylimit=2 87 | ;timeout=500 88 | ; 89 | ; Set the authentication policy. 90 | ; 0 - NO - Accept all calls. 91 | ; 1 - YES - Accept calls with valid token or no token. Block calls with 92 | ; invalid token. 93 | ; 2 - EXCLUSIVE - Accept calls with valid token. Block calls with invalid token 94 | ; or no token. 95 | ; Default is 1, 96 | ; If securityfeatures are disabled, Asterisk cannot validate signed tokens. 97 | ; 98 | ;authpolicy=1 99 | ; 100 | ; Set the default destination protocol. The OSP module supports SIP, H323, and 101 | ; IAX protocols. The default protocol is set to SIP. 102 | ; 103 | ;defaultprotocol=SIP 104 | ; 105 | ; Set the work mode. 106 | ; 0 - Direct 107 | ; 1 - Indirect 108 | ; Default is 0, 109 | ; 110 | ;workmode=0 111 | ; 112 | ; Set the service type. 113 | ; 0 - Normal voice service 114 | ; 1 - Ported number query service 115 | ; Default is 0, 116 | ; 117 | ;servicetype=0 118 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/phone.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Linux Telephony Interface 3 | ; 4 | ; Configuration file 5 | ; 6 | [interfaces] 7 | ; 8 | ; Select a mode, either the phone jack provides dialtone, reads digits, 9 | ; then starts PBX with the given extension (dialtone mode), or 10 | ; immediately provides the PBX without reading any digits or providing 11 | ; any dialtone (this is the immediate mode, the default). Also, you 12 | ; can set the mode to "fxo" if you have a linejack to make it operate 13 | ; properly. If you are using a Sigma Designs board you may set this to 14 | ; "sig". 15 | ; 16 | mode=immediate 17 | ;mode=dialtone 18 | ;mode=fxo 19 | ;mode=sig 20 | ; 21 | ; You can decide which format to use by default, "g723.1", "g729", or "slinear". 22 | ; Note that g729 is only supported for Sigma Designs boards. 23 | ; XXX Be careful, sometimes the card causes kernel panics when running 24 | ; in signed linear mode for some reason... XXX 25 | ; 26 | format=slinear 27 | ;format=g723.1 28 | ;format=g729 29 | ; 30 | ; And set the echo cancellation to "off", "low", "medium", and "high". 31 | ; This is not supported on all phones. 32 | ; 33 | echocancel=medium 34 | ; 35 | ; You can optionally use VAD/CNG silence suppression 36 | ; 37 | ;silencesupression=yes 38 | ; 39 | ; List all devices we can use. Contexts may also be specified 40 | ; 41 | ;context=local 42 | ; 43 | ; You can set txgain and rxgain for each device in the same way as context. 44 | ; If you want to change default gain value (1.0 =~ 100%) for device, simple 45 | ; add txgain or rxgain line before device line. But remember, if you change 46 | ; volume all cards listed below will be affected by these values. You can 47 | ; use float values (1.0, 0.5, 2.0) or percentage values (100%, 150%, 50%). 48 | ; 49 | ;txgain=100% 50 | ;rxgain=1.0 51 | ;device => /dev/phone0 52 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/pjproject.conf: -------------------------------------------------------------------------------- 1 | ; Common pjproject options 2 | ; 3 | 4 | ;[startup] 5 | ; NOTES: The name of this section in the pjproject.conf configuration file must 6 | ; remain startup or the configuration will not be applied. 7 | ; 8 | ;log_level=default ; Initial maximum pjproject logging level to log 9 | ; Valid values are: 0-6, and default 10 | ; 11 | ; Note: This option is needed very early in the startup 12 | ; process so it can only be read from config files because 13 | ; the modules for other methods have not been loaded yet. 14 | ;type= ; Must be of type startup (default: "") 15 | 16 | ;========================LOG_MAPPINGS SECTION OPTIONS=============================== 17 | ;[log_mappings] 18 | ; SYNOPSIS: Provides pjproject to Asterisk log level mappings. 19 | ; NOTES: The name of this section in the pjproject.conf configuration file must 20 | ; remain log_mappings or the configuration will not be applied. 21 | ; The defaults mentioned below only apply if this file or the 'log_mappings' 22 | ; object can't be found. If the object is found, there are no defaults. If 23 | ; you don't specify an entry, nothing will be logged for that level. 24 | ; 25 | ; These logging level meanings are typically used by pjproject: 26 | ; - 0: fatal error 27 | ; - 1: error 28 | ; - 2: warning 29 | ; - 3: info 30 | ; - 4: debug 31 | ; - 5: trace 32 | ; - 6: more detailed trace 33 | ; 34 | ;asterisk_error = ; A comma separated list of pjproject log levels to map to 35 | ; Asterisk errors. 36 | ; (default: "0,1") 37 | ;asterisk_warning = ; A comma separated list of pjproject log levels to map to 38 | ; Asterisk warnings. 39 | ; (default: "2") 40 | ;asterisk_notice = ; A comma separated list of pjproject log levels to map to 41 | ; Asterisk notices. 42 | ; (default: "") 43 | ;asterisk_verbose = ; A comma separated list of pjproject log levels to map to 44 | ; Asterisk verbose. 45 | ; (default: "") 46 | ;asterisk_debug = ; A comma separated list of pjproject log levels to map to 47 | ; Asterisk debug 48 | ; (default: "3,4,5,6") 49 | ;type= ; Must be of type log_mappings (default: "") 50 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/pjsip_notify.conf: -------------------------------------------------------------------------------- 1 | ; rfc3842 2 | ; put empty "Content=>" at the end to have CRLF after last body line 3 | 4 | [clear-mwi] 5 | Event=>message-summary 6 | Content-type=>application/simple-message-summary 7 | Content=>Messages-Waiting: no 8 | Content=>Message-Account: sip:asterisk@127.0.0.1 9 | Content=>Voice-Message: 0/0 (0/0) 10 | Content=> 11 | 12 | ; Aastra 13 | 14 | [aastra-check-cfg] 15 | Event=>check-sync 16 | 17 | [aastra-xml] 18 | Event=>aastra-xml 19 | 20 | ; Digium 21 | 22 | [digium-check-cfg] 23 | Event=>check-sync 24 | 25 | ; Linksys 26 | 27 | [linksys-cold-restart] 28 | Event=>reboot_now 29 | 30 | [linksys-warm-restart] 31 | Event=>restart_now 32 | 33 | ; Polycom 34 | 35 | [polycom-check-cfg] 36 | Event=>check-sync 37 | 38 | ; Sipura 39 | 40 | [sipura-check-cfg] 41 | Event=>resync 42 | 43 | [sipura-get-report] 44 | Event=>report 45 | 46 | ; snom 47 | 48 | [snom-check-cfg] 49 | Event=>check-sync\;reboot=false 50 | 51 | [snom-reboot] 52 | Event=>check-sync\;reboot=true 53 | 54 | ; Cisco 55 | 56 | [cisco-check-cfg] 57 | Event=>check-sync 58 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/queuerules.conf: -------------------------------------------------------------------------------- 1 | 2 | [general] 3 | 4 | ; Look for queue rules in the queue_rules database table through RealTime. Note 5 | ; that this option is not strictly "RealTime", in the sense that the queue 6 | ; rules are only loaded and parsed during module load/reload. Queue rules 7 | ; must have a unique rule name and support relative min/max penalties. 8 | ; 9 | ; realtime_rules = yes 10 | ; 11 | 12 | ; It is possible to change the value of the QUEUE_MAX_PENALTY and QUEUE_MIN_PENALTY 13 | ; channel variables in mid-call by defining rules in the queue for when to do so. This can allow for 14 | ; a call to be opened to more members or potentially a different set of members. 15 | ; The advantage to changing members this way as opposed to inserting the caller into a 16 | ; different queue with more members or reinserting the caller into the same queue with a different 17 | ; QUEUE_MAX_PENALTY or QUEUE_MIN_PENALTY set is that the caller does not lose his place in the queue. 18 | ; 19 | ; Note: There is a limitation to these rules; a caller will follow the penaltychange rules for 20 | ; the queue that were defined at the time the caller entered the queue. If an update to the rules is 21 | ; made during the caller's stay in the queue, these will not be reflected for that caller. 22 | ; 23 | ; The syntax for these rules is 24 | ; penaltychange => ,[,absolute or relative change to QUEUE_MIN_PENALTY] 25 | ; 26 | ; Example: 27 | ; [myrule] 28 | ; penaltychange => 30,+3 ; 30 seconds into the call increase the QUEUE_MAX_PENALTY by 3, no change to QUEUE_MIN_PENALTY 29 | ; penaltychange => 60,10,5 ; 60 seconds into the call increase the QUEUE_MAX_PENALTY to 10 and increase the QUEUE_MIN_PENALTY to 5 30 | ; penaltychange => 75,,7 ; 75 seconds into the call keep the QUEUE_MAX_PENALTY the same and increase the QUEUE_MIN_PENALTY to 7 31 | 32 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/res_config_mysql.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Sample configuration for res_config_mysql.c 3 | ; 4 | ; The value of dbhost may be either a hostname or an IP address. 5 | ; If dbhost is commented out or the string "localhost", a connection 6 | ; to the local host is assumed and dbsock is used instead of TCP/IP 7 | ; to connect to the server. If no dbcharset is specified, the connection 8 | ; is made with no extra charset configurations sent to MySQL, leaving all 9 | ; configured MySQL charset options and defaults untouched. 10 | ; 11 | ; Multiple database contexts may be configured, with the caveat that 12 | ; all context names should be unique and must not contain the slash ('/') 13 | ; character. If you wish to separate reads from writes in your database 14 | ; configuration, you specify the database (NOT HERE, in other files) 15 | ; separated by a slash, read database first. If your database 16 | ; specification does not contain a slash, the implication is that reads 17 | ; and writes should be performed to the same database. 18 | ; 19 | ; For example, in extconfig.conf, you could specify a line like: 20 | ; sippeers => mysql,readhost.asterisk/writehost.asterisk,sippeers 21 | ; and then define the contexts [readhost.asterisk] and [writehost.asterisk] 22 | ; below. 23 | ; 24 | ; The requirements parameter is available only in Asterisk 1.6.1 and 25 | ; later and must be present in all contexts. It specifies the behavior 26 | ; when a column name is required by the system. The default behavior is 27 | ; "warn" and simply sends a warning to the logger that the column does 28 | ; not exist (or is of the wrong type or precision). The other two 29 | ; possibilities are "createclose", which adds the column with the right 30 | ; type and length, and "createchar", which adds the column as a char 31 | ; type, with the appropriate length to accept the data. Note that with 32 | ; the MySQL driver, both "createclose" and "createchar" will, on occasion, 33 | ; widen a table column width to meet the requirements specified. 34 | ; 35 | [general] 36 | ;dbhost = 127.0.0.1 37 | ;dbname = asterisk 38 | ;dbuser = myuser 39 | ;dbpass = mypass 40 | ;dbport = 3306 41 | ;dbsock = /tmp/mysql.sock 42 | ;dbcharset = latin1 43 | ;requirements=warn ; or createclose or createchar 44 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/res_config_sqlite.conf: -------------------------------------------------------------------------------- 1 | [general] 2 | 3 | ; The database file. 4 | dbfile => /var/lib/asterisk/sqlite.db 5 | 6 | ; Both config_table and cdr_table are optional. If config_table is omitted, 7 | ; you must specify it in extconfig.conf. If it is both provided here and in 8 | ; extconfig.conf, the value given here is used. If cdr_table is omitted, CDR 9 | ; support is simply disabled. 10 | config_table => ast_config 11 | ; cdr_table => ast_cdr 12 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/res_config_sqlite3.conf: -------------------------------------------------------------------------------- 1 | ; Define a realtime database name to use in extconfig.conf 2 | ; 3 | ;[asterisk] 4 | ;dbfile => /var/lib/asterisk/realtime.sqlite3 5 | ; 6 | ; debug - Turn on debugging information 7 | ;debug=yes 8 | ; 9 | ; requirements - At startup, each realtime family will make requirements 10 | ; on the backend. There are several strategies for handling requirements: 11 | ; warn - Warn if the required column does not exist. 12 | ; createclose - Create columns as close to the requirements as possible. 13 | ; createchar - Create char columns only 14 | ; 15 | ;requirements=warn 16 | ; 17 | ; batch - SQLite 3 write performance can be greatly improved by wrapping 18 | ; multiple writes in transactions. This option specifies the duration in 19 | ; milliseconds of auto-generated transactions. Any changes made during an 20 | ; unfinished transaction will be immediately available to the same database 21 | ; connection, but any external connections could see a delay up to the value 22 | ; of this setting. It is also possible that if asterisk crashes, any changes 23 | ; made during this time could be lost. Due to the nearly 100x performance 24 | ; benefit, the default is 100 ms. Set to 0 to disable batching. 25 | ; 26 | ; PLEASE NOTE: If you need to write to the database from another connection 27 | ; you will need to set batch=0 as the transactions will cause the database 28 | ; to lock for writing. 29 | ; 30 | ;batch=1000 31 | 32 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/res_corosync.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Sample configuration file for res_corosync. 3 | ; 4 | ; This module allows events to be shared amongst a local cluster of 5 | ; Asterisk servers. Specifically, the types of events that may be 6 | ; shared include: 7 | ; 8 | ; - Device State (for shared presence information) 9 | ; 10 | ; - Message Waiting Indication, or MWI (to allow Voicemail to live on 11 | ; a server that is different from where the phones are registered) 12 | ; 13 | ; For more information about Corosync, see: http://www.corosync.org/ 14 | ; 15 | 16 | [general] 17 | 18 | ; 19 | ; Publish Message Waiting Indication (MWI) events from this server to the 20 | ; cluster. 21 | ;publish_event = mwi 22 | ; 23 | ; Subscribe to MWI events from the cluster. 24 | ;subscribe_event = mwi 25 | ; 26 | ; Publish Device State (presence) events from this server to the cluster. 27 | ;publish_event = device_state 28 | ; 29 | ; Subscribe to Device State (presence) events from the cluster. 30 | ;subscribe_event = device_state 31 | ; 32 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/res_curl.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; CURLOPT global settings (mostly set for realtime) 3 | ; 4 | [globals] 5 | ;proxy=myproxy.example.com 6 | proxytype=http 7 | proxyport=8001 8 | ;proxyuserpwd=asterisk:asteriskrocks 9 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/res_fax.conf: -------------------------------------------------------------------------------- 1 | ; Generic Fax Application configuration 2 | 3 | [general] 4 | ; Maximum Transmission Rate 5 | ; Possible values are { 2400 | 4800 | 7200 | 9600 | 12000 | 14400 } 6 | ; Set this value to the maximum desired transfer rate. Default: 14400 7 | ;maxrate=14400 8 | 9 | ; Minimum Transmission Rate 10 | ; Possible values are { 2400 | 4800 | 7200 | 9600 | 12000 | 14400 } 11 | ; Set this value to the minimum desired transfer rate. Default: 4800 12 | ;minrate=4800 13 | 14 | ; Send Progress/Status events to manager session 15 | ; Manager events with 'call' class permissions will receive events indicating the 16 | ; steps to initiate a fax session. Fax completion events are always sent to manager 17 | ; sessions with 'call' class permissions, regardless of the value of this option. 18 | ; Default: no 19 | statusevents=yes 20 | 21 | ; modem capabilities 22 | ; Possible values are { v17 | v27 | v29 } 23 | ; Set this value to modify the default modem options. Default: v17,v27,v29 24 | ;modems=v17,v27,v29 25 | 26 | ; Enable/disable T.30 ECM (error correction mode) by default. 27 | ; Default: Enabled 28 | ;ecm=yes 29 | 30 | ; T.38 Negotiation Timeout in milliseconds 31 | ; Default: 5000 32 | t38timeout=5000 33 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/res_odbc.conf: -------------------------------------------------------------------------------- 1 | ;;; odbc setup file 2 | 3 | ; ENV is a global set of environmental variables that will get set. 4 | ; Note that all environmental variables can be seen by all connections, 5 | ; so you can't have different values for different connections. 6 | [ENV] 7 | ;INFORMIXSERVER => my_special_database 8 | ;INFORMIXDIR => /opt/informix 9 | ;ORACLE_HOME => /home/oracle 10 | 11 | ; All other sections are arbitrary names for database connections. 12 | 13 | ; 14 | ; The context name is what will be used in other configuration files, such 15 | ; as extconfig.conf and func_odbc.conf, to reference this connection. 16 | [asterisk] 17 | ; 18 | ; Permit disabling sections without needing to comment them out. 19 | ; If not specified, it is assumed the section is enabled. 20 | enabled => no 21 | ; 22 | ; This value should match an entry in /etc/odbc.ini 23 | ; (or /usr/local/etc/odbc.ini, on FreeBSD and similar systems). 24 | dsn => asterisk 25 | ; 26 | ; Username for connecting to the database. The user defaults to the context name if unspecified. 27 | ;username => myuser 28 | ; 29 | ; Password for authenticating the user to the database. The default 30 | ; password is blank. 31 | ;password => mypass 32 | ; 33 | ; Build a connection at startup? 34 | pre-connect => yes 35 | ; 36 | ; What should we execute to ensure that our connection is still alive? The 37 | ; statement should return a non-zero value in the first field of its first 38 | ; record. The default is "select 1". 39 | ;sanitysql => select 1 40 | ; 41 | ; The maximum number of connections to have open at any given time. 42 | ; This defaults to 1 and it is highly recommended to only set this higher 43 | ; if using a version of UnixODBC greater than 2.3.1. 44 | ;max_connections => 20 45 | ; 46 | ; When the channel is destroyed, should any uncommitted open transactions 47 | ; automatically be committed? 48 | ;forcecommit => no 49 | ; 50 | ; How should we perceive data in other transactions within the database? 51 | ; Possible values are read_uncommitted, read_committed, repeatable_read, 52 | ; and serializable. The default is read_committed. 53 | ;isolation => repeatable_read 54 | ; 55 | ; Is the backslash a native escape character? The default is yes, but for 56 | ; MS SQL Server, the answer is no. 57 | ;backslash_is_escape => yes 58 | ; 59 | ; How long (in seconds) should we attempt to connect before considering the 60 | ; connection dead? The default is 10 seconds, but you may wish to reduce it, 61 | ; to increase responsiveness. 62 | ;connect_timeout => 10 63 | ; 64 | ; When a connection fails, how long (in seconds) should we cache that 65 | ; information before we attempt another connection? This increases 66 | ; responsiveness, when a database resource is not working. 67 | ;negative_connection_cache => 300 68 | 69 | [mysql2] 70 | enabled => no 71 | dsn => MySQL-asterisk 72 | username => myuser 73 | password => mypass 74 | pre-connect => yes 75 | 76 | ; Certain servers, such as MS SQL Server and Sybase use the TDS protocol, which 77 | ; limits the number of active queries per connection to 1. 78 | [sqlserver] 79 | enabled => no 80 | dsn => mickeysoft 81 | max_connections => 5 82 | username => oscar 83 | password => thegrouch 84 | pre-connect => yes 85 | sanitysql => select count(*) from systables 86 | ; forcecommit => no ; Default to committing uncommitted transactions? 87 | ; Note: this is NOT the autocommit flag; this 88 | ; determines the end result of transactions which 89 | ; are not explicitly committed or rolled back. By 90 | ; default, such transactions are rolled back if the 91 | ; call ends without an explicit commit. 92 | ; isolation => read_committed ; Isolation level; supported levels are: 93 | ; read_uncommitted, read_committed, repeatable_read, 94 | ; serializable. Note that not all databases support 95 | ; all isolation levels (e.g. Postgres only supports 96 | ; repeatable_read and serializable). See database 97 | ; documentation for further information. 98 | ; 99 | ; Many databases have a default of '\' to escape special characters. MS SQL 100 | ; Server does not. 101 | backslash_is_escape => no 102 | 103 | ; 104 | ; If you are having problems with concurrency, please read this note from the 105 | ; mailing lists, regarding UnixODBC: 106 | ; 107 | ; http://lists.digium.com/pipermail/asterisk-dev/2009-February/036539.html 108 | ; 109 | ; In summary, try setting "Threading=2" in the relevant section within your 110 | ; odbcinst.ini. 111 | ; 112 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/res_pgsql.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Sample configuration for res_config_pgsql 3 | ; 4 | ; The value of dbhost may be either a hostname or an IP address. 5 | ; If dbhost is commented out or the string "localhost", a connection 6 | ; to the local host is assumed and dbsock is used instead of TCP/IP 7 | ; to connect to the server. 8 | ; 9 | [general] 10 | dbhost=127.0.0.1 11 | dbport=5432 12 | dbname=asterisk 13 | dbuser=asterisk 14 | dbpass=password 15 | ;dbappname=asterisk ; Postgres application_name support (optional). Whitespace not allowed. 16 | ; 17 | ; dbsock is specified as the directory where the socket file may be found. The 18 | ; actual socket is constructed as a combination of dbsock and dbport. For 19 | ; example, the values of '/tmp' and '5432', respectively, will specify a socket 20 | ; file of '/tmp/.s.PGSQL.5432'. 21 | ; 22 | ;dbsock=/tmp 23 | ; 24 | ; requirements - At startup, each realtime family will make requirements 25 | ; on the backend. There are several strategies for handling requirements: 26 | ; warn - Warn if the required column does not exist. 27 | ; createclose - Create columns as close to the requirements as possible. 28 | ; createchar - Create char columns only 29 | ; 30 | requirements=warn 31 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/res_pktccops.conf: -------------------------------------------------------------------------------- 1 | ;; Sample res_pktccops.conf 2 | ; 3 | ;[general] 4 | ;gateinfoperiod => 60 ; default 60s 5 | ;gatetimeout = 150 ; default 150 6 | ;t1 => 250 ; default 250s 7 | ;t7 => 200 ; default 200s 8 | ;t8 => 300 ; default 300s 9 | ;keepalive => 60 ; default 60s 10 | ; 11 | ;[teszt] 12 | ;host => 192.168.0.24 13 | ;pool => 10.0.1.0 10.0.1.255 14 | ;pool => 10.0.3.0 10.0.3.255 15 | ;pool => 10.0.7.0 10.0.8.255 16 | ;pool => 10.0.10.0 10.0.11.255 17 | ; 18 | ;[general] 19 | ;gateinfoperiod => 60 ; default 60s 20 | ;gatetimeout = 150 ; default 150 21 | ;t1 => 250 ; default 250s 22 | ;t7 => 200 ; default 200s 23 | ;t8 => 300 ; default 300s 24 | ;keepalive => 60 ; default 60s 25 | ; 26 | ;[test] 27 | ;host => 192.168.0.24 28 | ;pool => 10.0.1.0 10.0.1.255 29 | ;pool => 10.0.3.0 10.0.3.255 30 | ;pool => 10.0.7.0 10.0.8.255 31 | ;pool => 10.0.10.0 10.0.11.255 32 | ; 33 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/res_snmp.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Configuration file for res_snmp 3 | ; -------------------------------- 4 | ; 5 | ; Res_snmp can run as a subagent or standalone SNMP agent. The standalone snmp 6 | ; agent is based on net-snmp and will read a configuration file called 7 | ; asterisk.conf in the net-snmp configuration file path, starting with 8 | ; /etc/snmp on many systems. 9 | ; 10 | ; If you use the subagent model, you need to enable agentx in snmpd.conf 11 | ; Note that you can only run one Asterisk on the system in this case. 12 | ; 13 | ; See https://wiki.asterisk.org/wiki/display/AST/Simple+Network+Management+Protocol+(SNMP)+Support 14 | ; to get more information about 15 | ; snmp support in Asterisk 16 | 17 | [general] 18 | ; We run as a subagent per default -- to run as a full agent 19 | ; we must run as root (to be able to bind to port 161) 20 | ;subagent = yes 21 | ; SNMP must be explicitly enabled to be active 22 | ;enabled = yes 23 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/res_stun_monitor.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; Configuration file for the res_stun_monitor module 3 | ; 4 | ; The res_stun_monitor module sends STUN requests to a configured STUN server 5 | ; periodically. If the monitor detects a change in the external IP address or port 6 | ; provided by the STUN server an event is sent out internally within Asterisk 7 | ; to alert all listeners to that event of the change. 8 | 9 | ; The current default listeners for the network change event include chan_sip 10 | ; and chan_iax. Both of these channel drivers by default react to this event 11 | ; by renewing all outbound registrations. This allows the endpoints Asterisk 12 | ; is registering with to become aware of the address change and know the new 13 | ; location. 14 | ; 15 | [general] 16 | ; 17 | ; ---- STUN Server configuration --- 18 | ; Setting the 'stunaddr' option to a valid address enables the STUN monitor. 19 | ; 20 | ;stunaddr = mystunserver.com ; Address of the STUN server to query. 21 | ; Valid form: 22 | ; [(hostname | IP-address) [':' port]] 23 | ; The port defaults to the standard STUN port (3478). 24 | ; Set to an empty value to disable STUN monitoring. 25 | ; Default is disabled. 26 | ;stunrefresh = 30 ; Number of seconds between STUN refreshes. 27 | ; Default is 30. 28 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/rtp.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; RTP Configuration 3 | ; 4 | [general] 5 | ; 6 | ; RTP start and RTP end configure start and end addresses 7 | ; 8 | ; Defaults are rtpstart=5000 and rtpend=31000 9 | ; 10 | rtpstart=10000 11 | rtpend=20000 12 | ; 13 | ; Whether to enable or disable UDP checksums on RTP traffic 14 | ; 15 | ;rtpchecksums=no 16 | ; 17 | ; The amount of time a DTMF digit with no 'end' marker should be 18 | ; allowed to continue (in 'samples', 1/8000 of a second) 19 | ; 20 | ;dtmftimeout=3000 21 | ; rtcpinterval = 5000 ; Milliseconds between rtcp reports 22 | ;(min 500, max 60000, default 5000) 23 | ; 24 | ; Enable strict RTP protection. This will drop RTP packets that 25 | ; do not come from the source of the RTP stream. This option is 26 | ; enabled by default. 27 | ; strictrtp=yes 28 | ; 29 | ; Number of packets containing consecutive sequence values needed 30 | ; to change the RTP source socket address. This option only comes 31 | ; into play while using strictrtp=yes. Consider changing this value 32 | ; if rtp packets are dropped from one or both ends after a call is 33 | ; connected. This option is set to 4 by default. 34 | ; probation=8 35 | ; 36 | ; Whether to enable or disable ICE support. This option is disabled by default. 37 | ; icesupport=true 38 | ; 39 | ; Hostname or address for the STUN server used when determining the external 40 | ; IP address and port an RTP session can be reached at. The port number is 41 | ; optional. If omitted the default value of 3478 will be used. This option is 42 | ; disabled by default. 43 | ; 44 | ; e.g. stundaddr=mystun.server.com:3478 45 | ; 46 | ; stunaddr= 47 | ; 48 | ; Some multihomed servers have IP interfaces that cannot reach the STUN 49 | ; server specified by stunaddr. Blacklist those interface subnets from 50 | ; trying to send a STUN packet to find the external IP address. 51 | ; Attempting to send the STUN packet needlessly delays processing incoming 52 | ; and outgoing SIP INVITEs because we will wait for a response that can 53 | ; never come until we give up on the response. 54 | ; * Multiple subnets may be listed. 55 | ; * Blacklisting applies to IPv4 only. STUN isn't needed for IPv6. 56 | ; * Blacklisting applies when binding RTP to specific IP addresses and not 57 | ; the wildcard 0.0.0.0 address. e.g., A PJSIP endpoint binding RTP to a 58 | ; specific address using the bind_rtp_to_media_address and media_address 59 | ; options. Or the PJSIP endpoint specifies an explicit transport that binds 60 | ; to a specific IP address. 61 | ; 62 | ; e.g. stun_blacklist = 192.168.1.0/255.255.255.0 63 | ; stun_blacklist = 10.32.77.0/255.255.255.0 64 | ; 65 | ; stun_blacklist = 66 | ; 67 | ; Hostname or address for the TURN server to be used as a relay. The port 68 | ; number is optional. If omitted the default value of 3478 will be used. 69 | ; This option is disabled by default. 70 | ; 71 | ; e.g. turnaddr=myturn.server.com:34780 72 | ; 73 | ; turnaddr= 74 | ; 75 | ; Username used to authenticate with TURN relay server. 76 | ; turnusername= 77 | ; 78 | ; Password used to authenticate with TURN relay server. 79 | ; turnpassword= 80 | ; 81 | ; Subnets to exclude from ICE host, srflx and relay discovery. This is useful 82 | ; to optimize the ICE process where a system has multiple host address ranges 83 | ; and/or physical interfaces and certain of them are not expected to be used 84 | ; for RTP. For example, VPNs and local interconnections may not be suitable or 85 | ; necessary for ICE. Multiple subnets may be listed. If left unconfigured, 86 | ; all discovered host addresses are used. 87 | ; 88 | ; e.g. ice_blacklist = 192.168.1.0/255.255.255.0 89 | ; ice_blacklist = 10.32.77.0/255.255.255.0 90 | ; 91 | ; ice_blacklist = 92 | ; 93 | [ice_host_candidates] 94 | ; 95 | ; When Asterisk is behind a static one-to-one NAT and ICE is in use, ICE will 96 | ; expose the server's internal IP address as one of the host candidates. 97 | ; Although using STUN (see the 'stunaddr' configuration option) will provide a 98 | ; publicly accessible IP, the internal IP will still be sent to the remote 99 | ; peer. To help hide the topology of your internal network, you can override 100 | ; the host candidates that Asterisk will send to the remote peer. 101 | ; 102 | ; IMPORTANT: Only use this functionality when your Asterisk server is behind a 103 | ; one-to-one NAT and you know what you're doing. If you do define anything 104 | ; here, you almost certainly will NOT want to specify 'stunaddr' or 'turnaddr' 105 | ; above. 106 | ; 107 | ; The format for these overrides is: 108 | ; 109 | ; => 110 | ; 111 | ; The following will replace 192.168.1.10 with 1.2.3.4 during ICE 112 | ; negotiation: 113 | ; 114 | ;192.168.1.10 => 1.2.3.4 115 | ; 116 | ; You can define an override for more than 1 interface if you have a multihomed 117 | ; server. Any local interface that is not matched will be passed through 118 | ; unaltered. Both IPv4 and IPv6 addresses are supported. 119 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/sip_notify.conf: -------------------------------------------------------------------------------- 1 | ; rfc3842 2 | ; put empty "Content=>" at the end to have CRLF after last body line 3 | 4 | [clear-mwi] 5 | Event=>message-summary 6 | Content-type=>application/simple-message-summary 7 | Content=>Messages-Waiting: no 8 | Content=>Message-Account: sip:asterisk@127.0.0.1 9 | Content=>Voice-Message: 0/0 (0/0) 10 | Content=> 11 | 12 | ; Aastra 13 | 14 | [aastra-check-cfg] 15 | Event=>check-sync 16 | 17 | [aastra-xml] 18 | Event=>aastra-xml 19 | 20 | ; Digium 21 | 22 | [digium-check-cfg] 23 | Event=>check-sync 24 | 25 | ; Linksys 26 | 27 | [linksys-cold-restart] 28 | Event=>reboot_now 29 | 30 | [linksys-warm-restart] 31 | Event=>restart_now 32 | 33 | ; Polycom 34 | 35 | [polycom-check-cfg] 36 | Event=>check-sync 37 | 38 | ; Sipura 39 | 40 | [sipura-check-cfg] 41 | Event=>resync 42 | 43 | [sipura-get-report] 44 | Event=>report 45 | 46 | ; snom 47 | 48 | [snom-check-cfg] 49 | Event=>check-sync\;reboot=false 50 | 51 | [snom-reboot] 52 | Event=>check-sync\;reboot=true 53 | 54 | ; Cisco 55 | 56 | [cisco-check-cfg] 57 | Event=>check-sync 58 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/smdi.conf: -------------------------------------------------------------------------------- 1 | ; Asterisk SMDI configuration 2 | 3 | [interfaces] 4 | ; Specify serial ports to listen for SMDI messages on below. These will be 5 | ; referenced later in chan_dahdi.conf. If you do not specify any interfaces 6 | ; then SMDI will be disabled. Interfaces can have several different attributes 7 | ; associated with them. 8 | 9 | ; Set the number of stop bits to use per character here. The default is no, 10 | ; in which case one stop bit will be used. 11 | 12 | ;twostopbits = no 13 | 14 | ; Character size or bit length is the size of each character sent across the 15 | ; link. Character size can be 7 or 8. The default is 7. 16 | 17 | ;charsize = 7 18 | 19 | ; If you need parity checking enabled you can turn it on here. Acceptable 20 | ; values are even, odd, and none. The default is even. 21 | 22 | ;paritybit = even 23 | 24 | ; The baudrate to use for this port. Acceptable values are 1200, 2400, 4800, 25 | ; and 9600. The default is 9600. 26 | 27 | ;baudrate = 1200 28 | 29 | ; Often the numbering scheme for a set of mailboxes or extensions will not be 7 30 | ; or 10 digits (as SMDI requires). Use the msdstrip option to strip unused 31 | ; digits from the start of numbers. 32 | 33 | ;msdstrip = 0 34 | 35 | ; Occasionally Asterisk and the SMDI switch may become out of sync. If this 36 | ; happens, Asterisk will appear one or several calls behind as it processes 37 | ; voicemail requests. To prevent this from happening, adjust the msgexpirytime. 38 | ; This will make Asterisk discard old SMDI messages that have not yet been 39 | ; processed. The default expiry time is 30000 milliseconds. 40 | 41 | ;msgexpirytime = 30000 42 | 43 | ;smdiport => /dev/ttyS0 44 | 45 | 46 | [mailboxes] 47 | ; This section configures parameters related to MWI handling for the SMDI link. 48 | 49 | ; This option configures the polling interval used to check to see if the 50 | ; mailboxes have any new messages. This option is specified in seconds. 51 | ; The default value is 10 seconds. 52 | ; 53 | ;pollinginterval=10 54 | 55 | ; Every other entry in this section of the configuration file is interpreted as 56 | ; a mapping between the mailbox ID on the SMDI link, and the local Asterisk 57 | ; mailbox name. In many cases, they are the same thing, but they still must be 58 | ; listed here so that this module knows which mailboxes it needs to pay 59 | ; attention to. 60 | ; 61 | ; Syntax: 62 | ; =[@Asterisk Voicemail Context] 63 | ; 64 | ; If no Asterisk voicemail context is specified, "default" will be assumed. 65 | ; 66 | ; Before specifying mailboxes, you must specify an SMDI interface. All mailbox 67 | ; definitions that follow will correspond to that SMDI interface. If you specify 68 | ; another interface, then all definitions following that will correspond to the 69 | ; new interface. 70 | ; 71 | ;smdiport=/dev/ttyS0 72 | ;2565551234=1234@vmcontext1 73 | ;2565555678=5678@vmcontext2 74 | ;smdiport=/dev/ttyS1 75 | ;2565559999=9999 76 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/sorcery.conf: -------------------------------------------------------------------------------- 1 | ; Sample configuration file for Sorcery Data Access Layer 2 | 3 | ; 4 | ; Wizards 5 | ; 6 | ; Wizards are the persistence mechanism for objects. They are loaded as Asterisk modules and register 7 | ; themselves with the sorcery core. All implementation specific details of how objects are persisted is isolated 8 | ; within wizards. 9 | ; 10 | 11 | ; 12 | ; Caching 13 | ; 14 | ; A wizard can optionally be marked as an object cache by adding "/cache" to the object type within the mapping. 15 | ; If an object is returned from a non-object cache it is immediately given to the cache to be created. Multiple 16 | ; object caches can be configured for a single object type. 17 | ; 18 | 19 | ; 20 | ; Object Type Mappings 21 | ; 22 | ; To allow configuration of where and how an object is persisted object mappings can be defined within this file 23 | ; on a per-module basis. The mapping consists of the object type, options, wizard name, and wizard configuration 24 | ; data. This has the following format: 25 | ; 26 | ; object type [/options] = wizard name, wizard configuration data 27 | ; 28 | ; For example to configure an in-memory wizard for the 'bob' object type: 29 | ; 30 | ; bob = memory 31 | ; 32 | ; Or to configure the object type 'joe' from a configuration file: 33 | ; 34 | ; joe = config,joe.conf 35 | ; 36 | ; Note that an object type can have multiple mappings defined. Each mapping will be consulted in the order in which 37 | ; it appears within the configuration file. This means that if you are configuring a wizard as a cache it should 38 | ; appear as the first mapping so the cache is consulted before all other mappings. 39 | ; 40 | 41 | ; 42 | ; The following object mappings are used by the unit test to test certain functionality of sorcery. 43 | ; 44 | [test_sorcery_section] 45 | test=memory 46 | 47 | [test_sorcery_cache] 48 | test/cache=test 49 | test=memory 50 | 51 | ; 52 | ; The following object mapping is the default mapping of external MWI mailbox 53 | ; objects to give persistence to the message counts. 54 | ; 55 | ;[res_mwi_external] 56 | ;mailboxes=astdb,mwi_external 57 | 58 | ; 59 | ; The following object mappings set PJSIP objects to use realtime database mappings from extconfig 60 | ; with the table names used when automatically generating configuration from the alembic script. 61 | ; 62 | ;[res_pjsip] 63 | ;endpoint=realtime,ps_endpoints 64 | ;auth=realtime,ps_auths 65 | ;aor=realtime,ps_aors 66 | ;domain_alias=realtime,ps_domain_aliases 67 | 68 | ;[res_pjsip_endpoint_identifier_ip] 69 | ;identify=realtime,ps_endpoint_id_ips 70 | 71 | ;[res_pjsip_outbound_publish] 72 | ;outbound-publish=realtime,ps_outbound_publishes 73 | 74 | ;[res_pjsip_pubsub] 75 | ;inbound-publication=realtime,ps_inbound_publications 76 | 77 | ;[res_pjsip_publish_asterisk] 78 | ;asterisk-publication=realtime,ps_asterisk_publications 79 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/ss7.timers: -------------------------------------------------------------------------------- 1 | ;;;;; ITU-T Q.707 timers 2 | 3 | ;mtp3_timer.q707_t1 = 4000 4 | ;mtp3_timer.q707_t2 = 30000 5 | 6 | ;;;;; MTP3 timers as specified in ITU-T Q.704 or ANSI T1.111-2001 7 | 8 | mtp3_timer.t1 = 500 9 | mtp3_timer.t2 = 700 10 | mtp3_timer.t3 = 500 11 | mtp3_timer.t4 = 500 12 | mtp3_timer.t5 = 500 13 | mtp3_timer.t6 = 500 14 | mtp3_timer.t7 = 1000 15 | 16 | mtp3_timer.t10 = 60000 17 | 18 | mtp3_timer.t12 = 800 19 | mtp3_timer.t13 = 800 20 | mtp3_timer.t14 = 2000 21 | 22 | ; enable for ITU only. Timers after T17 are defined differently for ANSI 23 | ;mtp3_timer.t19 = 67000 24 | ;mtp3_timer.t21 = 63000 25 | ; 26 | ;mtp3_timer.t22 = 300000 27 | ;mtp3_timer.t23 = 300000 28 | 29 | 30 | ;;;;; ISUP timers as specified in ITU-T Q.764 or ANSI T1.113-2000 31 | 32 | isup_timer.t1 = 15000 33 | ;isup_timer.t2 = 180000 ; ITU only 34 | 35 | ;isup_timer.t5 = 300000 ; for ITU 36 | ;isup_timer.t5 = 60000 ; for ANSI 37 | isup_timer.t6 = 30000 38 | isup_timer.t7 = 20000 39 | isup_timer.t8 = 10000 40 | 41 | ;isup_timer.t10 = 4000 ; ITU only 42 | 43 | isup_timer.t12 = 15000 44 | ;isup_timer.t13 = 300000 ; for ITU 45 | ;isup_timer.t13 = 60000 ; for ANSI 46 | isup_timer.t14 = 15000 47 | ;isup_timer.t15 = 300000 ; for ITU 48 | ;isup_timer.t15 = 60000 ; for ANSI 49 | isup_timer.t16 = 15000 50 | ;isup_timer.t17 = 300000 ; for ITU 51 | ;isup_timer.t17 = 60000 ; for ANSI 52 | isup_timer.t18 = 15000 53 | ;isup_timer.t19 = 300000 ; for ITU 54 | ;isup_timer.t19 = 60000 ; for ANSI 55 | isup_timer.t20 = 15000 56 | ;isup_timer.t21 = 300000 ; for ITU 57 | ;isup_timer.t21 = 60000 ; for ANSI 58 | isup_timer.t22 = 15000 59 | ;isup_timer.t23 = 300000 ; for ITU 60 | ;isup_timer.t23 = 60000 ; for ANSI 61 | 62 | isup_timer.t27 = 240000 63 | 64 | isup_timer.t33 = 12000 65 | ;isup_timer.t35 = 15000 ; ITU only 66 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/stasis.conf: -------------------------------------------------------------------------------- 1 | [threadpool] 2 | ;initial_size = 5 ; Initial size of the threadpool. 3 | ; ; 0 means the threadpool has no threads initially 4 | ; ; until a task needs a thread. 5 | ;idle_timeout_sec = 20 ; Number of seconds a thread should be idle before 6 | ; ; dying. 0 means threads never time out. 7 | ;max_size = 50 ; Maximum number of threads in the Stasis threadpool. 8 | ; ; 0 means no limit to the number of threads in the 9 | ; ; threadpool. 10 | 11 | [declined_message_types] 12 | ; This config section contains the names of message types that should be prevented 13 | ; from being created. By default, all message types are allowed to be created. 14 | ; 15 | ; Using this functionality requires knowledge of the names of internal stasis 16 | ; message types which is generally the same as the name of the accessor function. 17 | ; 18 | ; Use of this functionality may break more complex functionality in Asterisk 19 | ; such as CEL, CDR, transfers, etc. and will likely cause related messages in ARI 20 | ; and AMI to go missing. 21 | ; decline=stasis_app_recording_snapshot_type 22 | ; decline=stasis_app_playback_snapshot_type 23 | ; decline=stasis_test_message_type 24 | ; decline=confbridge_start_type 25 | ; decline=confbridge_end_type 26 | ; decline=confbridge_join_type 27 | ; decline=confbridge_leave_type 28 | ; decline=confbridge_start_record_type 29 | ; decline=confbridge_stop_record_type 30 | ; decline=confbridge_mute_type 31 | ; decline=confbridge_unmute_type 32 | ; decline=confbridge_talking_type 33 | ; decline=cel_generic_type 34 | ; decline=ast_bridge_snapshot_type 35 | ; decline=ast_bridge_merge_message_type 36 | ; decline=ast_channel_entered_bridge_type 37 | ; decline=ast_channel_left_bridge_type 38 | ; decline=ast_blind_transfer_type 39 | ; decline=ast_attended_transfer_type 40 | ; decline=ast_endpoint_snapshot_type 41 | ; decline=ast_endpoint_state_type 42 | ; decline=ast_device_state_message_type 43 | ; decline=ast_test_suite_message_type 44 | ; decline=ast_mwi_state_type 45 | ; decline=ast_mwi_vm_app_type 46 | ; decline=ast_format_register_type 47 | ; decline=ast_format_unregister_type 48 | ; decline=ast_manager_get_generic_type 49 | ; decline=ast_parked_call_type 50 | ; decline=ast_channel_snapshot_type 51 | ; decline=ast_channel_dial_type 52 | ; decline=ast_channel_varset_type 53 | ; decline=ast_channel_hangup_request_type 54 | ; decline=ast_channel_dtmf_begin_type 55 | ; decline=ast_channel_dtmf_end_type 56 | ; decline=ast_channel_hold_type 57 | ; decline=ast_channel_unhold_type 58 | ; decline=ast_channel_chanspy_start_type 59 | ; decline=ast_channel_chanspy_stop_type 60 | ; decline=ast_channel_fax_type 61 | ; decline=ast_channel_hangup_handler_type 62 | ; decline=ast_channel_moh_start_type 63 | ; decline=ast_channel_moh_stop_type 64 | ; decline=ast_channel_monitor_start_type 65 | ; decline=ast_channel_monitor_stop_type 66 | ; decline=ast_channel_agent_login_type 67 | ; decline=ast_channel_agent_logoff_type 68 | ; decline=ast_channel_talking_start 69 | ; decline=ast_channel_talking_stop 70 | ; decline=ast_security_event_type 71 | ; decline=ast_named_acl_change_type 72 | ; decline=ast_local_bridge_type 73 | ; decline=ast_local_optimization_begin_type 74 | ; decline=ast_local_optimization_end_type 75 | ; decline=stasis_subscription_change_type 76 | ; decline=ast_multi_user_event_type 77 | ; decline=stasis_cache_clear_type 78 | ; decline=stasis_cache_update_type 79 | ; decline=ast_network_change_type 80 | ; decline=ast_system_registry_type 81 | ; decline=ast_cc_available_type 82 | ; decline=ast_cc_offertimerstart_type 83 | ; decline=ast_cc_requested_type 84 | ; decline=ast_cc_requestacknowledged_type 85 | ; decline=ast_cc_callerstopmonitoring_type 86 | ; decline=ast_cc_callerstartmonitoring_type 87 | ; decline=ast_cc_callerrecalling_type 88 | ; decline=ast_cc_recallcomplete_type 89 | ; decline=ast_cc_failure_type 90 | ; decline=ast_cc_monitorfailed_type 91 | ; decline=ast_presence_state_message_type 92 | ; decline=ast_rtp_rtcp_sent_type 93 | ; decline=ast_rtp_rtcp_received_type 94 | ; decline=ast_call_pickup_type 95 | ; decline=aoc_s_type 96 | ; decline=aoc_d_type 97 | ; decline=aoc_e_type 98 | ; decline=dahdichannel_type 99 | ; decline=mcid_type 100 | ; decline=session_timeout_type 101 | ; decline=cdr_read_message_type 102 | ; decline=cdr_write_message_type 103 | ; decline=cdr_prop_write_message_type 104 | ; decline=corosync_ping_message_type 105 | ; decline=agi_exec_start_type 106 | ; decline=agi_exec_end_type 107 | ; decline=agi_async_start_type 108 | ; decline=agi_async_exec_type 109 | ; decline=agi_async_end_type 110 | ; decline=queue_caller_join_type 111 | ; decline=queue_caller_leave_type 112 | ; decline=queue_caller_abandon_type 113 | ; decline=queue_member_status_type 114 | ; decline=queue_member_added_type 115 | ; decline=queue_member_removed_type 116 | ; decline=queue_member_pause_type 117 | ; decline=queue_member_penalty_type 118 | ; decline=queue_member_ringinuse_type 119 | ; decline=queue_agent_called_type 120 | ; decline=queue_agent_connect_type 121 | ; decline=queue_agent_complete_type 122 | ; decline=queue_agent_dump_type 123 | ; decline=queue_agent_ringnoanswer_type 124 | ; decline=meetme_join_type 125 | ; decline=meetme_leave_type 126 | ; decline=meetme_end_type 127 | ; decline=meetme_mute_type 128 | ; decline=meetme_talking_type 129 | ; decline=meetme_talk_request_type 130 | ; decline=appcdr_message_type 131 | ; decline=forkcdr_message_type 132 | ; decline=cdr_sync_message_type 133 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/statsd.conf: -------------------------------------------------------------------------------- 1 | [general] 2 | ;enabled = yes ; When set to yes, statsd support is enabled 3 | ;server = 127.0.0.1 ; server[:port] of statsd server to use. 4 | ; If not specified, the port is 8125 5 | ;prefix = ; Prefix to prepend to all metrics 6 | ;add_newline = no ; Append a newline to every event. This is 7 | ; useful if you want to run a fake statsd 8 | ; server using netcat (nc -lu 8125) 9 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/telcordia-1.adsi: -------------------------------------------------------------------------------- 1 | ; 2 | ; Asterisk default ADSI script 3 | ; 4 | ; 5 | ; Begin with the preamble requirements 6 | ; 7 | DESCRIPTION "Telcordia Demo" ; Name of vendor 8 | VERSION 0x02 ; Version of stuff 9 | ;SECURITY "_AST" ; Security code 10 | SECURITY 0x0000 ; Security code 11 | FDN 0x0000000f ; Descriptor number 12 | 13 | ; 14 | ; Predefined strings 15 | ; 16 | DISPLAY "talkingto" IS "Talking To" "$Call1p" WRAP 17 | DISPLAY "titles" IS "20th Century IQ Svc" 18 | DISPLAY "newcall" IS "New Call From" "$Call1p" WRAP 19 | DISPLAY "ringing" IS "Ringing" 20 | 21 | ; 22 | ; Begin state definitions 23 | ; 24 | STATE "callup" ; Call is currently up 25 | STATE "inactive" ; No active call 26 | 27 | ; 28 | ; Begin soft key definitions 29 | ; 30 | KEY "CB_OH" IS "Block" OR "Call Block" 31 | OFFHOOK 32 | VOICEMODE 33 | WAITDIALTONE 34 | SENDDTMF "*60" 35 | SUBSCRIPT "offHook" 36 | ENDKEY 37 | 38 | KEY "CB" IS "Block" OR "Call Block" 39 | SENDDTMF "*60" 40 | ENDKEY 41 | 42 | ; 43 | ; Begin main subroutine 44 | ; 45 | 46 | SUB "main" IS 47 | IFEVENT NEARANSWER THEN 48 | CLEAR 49 | SHOWDISPLAY "talkingto" AT 1 50 | GOTO "stableCall" 51 | ENDIF 52 | IFEVENT OFFHOOK THEN 53 | CLEAR 54 | SHOWDISPLAY "titles" AT 1 55 | SHOWKEYS "CB" 56 | GOTO "offHook" 57 | ENDIF 58 | IFEVENT IDLE THEN 59 | CLEAR 60 | SHOWDISPLAY "titles" AT 1 61 | SHOWKEYS "CB_OH" 62 | ENDIF 63 | IFEVENT CALLERID THEN 64 | CLEAR 65 | SHOWDISPLAY "newcall" AT 1 66 | ENDIF 67 | ENDSUB 68 | 69 | SUB "offHook" IS 70 | IFEVENT FARRING THEN 71 | CLEAR 72 | SHOWDISPLAY "ringing" AT 1 73 | ENDIF 74 | IFEVENT FARANSWER THEN 75 | CLEAR 76 | SHOWDISPLAY "talkingto" AT 1 77 | GOTO "stableCall" 78 | ENDIF 79 | ENDSUB 80 | 81 | SUB "stableCall" IS 82 | 83 | ENDSUB 84 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/test_sorcery.conf: -------------------------------------------------------------------------------- 1 | ; This is a res_sorcery_config compatible file for the sorcery unit tests 2 | 3 | [hey] 4 | bob=98 5 | joe=41 6 | 7 | [hey2] 8 | type=zombies 9 | bob=97 10 | joe=40 11 | 12 | [hey3] 13 | bob=96 14 | joe=39 15 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/udptl.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; UDPTL Configuration (UDPTL is one of the transports for T.38) 3 | ; 4 | [general] 5 | ; 6 | ; UDPTL start and UDPTL end configure start and end addresses 7 | ; 8 | udptlstart=4000 9 | udptlend=4999 10 | ; 11 | ; Whether to enable or disable UDP checksums on UDPTL traffic 12 | ; 13 | ;udptlchecksums=no 14 | ; 15 | ; The number of error correction entries in a UDPTL packet 16 | ; 17 | udptlfecentries = 3 18 | ; 19 | ; The span over which parity is calculated for FEC in a UDPTL packet 20 | ; 21 | udptlfecspan = 3 22 | ; 23 | ; Some VoIP providers will only accept an offer with an even-numbered 24 | ; UDPTL port. Set this option so that Asterisk will only attempt to use 25 | ; even-numbered ports when negotiating T.38. Default is no. 26 | use_even_ports = no 27 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/unistim.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; chan_unistim configuration file. 3 | ; 4 | 5 | [general] 6 | port=5000 ; UDP port 7 | ; 8 | ; See https://wiki.asterisk.org/wiki/display/AST/IP+Quality+of+Service for a description of these parameters. 9 | ;tos=cs3 ; Sets TOS for signaling packets. 10 | ;tos_audio=ef ; Sets TOS for RTP audio packets. 11 | ;cos=3 ; Sets 802.1p priority for signaling packets. 12 | ;cos_audio=5 ; Sets 802.1p priority for RTP audio packets. 13 | ; 14 | ;debug=yes ; Enable debug (default no) 15 | ;keepalive=120 ; in seconds, default = 120 16 | ;public_ip= ; if asterisk is behind a nat, specify your public IP 17 | ;autoprovisioning=no ; Allow undeclared phones to register an extension. See README for important 18 | ; informations. no (default), yes, tn. 19 | ;mohsuggest=default 20 | ; ----------------------------- JITTER BUFFER CONFIGURATION -------------------------- 21 | ; jbenable = yes ; Enables the use of a jitterbuffer on the receiving side of a 22 | ; SIP channel. Defaults to "no". An enabled jitterbuffer will 23 | ; be used only if the sending side can create and the receiving 24 | ; side can not accept jitter. The SIP channel can accept jitter, 25 | ; thus a jitterbuffer on the receive SIP side will be used only 26 | ; if it is forced and enabled. 27 | 28 | ; jbforce = no ; Forces the use of a jitterbuffer on the receive side of a SIP 29 | ; channel. Defaults to "no". 30 | 31 | ; jbmaxsize = 200 ; Max length of the jitterbuffer in milliseconds. 32 | 33 | ; jbresyncthreshold = 1000 ; Jump in the frame timestamps over which the jitterbuffer is 34 | ; resynchronized. Useful to improve the quality of the voice, with 35 | ; big jumps in/broken timestamps, usually sent from exotic devices 36 | ; and programs. Defaults to 1000. 37 | 38 | ; jbimpl = fixed ; Jitterbuffer implementation, used on the receiving side of a SIP 39 | ; channel. Two implementations are currently available - "fixed" 40 | ; (with size always equals to jbmaxsize) and "adaptive" (with 41 | ; variable size, actually the new jb of IAX2). Defaults to fixed. 42 | 43 | ; jblog = no ; Enables jitterbuffer frame logging. Defaults to "no". 44 | ; ---------------------------------------------------------------------------------- 45 | 46 | 47 | ;[black] ; name of the device 48 | ;device=000ae4012345 ; mac address of the phone 49 | ;rtp_port=10000 ; RTP port used by the phone, default = 10000. RTCP = rtp_port+1 50 | ;rtp_method=0 ; If you don't have sound, you can try 1, 2 or 3, default = 0 51 | ; value 3 works on newer i2004, 1120E and 1140E 52 | ;status_method=0 ; If you don't see status text, try 1, default = 0 53 | ; value 1 works on 1120E and 1140E 54 | ;titledefault=Asterisk ; default = "TimeZone (your time zone)". 12 characters max 55 | ;height=3 ; default = 3, the number of display lines the device can show 56 | ; For example on a Nortel I2001 or I2002, set this to 1 57 | ;maintext0="you can insert" ; default = "Welcome", 24 characters max 58 | ;maintext1="a custom text" ; default = the name of the device, 24 characters max 59 | ;maintext2="(main page)" ; default = the public IP of the phone, 24 characters max 60 | ;dateformat=0 ; 0 (default) = 31Jan, 1 = Jan31, 2 = month/day, 3 = day/month 61 | ;timeformat=1 ; 0 = 0:00am ; 1 (default) = 0h00, 2 = 0:00 62 | ;contrast=8 ; define the contrast of the LCD. From 0 to 15. Default = 8 63 | ;country=us ; country (ccTLD) for dial tone frequency. See README, default = us 64 | ;language=ru ; language used for audio files and onscreen messages translate 65 | ;ringvolume=2 ; ring volume : 0,1,2,3, can be overrided by Dial(), default = 2 66 | ;ringstyle=3 ; ring style : 0 to 7, can be overrided by Dial(), default = 3 67 | ;cwvolume=2 ; ring volume : 0,1,2,3, default = 0 68 | ;cwstyle=3 ; ring style : 0 to 7, default = 2 69 | ;sharpdial=1 ; dial number by pressing #, default = 0 70 | ;dtmf_duration=0 ; DTMF playback duration (in milliseconds) 0..150 (0 = off (default), 150 = maximum) 71 | ;interdigit_timer=4000 ; timer for automatic dial after several digits of number entered (in ms, 0 is off) 72 | ;callhistory=1 ; 0 = disable, 1 = enable call history, default = 1 73 | ;callerid="Customer Support" <555-234-5678> 74 | ;context=default ; context, default="default" 75 | ;mailbox=1234 ; Specify the mailbox number. Used by Message Waiting Indication 76 | ;linelabel="Support" ; Softkey label for the next line=> entry, 9 char max. 77 | ;extension=none ; Add an extension into the dialplan. Only valid in context specified previously. 78 | ; none=don't add (default), ask=prompt user, line=use the line number 79 | ;line => 100 ; Any number of lines can be defined in any order with bookmarks 80 | ;line => 200 ; After line defined it placed in next available slot 81 | ;bookmark=Hans C.@123 ; Use a softkey to dial 123. Name : 9 char max 82 | ;bookmark=Mailbox@011@54 ; 54 shows a mailbox icon. See #define FAV_ICON_ for other values (32 to 63) 83 | ;bookmark=Test@*@USTM/violet ; Display an icon if violet is connected (dynamic), only for unistim device 84 | ;bookmark=4@Pager@54321@51 ; Display a pager icon and dial 54321 when softkey 4 is pressed 85 | 86 | ;[violet] 87 | ;device=006038abcdef 88 | ;line => 102 89 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/users.conf: -------------------------------------------------------------------------------- 1 | ; 2 | ; User configuration 3 | ; 4 | ; Creating entries in users.conf is a "shorthand" for creating individual 5 | ; entries in each configuration file. Using users.conf is not intended to 6 | ; provide you with as much flexibility as using the separate configuration 7 | ; files (e.g. sip.conf, iax.conf, etc) but is intended to accelerate the 8 | ; simple task of adding users. Note that creating individual items (e.g. 9 | ; custom SIP peers, IAX friends, etc.) will allow you to override specific 10 | ; parameters within this file. Parameter names here are the same as they 11 | ; appear in the other configuration files. There is no way to change the 12 | ; value of a parameter here for just one subsystem. 13 | ; 14 | 15 | [general] 16 | ; 17 | ; Full name of a user 18 | ; 19 | fullname = New User 20 | ; 21 | ; Starting point of allocation of extensions 22 | ; 23 | userbase = 6000 24 | ; 25 | ; Create voicemail mailbox and use use macro-stdexten 26 | ; 27 | hasvoicemail = yes 28 | ; 29 | ; Set voicemail mailbox 6000 password to 1234 30 | ; 31 | vmsecret = 1234 32 | ; 33 | ; Create SIP Peer 34 | ; 35 | hassip = yes 36 | ; 37 | ; Create IAX friend 38 | ; 39 | hasiax = yes 40 | ; 41 | ; Create H.323 friend 42 | ; 43 | ;hash323 = yes 44 | ; 45 | ; Create manager entry 46 | ; 47 | hasmanager = no 48 | ; 49 | ; Set permissions for manager entry (see manager.conf.sample for documentation) 50 | ; (defaults to *all* permissions) 51 | ;managerread = system,call,log,verbose,command,agent,user,config 52 | ;managerwrite = system,call,log,verbose,command,agent,user,config 53 | ; 54 | ; 55 | ; MAC Address for res_phoneprov 56 | ; 57 | ;macaddress = 112233445566 58 | ; 59 | ; Auto provision the phone with res_phoneprov 60 | ; 61 | ;autoprov = yes 62 | ; 63 | ; Line Keys for hardphone 64 | ; 65 | ;LINEKEYS = 1 66 | ; 67 | ; Line number for hardphone 68 | ; 69 | ;linenumber = 1 70 | ; 71 | ; Local Caller ID number used with res_phoneprov and Asterisk GUI 72 | ; 73 | ;cid_number = 6000 74 | ; 75 | ; Remaining options are not specific to users.conf entries but are general. 76 | ; 77 | callwaiting = yes 78 | threewaycalling = yes 79 | callwaitingcallerid = yes 80 | transfer = yes 81 | canpark = yes 82 | cancallforward = yes 83 | callreturn = yes 84 | callgroup = 1 85 | pickupgroup = 1 86 | ;nat = no 87 | 88 | ;[6000] 89 | ;fullname = Joe User 90 | ;description = Courtesy Phone In Lobby ; Used to provide a description of the 91 | ; peer in console output 92 | ;email = joe@foo.bar 93 | ;secret = 1234 94 | ;dahdichan = 1 95 | ;hasvoicemail = yes 96 | ;vmsecret = 1234 97 | ;hassip = yes 98 | ;hasiax = no 99 | ;hash323 = no 100 | ;hasmanager = no 101 | ;callwaiting = no 102 | ;context = international 103 | ; 104 | ; Some administrators choose alphanumeric extensions, but still want their 105 | ; users to be reachable by traditional numeric extensions, specified by the 106 | ; alternateexts entry. 107 | ; 108 | ;alternateexts = 7057,3249 109 | ;macaddress = 112233445566 110 | ;autoprov = yes 111 | ;LINEKEYS = 1 112 | ;linenumber = 1 113 | ;cid_number = 6000 114 | 115 | -------------------------------------------------------------------------------- /ansible/files/asterisk/etc/xmpp.conf: -------------------------------------------------------------------------------- 1 | [general] 2 | ;debug=yes ; Enable debugging (disabled by default). 3 | ;autoprune=yes ; Auto remove users from buddy list. Depending on your 4 | ; setup (ie, using your personal Gtalk account for a test) 5 | ; you might lose your contacts list. Default is 'no'. 6 | ;autoregister=yes ; Auto register users from buddy list. 7 | ;collection_nodes=yes ; Enable support for XEP-0248 for use with 8 | ; distributed device state. Default is 'no'. 9 | ;pubsub_autocreate=yes ; Whether or not the PubSub server supports/is using 10 | ; auto-create for nodes. If it is, we have to 11 | ; explicitly pre-create nodes before publishing them. 12 | ; Default is 'no'. 13 | ;auth_policy=accept ; Auto accept users' subscription requests (default). 14 | ; Set to deny for auto denial. 15 | ;[asterisk] 16 | ;type=client ; Client or Component connection 17 | ;serverhost=astjab.org ; Route to server for example, talk.google.com 18 | ;pubsub_node=pubsub.astjab.org ; Node to use for publishing events via PubSub 19 | ;username=asterisk@astjab.org/asterisk ; Username with optional resource. 20 | ;secret=blah ; Password 21 | ;refresh_token=TOKEN_VALUE ; Refresh token issued by Google OAuth 2.0 protocol. 22 | ; `secret` must NOT be set if you use OAuth. 23 | ; See https://developers.google.com/identity/protocols/OAuth2WebServer 24 | ; for more details. 25 | ; For test reasons you can obtain one on the page 26 | ; https://developers.google.com/oauthplayground/ 27 | ; 1. Click on Settings icon, check "Use your own OAuth credentials" 28 | ; and enter your Client ID and Client Secret (see below). 29 | ; 2. Input the scope https://www.googleapis.com/auth/googletalk 30 | ; and push "Authorize APIs" button. 31 | ; 3. Approve permissions. 32 | ; 4. On section "Step 2" push "Exchange authorization code for tokens" 33 | ; and get your Refresh token. 34 | ;oauth_clientid=OAUTH_CLIENT_ID_VALUE ; The application's client id to authorize using Google OAuth 2.0 protocol. 35 | ;oauth_secret=OAUTH_SECRET_VALUE ; The application's client secret to authorize using Google OAuth 2.0 protocol. 36 | ; 1. Create new Project on the page: 37 | ; https://console.cloud.google.com/apis/credentials/oauthclient 38 | ; 2. Create new Application ID on the same page with type Web-application. 39 | ; In section "Allowed URI redirections" put the path to the corresponding 40 | ; script on your site or https://developers.google.com/oauthplayground 41 | ; if you would like to obtain refresh_token from users by hand 42 | ; (for example, for test reasons). 43 | ; 3. Client ID and Client Secret will be shown and available on the same page. 44 | ;priority=1 ; Resource priority 45 | ;port=5222 ; Port to use defaults to 5222 46 | ;usetls=yes ; Use tls or not 47 | ;usesasl=yes ; Use sasl or not 48 | ;buddy=mogorman@astjab.org ; Manual addition of buddy to list. 49 | ; For distributed events, these buddies are 50 | ; automatically added in the whitelist as 51 | ; 'owners' of the node(s). 52 | ;distribute_events=yes ; Whether or not to distribute events using 53 | ; this connection. Default is 'no'. 54 | ;status=available ; One of: chat, available, away, xaway, or dnd 55 | ;statusmessage="I am available" ; Have custom status message for Asterisk 56 | ;timeout=5 ; Timeout (in seconds) on the message stack, defaults to 5. 57 | ; Messages stored longer than this value will be deleted by Asterisk. 58 | ; This option applies to incoming messages only, which are intended to 59 | ; be processed by the JABBER_RECEIVE dialplan function. 60 | ;sendtodialplan=yes ; Send incoming messages into the dialplan. Off by default. 61 | ;context=messages ; Dialplan context to send incoming messages to. If not set, 62 | ; "default" will be used. 63 | ;forceoldssl=no ; Force the use of old-style SSL. 64 | ;keepalive= 65 | 66 | -------------------------------------------------------------------------------- /ansible/inventories/production: -------------------------------------------------------------------------------- 1 | [asterisk] 2 | callcenter.local 3 | 4 | [asterisk:vars] 5 | -------------------------------------------------------------------------------- /ansible/playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: asterisk 3 | remote_user: deploy 4 | become: yes 5 | vars: 6 | - redis_bind_interface: 0.0.0.0 7 | roles: 8 | - ansible-role-redis 9 | 10 | tasks: 11 | - name: install packages 12 | apt: name={{ item }} update_cache=yes state=latest cache_valid_time=86400 13 | with_items: 14 | - asterisk 15 | - asterisk-modules 16 | - asterisk-config 17 | - asterisk-core-sounds-en 18 | - asterisk-core-sounds-en-gsm 19 | - asterisk-moh-opsound-gsm 20 | - composer 21 | - php-cli 22 | - php-common 23 | - php-json 24 | - php-mbstring 25 | - php-bcmath 26 | - php-intl 27 | - php-dev 28 | - php-pear 29 | - php-redis 30 | 31 | - name: create project folder 32 | file: 33 | path: /opt/callcenter 34 | state: directory 35 | mode: 0755 36 | 37 | - name: create project log folder 38 | file: 39 | path: /opt/callcenter/log 40 | state: directory 41 | mode: 0777 42 | recurse: true 43 | 44 | - name: copy PHP source 45 | copy: 46 | src: "{{ item }}" 47 | dest: /opt/callcenter 48 | with_items: 49 | - ../server.php 50 | - ../src 51 | - ../composer.json 52 | - ../composer.lock 53 | 54 | - name: copy environment file 55 | copy: 56 | src: .env 57 | dest: /opt/callcenter 58 | 59 | - name: copy static source 60 | copy: 61 | src: "{{ item }}" 62 | dest: /usr/share/asterisk/static-http 63 | with_items: 64 | - ../public/static/ 65 | 66 | - name: install PHP dependencies with Composer 67 | command: composer install --no-dev --prefer-dist 68 | args: 69 | chdir: /opt/callcenter 70 | 71 | - name: copy asterisk etc folder to project 72 | synchronize: 73 | src: asterisk/etc/ 74 | dest: /etc/asterisk/ 75 | notify: 76 | - reload asterisk 77 | 78 | - name: Kill PHP processes 79 | command: killall php 80 | ignore_errors: yes 81 | 82 | - debug: msg="Restart PHP processes" 83 | changed_when: True 84 | notify: 85 | - start server 86 | 87 | handlers: 88 | - name: reload asterisk 89 | shell: asterisk -rx'core reload' 90 | 91 | - name: start server 92 | shell: cd /opt/callcenter; nohup php /opt/callcenter/server.php /dev/null 2>&1 & 93 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mor10am/callcenter", 3 | "description": "Example callcenter for Asterisk and PHP", 4 | "type": "project", 5 | "require": { 6 | "php" : ">= 7.1", 7 | "monolog/monolog": "^1.23", 8 | "cboden/ratchet": "^0.4.1", 9 | "marcelog/pami": "^2.0", 10 | "symfony/dotenv": "^4.1" 11 | }, 12 | "license": "Apache-2.0", 13 | "authors": [ 14 | { 15 | "name": "Morten Amundsen", 16 | "email": "mor10am@gmail.com" 17 | } 18 | ], 19 | "autoload": { 20 | "psr-0": { 21 | "Callcenter\\": "src/" 22 | } 23 | }, 24 | "require-dev": { 25 | "phpstan/phpstan": "^0.10.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /dashboard.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #nohup google-chrome public/static/index.html & 4 | nohup google-chrome http://callcenter.local:8088/static/index.html & 5 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ansible-playbook ansible/playbook.yml -i ansible/inventories/production 4 | -------------------------------------------------------------------------------- /log/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mor10am/callcenter/3a673d9cbb83ef493d7fc8465ebeab64d3db771c/log/.gitkeep -------------------------------------------------------------------------------- /public/static/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.1.3 (https://getbootstrap.com/) 3 | * Copyright 2011-2018 The Bootstrap Authors 4 | * Copyright 2011-2018 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /public/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mor10am/callcenter/3a673d9cbb83ef493d7fc8465ebeab64d3db771c/public/static/favicon.ico -------------------------------------------------------------------------------- /server.php: -------------------------------------------------------------------------------- 1 | load(__DIR__.'/.env'); 10 | } catch (\Symfony\Component\Dotenv\Exception\PathException $e) { 11 | die(".env file is missing!\n"); 12 | } 13 | 14 | $env = getenv('ENV'); 15 | 16 | if ($env == 'production') { 17 | if (function_exists('xdebug_disable')) { 18 | xdebug_disable(); 19 | } 20 | } 21 | 22 | $logger = new Monolog\Logger('callcenter'); 23 | $logger->pushHandler(new Monolog\Handler\StreamHandler('log/callcenter.log')); 24 | 25 | $loop = React\EventLoop\Factory::create(); 26 | 27 | $websockethandler = new \Callcenter\WebsocketHandler($logger); 28 | 29 | $app = new Ratchet\App( 30 | getenv('WSSERVERADDRESS'), 31 | getenv('WSSERVERPORT'), 32 | '0.0.0.0', 33 | $loop 34 | ); 35 | 36 | $app->route( 37 | '/callcenter', 38 | $websockethandler, 39 | ['*'] 40 | ); 41 | 42 | $logger->debug("Started websocket at ".getenv('WSSERVERADDRESS').":".getenv('WSSERVERPORT')); 43 | 44 | try { 45 | $ami = new \React\Stream\DuplexResourceStream( 46 | stream_socket_client(getenv('ASTERISKSERVER')), 47 | $loop 48 | ); 49 | } catch (\Exception $e) { 50 | die($e->getMessage()); 51 | } 52 | 53 | $logger->debug("Connected to Asterisk at " . getenv('ASTERISKSERVER')); 54 | 55 | $asteriskmanager = new Callcenter\AsteriskManager($ami); 56 | 57 | $asteriskmanager->setLogger($logger); 58 | 59 | $reportwriter = new \Callcenter\Report\File(__DIR__."/report.csv"); 60 | 61 | $redis = new \Redis(); 62 | $redis->connect( 63 | getenv('REDIS_SERVER') 64 | ); 65 | 66 | $callcenter = new Callcenter\Callcenter( 67 | $websockethandler, 68 | $asteriskmanager, 69 | $reportwriter, 70 | $redis, 71 | $logger 72 | ); 73 | 74 | $websockethandler->on('websocket.hello', [$callcenter, 'websocketHello']); 75 | $websockethandler->on('websocket.avail', [$callcenter, 'websocketSetAgentAvail']); 76 | $websockethandler->on('websocket.pause', [$callcenter, 'websocketSetAgentPause']); 77 | 78 | $asteriskmanager->on('agent.loggedin', [$callcenter, 'agentLoggedIn']); 79 | $asteriskmanager->on('agent.loggedout', [$callcenter, 'agentLoggedOut']); 80 | $asteriskmanager->on('agent.paused', [$callcenter, 'agentPaused']); 81 | $asteriskmanager->on('agent.avail', [$callcenter, 'agentAvail']); 82 | 83 | $asteriskmanager->on('caller.new', [$callcenter, 'callNew']); 84 | $asteriskmanager->on('caller.hangup', [$callcenter, 'callHangup']); 85 | $asteriskmanager->on('caller.queued', [$callcenter, 'callQueued']); 86 | 87 | $asteriskmanager->on('queue.connect', [$callcenter, 'callAndAgentConnected']); 88 | 89 | $asteriskmanager->login( 90 | getenv('AMI_USERNAME'), 91 | getenv('AMI_PASSWORD') 92 | ); 93 | 94 | $logger->info("Callcenter server started [{$env}]."); 95 | 96 | $app->run(); 97 | -------------------------------------------------------------------------------- /src/Callcenter/CallcenterEvent.php: -------------------------------------------------------------------------------- 1 | type = $type; 24 | $this->data = $data; 25 | } 26 | 27 | /** 28 | * @return string 29 | */ 30 | public function getType() : string 31 | { 32 | return $this->type; 33 | } 34 | 35 | /** 36 | * @param string $field 37 | * @return mixed 38 | */ 39 | public function __get(string $field) 40 | { 41 | if (!isset($this->data[$field])) { 42 | throw new \OutOfBoundsException("Field $field not found in event"); 43 | } 44 | 45 | return $this->data[$field]; 46 | } 47 | 48 | /** 49 | * @param string $field 50 | * @param mixed $default 51 | * @return mixed 52 | */ 53 | public function get(string $field, $default = null) 54 | { 55 | if (!isset($this->data[$field])) { 56 | return $default; 57 | } 58 | 59 | return $this->data[$field]; 60 | } 61 | } -------------------------------------------------------------------------------- /src/Callcenter/Model/Agent.php: -------------------------------------------------------------------------------- 1 | agentid = $agentid; 41 | 42 | if ($member) { 43 | $this->member = $member; 44 | } 45 | 46 | $this->time = time(); 47 | } 48 | 49 | /** 50 | * @param string $member 51 | */ 52 | public function setMember(string $member) : void 53 | { 54 | $this->member = $member; 55 | } 56 | 57 | /** 58 | * @return string 59 | */ 60 | public function getMember() : string 61 | { 62 | return $this->member; 63 | } 64 | 65 | /** 66 | * @return string 67 | */ 68 | public function getStatus() : string 69 | { 70 | return $this->status; 71 | } 72 | 73 | /** 74 | * @return int 75 | */ 76 | public function getDuration() : int 77 | { 78 | return time() - $this->time; 79 | } 80 | 81 | /** 82 | * @return string 83 | */ 84 | public function getAgentId() : string 85 | { 86 | return $this->agentid; 87 | } 88 | 89 | /** 90 | * @return string 91 | */ 92 | public function getQueue() : string 93 | { 94 | return $this->queue; 95 | } 96 | 97 | /** 98 | * @var string $queue 99 | */ 100 | public function setQueue(string $queue) : void 101 | { 102 | $this->queue = $queue; 103 | } 104 | 105 | /** 106 | * @param string $status 107 | * @return bool 108 | */ 109 | public function setStatus(string $status) : bool 110 | { 111 | $status = strtoupper($status); 112 | 113 | if ($this->status == $status) { 114 | return false; 115 | } 116 | 117 | if ($status != 'INCALL') { 118 | $this->queue = ""; 119 | } 120 | 121 | $this->status = $status; 122 | $this->time = time(); 123 | 124 | return true; 125 | } 126 | 127 | /** 128 | * @return string 129 | */ 130 | public function __toString() : string 131 | { 132 | return "{$this->agentid}|{$this->status}"; 133 | } 134 | 135 | /** 136 | * @return array 137 | */ 138 | public function jsonSerialize() 139 | { 140 | return [ 141 | 'type' => 'AGENT', 142 | 'agentid' => $this->agentid, 143 | 'status' => $this->status, 144 | 'queue' => $this->queue, 145 | 'time' => $this->time, 146 | ]; 147 | } 148 | 149 | /** 150 | * @return Report 151 | */ 152 | public function getReport() : Report 153 | { 154 | $ts = time(); 155 | 156 | $duration = $ts - $this->time; 157 | $at = $ts - $duration; 158 | 159 | $report = new Report(); 160 | $report->type = 'AGENT'; 161 | $report->id = $this->agentid; 162 | $report->status = $this->status; 163 | $report->timestamp = date('Y-m-d H:i:s', $at); 164 | $report->duration = $duration; 165 | $report->queue = $this->queue; 166 | 167 | return $report; 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /src/Callcenter/Model/Call.php: -------------------------------------------------------------------------------- 1 | callerid = $callerid; 46 | $this->uid = $uid; 47 | 48 | $this->time = time(); 49 | } 50 | 51 | /** 52 | * @param string $queue 53 | */ 54 | public function setQueue(string $queue) : void 55 | { 56 | $this->queue = $queue; 57 | $this->setStatus('QUEUED'); 58 | } 59 | 60 | /** 61 | * @return string 62 | */ 63 | public function getStatus() : string 64 | { 65 | return $this->status; 66 | } 67 | 68 | /** 69 | * @return string 70 | */ 71 | public function getQueue() : string 72 | { 73 | return $this->queue; 74 | } 75 | 76 | /** 77 | * @return int 78 | */ 79 | public function getDuration() : int 80 | { 81 | return time() - $this->time; 82 | } 83 | 84 | /** 85 | * @return bool 86 | */ 87 | public function isAnswered() : bool 88 | { 89 | return $this->answered; 90 | } 91 | 92 | /** 93 | * @param string $status 94 | * @return bool 95 | */ 96 | public function setStatus(string $status) : bool 97 | { 98 | $status = strtoupper($status); 99 | 100 | if ($this->status == $status) { 101 | return false; 102 | } 103 | 104 | if ($status == 'INCALL') { 105 | $this->answered = true; 106 | } 107 | 108 | if ($status == 'HANGUP') { 109 | $status = ($this->answered)?"HANGUP":"ABANDON"; 110 | } 111 | 112 | $this->status = $status; 113 | $this->time = time(); 114 | 115 | return true; 116 | } 117 | 118 | /** 119 | * @return string 120 | */ 121 | public function __toString() : string 122 | { 123 | $str = (($this->callerid)?:"anonymous")."|{$this->status}"; 124 | 125 | if ($this->queue) { 126 | $str .= "|{$this->queue}"; 127 | } 128 | 129 | return $str; 130 | } 131 | 132 | /** 133 | * @return array 134 | */ 135 | public function jsonSerialize() 136 | { 137 | return [ 138 | 'type' => 'CALL', 139 | 'id' => $this->uid, 140 | 'callerid' => $this->callerid, 141 | 'status' => $this->status, 142 | 'queue' => $this->queue, 143 | 'time' => $this->time, 144 | 'answered' => $this->answered, 145 | ]; 146 | } 147 | 148 | /** 149 | * @return Report 150 | */ 151 | public function getReport() : Report 152 | { 153 | $ts = time(); 154 | 155 | $duration = $ts - $this->time; 156 | $at = $ts - $duration; 157 | 158 | $report = new Report(); 159 | $report->type = 'CALL'; 160 | $report->id = $this->callerid; 161 | $report->status = $this->status; 162 | $report->timestamp = date('Y-m-d H:i:s', $at); 163 | $report->duration = $duration; 164 | $report->queue = $this->queue; 165 | 166 | return $report; 167 | } 168 | } 169 | -------------------------------------------------------------------------------- /src/Callcenter/Model/Connection.php: -------------------------------------------------------------------------------- 1 | id = $call->uid; 36 | $this->call = $call; 37 | $this->agent = $agent; 38 | 39 | $this->time = time(); 40 | } 41 | 42 | /** 43 | * @return string 44 | */ 45 | public function __toString() : string 46 | { 47 | return "{$this->agent}:{$this->call}"; 48 | } 49 | 50 | /** 51 | * @return array 52 | */ 53 | public function jsonSerialize() 54 | { 55 | return [ 56 | 'type' => 'CONNECT', 57 | 'id' => $this->id, 58 | 'queue' => $this->call->queue, 59 | 'time' => $this->time, 60 | 'agent' => $this->agent, 61 | 'call' => $this->call, 62 | ]; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/Callcenter/Model/Report.php: -------------------------------------------------------------------------------- 1 | $value) { 36 | $this->$key = $value; 37 | } 38 | } 39 | 40 | /** 41 | * 42 | */ 43 | public function addCallReceived() : void 44 | { 45 | $this->calls_received += 1; 46 | } 47 | 48 | /** 49 | * @param int $duration 50 | */ 51 | public function addAnsweredCall(int $duration) : void 52 | { 53 | $this->calls_answered += 1; 54 | $this->queue_time += $duration; 55 | 56 | if ($duration <= self::SLA_SECONDS) { 57 | $this->inside_sla += 1; 58 | } 59 | 60 | $this->average_queue_time = round($this->queue_time / $this->calls_answered); 61 | } 62 | 63 | /** 64 | * @param int $duration 65 | */ 66 | public function addAbandonedCall(int $duration) : void 67 | { 68 | $this->calls_abandoned += 1; 69 | $this->abandoned_queue_time += $duration; 70 | 71 | $this->average_abandoned_time = round($this->abandoned_queue_time / $this->calls_abandoned); 72 | } 73 | 74 | /** 75 | * @param int $duration 76 | */ 77 | public function addHandledCall(int $duration) : void 78 | { 79 | $this->incall_time += $duration; 80 | 81 | if ($this->calls_answered) { 82 | $this->average_handle_time = round($this->incall_time / $this->calls_answered); 83 | } 84 | } 85 | 86 | /** 87 | * @return array 88 | */ 89 | public function jsonSerialize() 90 | { 91 | return [ 92 | 'type' => 'STATS', 93 | 'calls_received' => $this->calls_received, 94 | 'calls_abandoned' => $this->calls_abandoned, 95 | 'calls_answered' => $this->calls_answered, 96 | 'agents_online' => $this->agents_online, 97 | 'calls_online' => $this->calls_online, 98 | 'connections_online' => $this->connections_online, 99 | 'average_handle_time' => $this->average_handle_time, 100 | 'average_queue_time' => $this->average_queue_time, 101 | 'average_abandoned_time' => $this->average_abandoned_time, 102 | 'sla' => ($this->calls_answered)?round($this->inside_sla / $this->calls_answered * 100, 2):"0", 103 | ]; 104 | } 105 | } -------------------------------------------------------------------------------- /src/Callcenter/Report/File.php: -------------------------------------------------------------------------------- 1 | filename = $filename; 17 | } 18 | 19 | /** 20 | * @param Model\Report $report 21 | */ 22 | public function write(\Callcenter\Model\Report $report) 23 | { 24 | $string = $report->timestamp.";".$report->type.";".$report->id.";".$report->status.";"; 25 | $string .= $report->duration.";".$report->queue; 26 | 27 | file_put_contents( 28 | $this->filename, 29 | $string."\n", 30 | FILE_APPEND 31 | ); 32 | } 33 | } -------------------------------------------------------------------------------- /src/Callcenter/ReportInterface.php: -------------------------------------------------------------------------------- 1 | logger = $logger; 35 | $this->clients = new \SplObjectStorage; 36 | } 37 | 38 | /** 39 | * @param ConnectionInterface $conn 40 | */ 41 | public function onOpen(ConnectionInterface $conn) : void 42 | { 43 | $this->clients->attach($conn); 44 | } 45 | 46 | /** 47 | * @param ConnectionInterface $from 48 | * @param string $msg 49 | */ 50 | public function onMessage(ConnectionInterface $from, $msg = '') : void 51 | { 52 | $this->logger->debug("WS: " . $msg); 53 | 54 | $parts = explode(":", $msg); 55 | $cmd = $parts[0]; 56 | 57 | switch ($cmd) { 58 | case 'HELLO': 59 | $this->emit( 60 | 'websocket.hello', [ 61 | new CallcenterEvent( 62 | 'websocket.hello', 63 | [ 64 | 'wsconnection' => $from 65 | ] 66 | ) 67 | ] 68 | ); 69 | break; 70 | case 'PAUSE': 71 | $agentid = $parts[1]; 72 | 73 | $this->emit( 74 | 'websocket.pause', [ 75 | new CallcenterEvent( 76 | 'websocket.pause', 77 | [ 78 | 'wsconnection' => $from, 79 | 'agentid' => $agentid 80 | ] 81 | ) 82 | ] 83 | ); 84 | break; 85 | case 'AVAIL': 86 | $agentid = $parts[1]; 87 | 88 | $this->emit('websocket.avail', [ 89 | new CallcenterEvent( 90 | 'websocket.avail', 91 | [ 92 | 'wsconnection' => $from, 93 | 'agentid' => $agentid 94 | ] 95 | ) 96 | ] 97 | ); 98 | break; 99 | default: 100 | $this->logger->error("Unknown msg: {$msg}"); 101 | } 102 | } 103 | 104 | /** 105 | * @param string $msg 106 | */ 107 | public function sendtoAll(string $msg) : void 108 | { 109 | /** 110 | * @var ConnectionInterface $client 111 | */ 112 | foreach ($this->clients as $client) { 113 | $client->send($msg); 114 | } 115 | } 116 | 117 | /** 118 | * @param ConnectionInterface $conn 119 | */ 120 | public function onClose(ConnectionInterface $conn) : void 121 | { 122 | $this->clients->detach($conn); 123 | } 124 | 125 | /** 126 | * @param ConnectionInterface $conn 127 | * @param \Exception $e 128 | */ 129 | public function onError(ConnectionInterface $conn, \Exception $e) : void 130 | { 131 | $conn->close(); 132 | } 133 | } 134 | --------------------------------------------------------------------------------