Sign inSign up

jambonz/sbc-outbound

By jambonz

•Updated 17 days ago

Image
0

10K+

jambonz/sbc-outbound repository overview

⁠sbc-outbound Build Status

This application provides a part of the SBC (Session Border Controller) functionality of jambonz platfrom. It handles outbound INVITE requests from the cpaas application server that is going to carrier sip trunks or registered sip users/devices, including webrtc applications.

⁠Configuration

Configuration is provided via environment variables:

variablemeaningrequired?
DRACHTIO_HOSTip address of drachtio server (typically '127.0.0.1')yes
DRACHTIO_PORTlistening port of drachtio server for control connections (typically 9022)yes
DRACHTIO_SECRETshared secretyes
HTTP_PORTtcp port listen portno
JAMBONES_LOGLEVELlog level for application, 'info' or 'debug'no
JAMBONES_MYSQL_HOSTmysql hostyes
JAMBONES_MYSQL_PORTmysql portno
JAMBONES_MYSQL_USERmysql usernameyes
JAMBONES_MYSQL_PASSWORDmysql passwordyes
JAMBONES_MYSQL_DATABASEmysql datayes
JAMBONES_MYSQL_CONNECTION_LIMITmysql connection limitno
DTMF_LISTEN_PORTDTMF listening portno
JAMBONES_NG_PROTOCOLrtpengine NG protocolno
RTPENGINE_PORTrtpengine portno
JAMBONES_CLUSTER_IDcluster idno
JAMBONES_NETWORK_CIDRCIDR of private network that feature server is running in (e.g. '172.31.0.0/16')yes
JAMBONES_REDIS_HOSTredis hostyes
JAMBONES_REDIS_PORTredis portno
JAMBONES_RTPENGINEScommans-separated list of ip:ng-port for rtpengines (e.g. '172.31.32.10:22222')yes
JAMBONES_TIME_SERIES_HOSTinfluxdb hostyes
JAMBONES_RECORD_ALL_CALLSenable auto record callsno
JAMBONES_CODEC_OFFER_WITH_ORDERcomma-separated codec list to use as the outbound offer toward the carrier; the original codecs from the feature server are stripped first (e.g. 'opus,PCMU,PCMA,telephone-event')no
JAMBONES_CODEC_TRANSCODEcomma-separated codec list that rtpengine should add to the outbound offer and transcode on the fly when the carrier selects them — used to support codecs the feature server does not speak (e.g. 'AMR-WB/16000'). Requires an rtpengine build that includes the corresponding codec module.no
JAMBONES_ACCEPT_AND_TRANSCODEcomma-separated codec list to accept on the outbound leg and transcode to PCMU/PCMA toward the feature serverno
JAMBONES_ACCEPT_G729if set, accept G.729 on the outbound leg and transcode to PCMU/PCMA (shorthand for JAMBONES_ACCEPT_AND_TRANSCODE=g729)no
K8Sservice running as kubernetes serviceno
K8S_RTPENGINE_SERVICE_NAMErtpengine service name(required for K8S)no
⁠Codec transcoding notes

JAMBONES_CODEC_OFFER_WITH_ORDER and JAMBONES_CODEC_TRANSCODE can be combined. When both are set, rtpengine first strips the original codecs from the SDP, then adds the codecs listed in JAMBONES_CODEC_OFFER_WITH_ORDER to the offer, and finally adds the codecs from JAMBONES_CODEC_TRANSCODE with transcoding enabled. When only JAMBONES_CODEC_TRANSCODE is set, the original codecs from the feature server are kept in the offer and the transcode codecs are appended.

Codecs that require licensed or optional rtpengine modules (AMR, AMR-WB, G.729, etc.) only work if rtpengine was compiled with support for them. Carrier-specific fmtp parameters (for example, octet-align=1 for AMR-WB) can be appended to the codec name as needed (e.g. AMR-WB/16000;octet-align=1).

⁠running under pm2

Typically, this application runs under pm2⁠ using an ecosystem.config.js⁠ file similar to this:

module.exports = {
  apps : [
  {
    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',
      DRACHTIO_HOST: '127.0.0.1',
      DRACHTIO_PORT: 9022,
      DRACHTIO_SECRET: 'cymru',
      JAMBONES_RTPENGINES: '172.31.32.10:22222',
      JAMBONES_MYSQL_HOST: 'aurora-cluster-jambonz.cluster-xxxxxxxxxxxxx.us-west-1.rds.amazonaws.com',
      JAMBONES_MYSQL_USER: 'admin',
      JAMBONES_MYSQL_PASSWORD: 'JambonzR0ck$',
      JAMBONES_MYSQL_DATABASE: 'jambones',
      JAMBONES_MYSQL_CONNECTION_LIMIT: 10,
      JAMBONES_REDIS_HOST: 'jambonz.zzzzzzz.0001.usw1.cache.amazonaws.com',
      JAMBONES_REDIS_PORT: 6379,
      JAMBONES_TIME_SERIES_HOST: '172.31.32.11',
      JAMBONES_NETWORK_CIDR: '172.31.0.0/16'
    }
  }]
};
⁠Running the test suite

To run the included test suite, you will need to have docker installed on your laptop.

npm test

Tag summary

Content type

Image

Digest

sha256:4a183d430…

Size

173.3 MB

Last updated

17 days ago

docker pull jambonz/sbc-outbound