module.exports = {
  apps : [
  {
    name: 'jambonz-smpp-esme',
    cwd: '/home/admin/apps/jambonz-smpp-esme',
    script: 'app.js',
    out_file: '/home/admin/.pm2/logs/jambonz-smpp-esme.log',
    err_file: '/home/admin/.pm2/logs/jambonz-smpp-esme.log',
    combine_logs: true,
    instance_var: 'INSTANCE_ID',
    exec_mode: 'fork',
    instances: 1,
    autorestart: true,
    watch: false,
    max_memory_restart: '1G',
    env: {
      NODE_ENV: 'production',
      AVOID_UDH: true,
      JAMBONES_MYSQL_HOST: '${JAMBONES_MYSQL_HOST}',
      JAMBONES_MYSQL_USER: '${JAMBONES_MYSQL_USER}',
      JAMBONES_MYSQL_PASSWORD: '${JAMBONES_MYSQL_PASSWORD}',
      JAMBONES_MYSQL_DATABASE: 'jambones',
      JAMBONES_MYSQL_CONNECTION_LIMIT: 10,
      JAMBONES_REDIS_HOST: '${JAMBONES_REDIS_HOST}',
      JAMBONES_REDIS_PORT: 6379,
      JAMBONES_LOGLEVEL: 'debug',
      JAMBONES_CLUSTER_ID: '${JAMBONES_CLUSTER_ID}',
      HTTP_PORT: 3020
    }
  },
  {
    name: 'sbc-call-router',
    cwd: '/home/admin/apps/sbc-call-router',
    script: 'app.js',
    instance_var: 'INSTANCE_ID',
    out_file: '/home/admin/.pm2/logs/jambonz-sbc-call-router.log',
    err_file: '/home/admin/.pm2/logs/jambonz-sbc-call-router.log',
    exec_mode: 'fork',
    instances: 1,
    autorestart: true,
    watch: false,
    max_memory_restart: '1G',
    env: {
      NODE_ENV: 'production',
      HTTP_PORT:  4000,
      JAMBONES_INBOUND_ROUTE: '127.0.0.1:4002',
      JAMBONES_OUTBOUND_ROUTE: '127.0.0.1:4003',
      JAMBONZ_TAGGED_INBOUND: 1,
      JAMBONES_NETWORK_CIDR: '${VPC_CIDR}',
		}
  },
  {
    name: 'sbc-sip-sidecar',
    cwd: '/home/admin/apps/sbc-registrar',
    script: 'app.js',
    instance_var: 'INSTANCE_ID',
    out_file: '/home/admin/.pm2/logs/sbc-sip-sidecar.log',
    err_file: '/home/admin/.pm2/logs/sbc-sip-sidecar.log',
    exec_mode: 'fork',
    instances: 1,
    autorestart: true,
    watch: false,
    max_memory_restart: '1G',
    env: {
      NODE_ENV: 'production',
      ENABLE_DATADOG_METRICS: 0,
      JAMBONES_LOGLEVEL: 'info',
      DRACHTIO_HOST: '127.0.0.1',
      DRACHTIO_PORT: 9022,
      DRACHTIO_SECRET: 'cymru',
      JAMBONES_MYSQL_HOST: '${JAMBONES_MYSQL_HOST}',
      JAMBONES_MYSQL_USER: '${JAMBONES_MYSQL_USER}',
      JAMBONES_MYSQL_PASSWORD: '${JAMBONES_MYSQL_PASSWORD}',
      JAMBONES_MYSQL_DATABASE: 'jambones',
      JAMBONES_MYSQL_CONNECTION_LIMIT: 10,
      JAMBONES_REDIS_HOST: '${JAMBONES_REDIS_HOST}',
      JAMBONES_REDIS_PORT: 6379,
      JAMBONES_NETWORK_CIDR: '${VPC_CIDR}'
		}
  },
  {
    name: 'sbc-outbound',
    cwd: '/home/admin/apps/sbc-outbound',
    script: 'app.js',
    instance_var: 'INSTANCE_ID',
    out_file: '/home/admin/.pm2/logs/jambonz-sbc-outbound.log',
    err_file: '/home/admin/.pm2/logs/jambonz-sbc-outbound.log',
    exec_mode: 'fork',
    instances: 1,
    autorestart: true,
    watch: false,
    max_memory_restart: '1G',
    env: {
      NODE_ENV: 'production',
      JAMBONES_LOGLEVEL: 'info',
      JAMBONES_NETWORK_CIDR: '${VPC_CIDR}',
      ENABLE_DATADOG_METRICS: 0,
      DRACHTIO_HOST: '127.0.0.1',
      DRACHTIO_PORT: 9022,
      DRACHTIO_SECRET: 'cymru',
      JAMBONES_TRACK_ACCOUNT_CALLS: 0,
      JAMBONES_TRACK_SP_CALLS: 0,
      JAMBONES_TRACK_APP_CALLS: 0,
      JAMBONES_RTPENGINES: '${JAMBONES_RTPENGINE_IPS}',
      JAMBONES_MYSQL_HOST: '${JAMBONES_MYSQL_HOST}',
      JAMBONES_MYSQL_USER: '${JAMBONES_MYSQL_USER}',
      JAMBONES_MYSQL_PASSWORD: '${JAMBONES_MYSQL_PASSWORD}',
      JAMBONES_MYSQL_DATABASE: 'jambones',
      JAMBONES_MYSQL_CONNECTION_LIMIT: 10,
      JAMBONES_REDIS_HOST: '${JAMBONES_REDIS_HOST}',
      JAMBONES_REDIS_PORT: 6379
		}
  },
  {
    name: 'sbc-inbound',
    cwd: '/home/admin/apps/sbc-inbound',
    script: 'app.js',
    instance_var: 'INSTANCE_ID',
    out_file: '/home/admin/.pm2/logs/jambonz-sbc-inbound.log',
    err_file: '/home/admin/.pm2/logs/jambonz-sbc-inbound.log',
    exec_mode: 'fork',
    instances: 1,
    autorestart: true,
    watch: false,
    max_memory_restart: '1G',
    env: {
      NODE_ENV: 'production',
      JAMBONES_LOGLEVEL: 'info',
      JAMBONES_NETWORK_CIDR: '${VPC_CIDR}',
      ENABLE_DATADOG_METRICS: 0,
      DRACHTIO_HOST: '127.0.0.1',
      DRACHTIO_PORT: 9022,
      DRACHTIO_SECRET: 'cymru',
      JAMBONES_RTPENGINES: '${JAMBONES_RTPENGINE_IPS}',
      JAMBONES_MYSQL_HOST: '${JAMBONES_MYSQL_HOST}',
      JAMBONES_MYSQL_USER: '${JAMBONES_MYSQL_USER}',
      JAMBONES_MYSQL_PASSWORD: '${JAMBONES_MYSQL_PASSWORD}',
      JAMBONES_MYSQL_DATABASE: 'jambones',
      JAMBONES_MYSQL_CONNECTION_LIMIT: 10,
      JAMBONES_REDIS_HOST: '${JAMBONES_REDIS_HOST}',
      JAMBONES_REDIS_PORT: 6379,
      JAMBONES_TRACK_ACCOUNT_CALLS: 0,
      JAMBONES_TRACK_SP_CALLS: 0,
      JAMBONES_TRACK_APP_CALLS: 0,
      JAMBONES_CLUSTER_ID: '${JAMBONES_CLUSTER_ID}',
      MS_TEAMS_SIP_PROXY_IPS: '52.114.148.0, 52.114.132.46, 52.114.75.24, 52.114.76.76, 52.114.7.24, 52.114.14.70'
		}
  }]
};