#
#  ampd.conf
#  Configuration File for the
#  Asterisk Manager Proxy Daemon
#
#  Basic Syntax: parameter = value
#  Obviously lines that start with a '#' symbol or are blank are ignored
#  Parameters that are a true/false value can be one of '1', 'yes' or 'true'. True/False values are
#       case insensitive. Any value other than 1,yes,or true result in a false value, including the absence
#       of a value. The parameter below would be false.
#           trueFalseParam = 

#
# User/Group configuration parameters describe who the daemon should run as
#    default: Both user and group default to 'nobody'
#user = root
#group = root

#
# Daemonize
# Whether the server should become a daemon or stay attached to the terminal for debug output
#    default: Yes
daemonize = Yes

#
# PID file
# The pid file for the daemon
# This is used both as a reference of the pid of the process as well as a lock file to
# prevent mulitple processes from running
#   Permissions become an issue if you run the server under a user other than root. In order to remove
#   the lockfile, the user must have write permission to the file and write permission to the directory
#   the lockfile is in.
#    default: /tmp/ampd.pid
#pid = /tmp/ampd.pid

#
# Log File
# The log file for the server
#    default: /var/log/ampd.log
log = /var/log/ampd.log

#
# Verbose Messages
# Whether to print/log messages categorized as informational.
# Defaults to 'Yes'
#verbose = Yes

#
# Debug Messages
# Whether to print/log debugging information
# Defaults to 'No'
#debug = No

#
# Server Address
# The port and optionally a hostname to listen for clients on
# The hostname can either be a hostname or an ip address
# If you set hostname to an asterisk '*', it will listen on all addresses
# server host defaults to '*'
# server port defaults to 3553
#server host = *
#server port = 3553

#
# Asterisk Server Configuration
# This is the configuration for the asterisk server to connect to
# The defaults are as follows:
#   asterisk host defaults to 'localhost'
#   asterisk port defaults to 5038
#   asterisk user defaults to '' (empty string)
#   asterisk secret defatuls to '' (empty string)
asterisk host = localhost
asterisk port = 5038
asterisk user = amp
asterisk secret = 13872jfvf8sd

#
# Asterisk Retry
# This sets the timeout, in seconds, until the proxy tries to re-establish a connection
#  after a network failure. If you put a value of 0 or less, the server will end when either the
#  command or event connections fail for any reason.
#  Default: 30 seconds
#asterisk retry = 30

#
# Clients Events
# This setting tells the server whether events from asterisk are sent to clients by default.
# The setting can be over written when logging in by setting events=[<1|true|yes>|<0|false|no>] during login or
# sending the clientEvents command to the server.
# Default is Yes
#client events = yes

#
# Default input/output format
# This specifies the default format for incoming and outgoing messages to/from the proxy
# server and the client(s). Your choices are xml and asterisk
# The asterisk native format is what comes from a connection to the asterisk manager interface. Order of
# the key: value pairs is *not* garunteed.
# Communication formats can be specified on a per client basis during the initial registration of a client
# communication format defaults to xml
#communication format = xml

#
# Timeout for events
# Events are stored in a list in memory until all the clients have had a chance to retrieve them.
# There's no mechanism in place to keep track of what clients have grabbed what, instead the events
# have a time to live, in seconds, which you can set here.
# If you have a high number of clients grabbing events, you might need to make this number higher.
# Defaults to 3 seconds
#event ttl = 3

#
# For the purposes of being Truly Evil(tm), here's a setting to allow you to be really lax.
# auth disable allows anyone to register without a password under complete trust
# *to any registration type*
# The purpose of this setting is to let you not care about authentication at all.
# This setting disables client authentication completely
# Obviously the default is false
#auth disable = false

#
# Global Client Authentication Trust
# For the purposes of convenience, you can set global trust for logins on each or all of the login categories
# If any of these are set to true, you need not send a password when registering, and the login will be
#   assumed to be valid
# Specific settings over ride the global ones; if you set global to false and agent to true and do not set admin
#   and monitor, admin and monitor will be false, and agent will be true
# Specific settings do not inherit higher settings. For example, if monitor is set to trust, and agent is not set,
#  it will *not* inherit trust from monitor.
# All default to false
#auth global trust = false
#auth admin trust = false
#auth monitor trust = false
#auth agent trust = false

#
# Multiple Agent Logins
# This setting tells the server whether a single agent should be allowed to log in to the proxy multiple times.
# This setting does not effect the agentLogin, agentCallbackLogin, or agentLogoff asterisk commands.
# Default: true
#multiple agent logins = false

#
# The users file location
# If you do not specify a path, the current directory is assumed
# If you do specify a path, it must be absolute
# Default: /etc/ampd_users.conf
#user file = /etc/ampd_users.conf

