|
| 1 | +; res_alarmsystem.conf |
| 2 | + |
| 3 | +; This configuration allows configuring an alarm system using Asterisk. There are two roles |
| 4 | +; that exist, client and server. Clients receive input from one or more sensors and |
| 5 | +; report alarm events to a server. Typically, these will be different Asterisk servers, |
| 6 | +; with clients at individual sites and a single, centralized server receiving events from them, |
| 7 | +; but they could also both run on the same server if desired. |
| 8 | +; However, it is RECOMMENDED that the server role not be at a location with sensors. |
| 9 | +; This way, if someone were to sabotage the alarm system at the client side prior to |
| 10 | +; the breach event, the alarm server will still be aware that something has gone wrong. |
| 11 | + |
| 12 | +; WARNING WARNING WARNING This alarm system implementation comes with absolutely no warranty, |
| 13 | +; use it at your own risk! |
| 14 | + |
| 15 | +; *** Server configuration |
| 16 | + |
| 17 | +[general] |
| 18 | +bindport=4589 ; UDP port to which alarm server will bind, if any servers are enabled. |
| 19 | +;bindaddr=0.0.0.0 |
| 20 | + |
| 21 | +[myserver] ; Defines an alarm server to which alarm clients can report. |
| 22 | +type = server |
| 23 | +ip_loss_tolerance = 60 ; Number of seconds the server will tolerate not receiving pings from clients before considering |
| 24 | + ; IP connectivity to a client to have been lost (which will trigger the internet_lost alarm). |
| 25 | +contexts = myserver-contexts ; A config section which defines dialplan contexts to execute for each alarm event |
| 26 | +logfile = /var/log/asterisk/alarm_server.log ; Log file for this server |
| 27 | + |
| 28 | +[clients] ; Special section defining clients authorized to report to this server |
| 29 | +;A101 = 1D7B ; one entry for each client, with client ID as the key and client PIN as the value |
| 30 | + |
| 31 | +; *** Client configuration |
| 32 | + |
| 33 | +[myclient] ; Each alarm client is defined in its own section |
| 34 | +type = client |
| 35 | +client_id = A101 ; Unique, telenumeric ID (0-9,A-D) for this client. Should be unique across all clients that report to a server. |
| 36 | + ; Note that there is no security mechanism to restrict reporting aside from the client ID. |
| 37 | + ; Therefore, if the alarm server is exposed to the Internet, you may wish to use long, hard-to-guess client IDs |
| 38 | + ; to prevent spoofed reports, or lock down your firewall accordingly. |
| 39 | +;client_pin=1D794B61 ; PIN, if required by server for authentication |
| 40 | +server_ip = 127.0.0.1:4589 ; IP/port to reach alarm server over IP |
| 41 | +server_dialstr = DAHDI/g1/*70w18005551212 ; A dial string for "POTS phone failover" to reach alarm server if unable to by IP. If you need to use dial options, use a Local channel to encapsulate the Dial() call. |
| 42 | + ; The server should call AlarmEventReceiver() (NOT AlarmReceiver() !!!) when receiving such a call. |
| 43 | + ; NOTE: When reporting an alarm trigger, the line will stay open until disarm_delay has been reached, to avoid making multiple calls in succession |
| 44 | +phone_hangup_delay = 45 ; Number of seconds to keep phone failover line open upon reporting event for reporting further events in that time. |
| 45 | + ; It is recommended this setting be at least 10-15 seconds, so that if phone failover is being used, |
| 46 | + ; a single phone call is sufficient to report sensor trigger and alarm disarm events, rather than dialing up a second time to report this event. |
| 47 | + ; You may want to tweak this based on the cost of each call, cost per minute, and the acceptable amount of delay in setting up a call. Default is 45. |
| 48 | +ping_interval = 4 ; How often to ping the server |
| 49 | +egress_delay = 15 ; number of seconds grace period to exit without re-triggering alarm |
| 50 | +contexts = myclient-contexts ; A config section which defines dialplan contexts to execute for each alarm event |
| 51 | +logfile = /var/log/asterisk/alarm_myclient.log ; Log file to which to log alarm events. |
| 52 | + |
| 53 | +[myclient-contexts] |
| 54 | +type = contexts |
| 55 | +; In this section, the key is the name of the alarm event for which the specified dialplan will be executed, |
| 56 | +; and the value is the dialplan [exten@]context to execute. If exten is omitted, s will be used. The priority will always be 1. |
| 57 | +; |
| 58 | +; okay = okay@myclientalarm ; Normal initialization |
| 59 | +; triggered = triggered@myclientalarm ; Sensor has triggered alarm |
| 60 | +; restored = restored@myclientalarm ; Sensor restored to normal (will not auto-disarm pending alarm) |
| 61 | +; disarmed = disarmed@myclientalarm ; Alarm disarmed by user |
| 62 | +; tempdisarmed = tempdisarmed@myclientalarm ; Alarm temporarily disarmed by user |
| 63 | +; breach = breach@myclientalarm ; Breach (failure to disarm active alarm) has occured |
| 64 | +; internet_lost = iplost@myclientalarm ; Internet connectivity to alarm peer lost |
| 65 | +; internet_restored = iprestored@myclientalarm ; Internet connectivity to alarm peer restored |
| 66 | + |
| 67 | +[door] ; Section defining a door sensor |
| 68 | +type = sensor |
| 69 | +sensor_id = 1 ; Unique, numeric ID for this sensor. Should be unique across all sensors belongng to all clients that report to a server. |
| 70 | +client = myclient ; Client associated with this sensor |
| 71 | +device = DAHDI/23 ; if specified, then arg2 to AlarmSensor is optional since we can use the channel to determine which sensor was activated |
| 72 | + ; (This way, the same context can be specified for all sensors, using immediate=yes in chan_dahdi.conf) |
| 73 | +disarm_delay = 45 ; Number of seconds grace period permitted to disarm an active alarm after this sensor triggers before it is considered a breach. |
| 74 | + ; Default is 60. |
| 75 | + |
| 76 | +[keypad] ; Section defining alarm keypad settings. An alarm keypad can be instantiated by using AlarmKeypad() |
| 77 | +type = keypad |
| 78 | +client = myclient ; Client associated with these keypad settings |
| 79 | +keypad_device = PJSIP/Polycom ; dial string for alarm keypad endpoints to autodial when alarm is triggered. Use a Local channel for predial options to autoanswer. |
| 80 | +pin = 1234 ; Hardcoded PIN which must be entered to disarm the alarm. Multiple PINs can be permitted by providing multiple comma-separated PINs. |
| 81 | +audio = custom/siren ; An optional audio file to play while waiting for the alarm to be disarmed. By default, a tone is played. |
| 82 | +cid_num = DISARM SYSTEM NOW ; Caller ID number to use for outgoing calls to the keypad device |
| 83 | +cid_name = ALARM PANEL ; Caller ID name to use for outgoing calls to the keypad device |
0 commit comments