#
# Data Directory
# Where to store files for statistics and call center profiles
# Defaults to '/var/lib/ampd'
#data dir = /var/lib/ampd

#
# Statistics Monitoring
# Whether the server should monitor traffic for the purposes of keeping statistics.
# This setting turns on/off BOTH stat events AND stat reporting. If you want one or the other, set this to
# yes and tune the following settings below, 'statistic events' and 'statistic reporting'
# statistics defaults to 'yes'
#statistics = yes

#
# Statistics Events
# Whether the statistics should generate events for clients.
# Statistic events will be generated for clients logged in with manager and administrator permissions.
# Defaults to 'yes'
#statistic events = yes

#
# Statistics Reporting
# Whether to store statistics in DB files for later extraction to XML (or other formats) files for the purpose of 
# generating reports.
# Defaults to 'yes'
#statistic reporting = yes

#
# Ignore NewExten
# Whether to ignore the 'NewExten' event from asterisk. The 'NewExten' event has the potential, 
# depending on your dialplan, of generating an insane amount of activity. If you are not using this 
# event, it is best to turn it off.
# Defaults to 'yes'
#ignore event newexten = yes

#
# ADVANCED STATISTICS TUNING
##############################
# Don't mess with these unless you know what you're doing
# The defaults should be fine.

# (Advanced)
# Statistics Thread Iteration Delay
# Certain statistics need to be kept track of over time in order to know all the information involved, such
# as the length of a phone call. This data must be kept in memory and maintained. This is where the
# statistics thread comes in. It loops for the life of the daemon and maintains tracking data. Here you can
# manipulate how long it waits between loop iterations. If you set this to high, there will be a noticable
# delay between clients expecting "real time" stats and the server. If you set it to low, you'll eat up
# processing power.
# Defaults to 3 (seconds)
#statistics delay = 3

# (Advanced)
# Queue Entry Maximum Wait Timeout
# When someone enters a queue, wait time is tracked. Unfortunately, the proxy can not count on asterisk
#   to deliver this information due to the fact that the wait time is only given on an agentConnect event,
#   but not on a leave event, so if an entry abandons the queue, the data is lost... unless the proxy tracks
#   it. This value specifies how long to wait until we consider the tracking entry to be corrupt (as in some
#   sort of internal error occurred). If the entry times out, it is simply removed from tracking and forgotten.
# Defaults to 86400 (one day in seconds)
#statistics queue wait ttl = 86400

# (Advanced)
# Queue Abandoned Timeout
# Due to what information (and the order of said information) is provided via events, one of the few ways
#   to know what entries abandoned the queue and what entries went on to talk to an agent is to mark an
#   entry abandoned when a 'leave' event is received, and wait until an 'agentconnect' event is received.
#   This specifies how long to wait until the proxy accepts the fact that the entry left and isn't talking to
#   an agent. This value should take into account network latency, asterisk and proxy server load, and any
#   other variables that might delay the 'agentconnect' event from reaching the proxy. Keep in mind that the
#   entry does not give a 'leave' event unless an agent has accepted a call.
# Defaults to 5 (seconds)
#statistics queue abandoned ttl = 5

# (Advanced)
# Agent Unanswered Timeout
# The proxy tracks agents that receive call requests but do not answer them. It does this by tracking 
#   'agentcalled' events and waiting for a 'agentConnect' event. This value specifies how long to wait before
#   accepting that the agent did not accept the call. This value should take into account the timeout in the
#   dial command as well as network latency, asterisk and proxy load, etc.
#   NOTE: When I get some time, I'll try to hack this better so the server looks for 'hangup' events instead of
#         'agentconnect' events. This should be a little more bullet proof. 'Course, if anyone has a better idea,
#         feel free to email me.
# Defaults to 60 (seconds)
#statistics agent unanswered ttl = 60

# (Advanced)
# Agent Outbound Timeout
# The proxy tracks lengths of phone calls made outbound by agents. How the proxy does this is tricky, and will
#   certainly NOT work for everyone: When a 'dial' event is received with 'SIP/' as the origin and 'Zap/' as
#   the destination, it takes the extension from the 'SIP/{exten}-hash' and tries to find an agent of that number.
#   If it finds one, it tracks the call, waiting for a 'hangup' event with the same channel, and records the length
#   of the phone conversation. This will absolutely need to be updated to a better method. As of now, this assumes
#   that all agents ID numbers are the same as their phone extensions, all agent's phones are SIP phones, and all
#   outbound calls go out a Zap line. If this is not the case for you, email me and let me know how you're set up
#   so I might be able to find a better solution.
#   This setting tells the proxy how long to wait before considering the tracking corrupt for this call and 
#   disreguarding it.
# Defaults to 86400 (one day in seconds)
#statistics agent outbound ttl = 86400
 
