Giter Club home page Giter Club logo

asterisk-config's Introduction

Asterisk Config

Asterisk Config is a kubernetes sidecar container which constructs the configuration for Asterisk. It is comprised of a custom configuration set and a standardized dynamic environment set to build the Asterisk configuration for the Pod in question.

The primary dynamic component of Asterisk Config is the IP address (internal and external) for use by the SIP and PJSIP modules.

Automatic reloading

Any time dynamic data is updated, Asterisk is told to reload. By default, we only reload res_pjsip.so, since the dynamic data usually just involves PJSIP endpoint IPs. However, you can set the RELOAD_MODULES environment variable to a comma-separated list of modules which should be reloaded when the dynamic data is updated.

The reloads are performed by executing the ARI "/asterisk/modules" "PUT" (reload) once for each of the specified modules. This ARI connection is automatically created with a randomly-generated password by Asterisk Config.

Layering

There are two layers of files which are used:

  • Default configuration
  • Custom configuration

Default configuration

Included within this package is the standard Asterisk basic configuration set with minimal alterations to:

  • include custom configurations
  • include configuration directories
  • disable all file-based logging

Any file in the default configuration my be replaced by including it in your custom configuration bundle, but see the Custom configuration section below for better methods.

The default configuration also creates configurations for ARI, so that it may call a reload when necessary, and PJSIP, to configure the IP information for transports.

PJSIP default transports

The following default PJSIP transports will be specified:

  • k8s-internal-ipv4-internal-media (internal SIP/signaling advertisement, internal RTP/media advertisement, port 5080/UDP)
  • k8s-internal-ipv4-external-media (internal SIP/signaling advertisement, external RTP/media advertisement, port 5070/UDP)
  • k8s-external-ipv4-external-media (external SIP/signaling advertisement, external RTP/media advertisement, port 5060/UDP)

In most cloud-based kubernetes setups, the Pod will be assigned an internal IP address, and it will have a NATed external IP address. The choice of transports depends on two things:

  • Where is the signaling endpoint?
  • Where is the media endpoint?

It is common, for instance, to use kamailio as a SIP proxy to handle a scalable set of Asterisk servers. In this case, you would want to use internal signaling IPs. The RTP, however, will depend on whether you want your media to flow directly to your Asterisk Pods (-external-media) or by way of rtpengine or rtpproxy (-internal-media).

For each of your PJSIP Endpoints, just specify the transport you wish to use.

  • Internal SIP, Internal RTP
  • Internal SIP, External RTP
  • External SIP, External RTP

Custom configuration

While your custom configurations are allowed to overwrite any Asterisk configuration file, there are generally two schemes by which customized configurations may be applied:

  • <module>.d/XXXX.conf
  • <module>_custom.conf

The most flexible approach is to create any number of discrete files in the module configuration subdirectories. For instance, you might add a PJSIP endpoint configuration in:

pjsip.d/ext-101.conf

Any file with the .conf extension in one of these directories will automatically be loaded.

Modules which are configured to load configurations using this scheme are:

  • AMI (manager.d/)
  • ARI (ari.d/)
  • Extensions (extensions.d/)
  • PJSIP (pjsip.d/)
  • Voicemail (voicemail.d/)

If there is any default configuration for any of these modules, that configuration will exist in <extension>_custom.conf. The corresponding <extension>.conf only contains include statements.

Take special note that ARI and PJSIP modules are used internally by Asterisk Config, so changing their root ari.conf and pjsip.conf is not recommended unless you really know what you are doing.

Usage

It is presumed that you have a kubernetes installation on a standard cloud platform (such as AWS, GCP, Azure, DigitalOcean, etc) or are running a baremetal kubernetes cluster which you can control to supply the public and private IP addresses for the Asterisk Pod.

It is strongly recommended to set the CLOUD environment variable to match your environment. The valid options are:

  • aws Amazon Web Services
  • azure Microsoft Azure
  • digitalocean or do Digital Ocean
  • gcp Google Cloud Platform
  • `` default discovery

Default discovery is useful for baremetal configurations or situations where you do not wish to use the cloud provider's self discovery API.

NOTE: Importantly, in cases where you need Asterisk to use the kubernetes Pod IP address instead of the Node IP address, set the CLOUD variable to be the empty string. Default discovery also works for public IP addresses by using the jsonip.io service.

Asterisk Config offers varying levels of configuration complexity, allowing you to easily just get your Asterisk system off the ground or to build a fully-templated configuration set.

It is a common problem that Asterisk may start before the config has been written. In order to eliminate that eventuality, you should check for the existence of the .asterisk-config file before allowing Asterisk to start.

Basic Usage

The simplest use is: to create the set of custom Asterisk configurations

  1. create the set of custom Asterisk configurations for your scenario
  2. generate a .zip file of that configuration tree
  3. load that .zip file to a ConfigMap, Secret, or Web URL

For example:

We will define a simple dialplan with a single PJSIP endpoint to a carrier. When a call comes in from the carrier, it will be answered and any audio received will be played back to the caller.

First, create a directory to contain the configuration files. Files stored in this directory will be copied into /etc/asterisk/ on the live Asterisk Pod. In this example, we will use the local directory named /home/user/asterisk/config.

Inside your directory, we create two files: pjsip.d/my_carrier.conf and extensions.d/dialin.conf.

pjsip.d/my_carrier.conf:

[pstn]
type=endpoint
transport=k8s-external-ipv4-external-media
context=dialin
disallow=all
allow=ulaw
aors=pstn
rtp_symmetric=yes

[pstn]
type=aor
contact=sip:my.carrier.com:5060

[pstn]
type=identify
endpoint=pstn
match=12.34.56.78
match=87.65.43.21

[acl]
type=acl
deny=0.0.0.0/0.0.0.0
permit=12.34.56.78/255.255.255.255
permit=87.65.43.21/255.255.255.255

extensions.d/dialin.conf:

[dialin]
exten = echo,1,Verbose(1, "Running Echo")
 same = n,Answer()
 same = n,Echo()
 same = n,Hangup()

exten = 15555555555,1,Verbose(1, "Received call to +1 555 555.5555")
 same = n,Goto(echo,1)

Now zip up these configuration files to a new asterisk-config.zip:

zip -r asterisk-config.zip *

Then store the asterisk-config.zip file to kubernetes as a Secret named "asterisk-config":

kubectl create secret generic asterisk-config --from-file=asterisk-config.zip

NOTE: By default, Asterisk-Config looks for the Secret named "asterisk-config" to load the custom configuration. See the section below for sourcing the custom configuration from a different location.

Now we create a normal Pod spec for kubernetes including the Asterisk Configuration sidecar container:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: asterisk
  labels:
    component: asterisk
spec:
  replicas: 1
  template:
    metadata:
      labels:
        component: asterisk
    spec:
      hostNetwork: true
      containers:
        - name: config
          image: ghcr.io/cycoresystems/asterisk-config
          env:
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          volumeMounts:
            - name: config
              mountPath: /etc/asterisk
            - name: source
              mountPath: /source
        - name: asterisk
          image: cycoresystems/asterisk
          volumeMounts:
            - name: config
              mountPath: /etc/asterisk
      volumes:
        - name: config
        - name: source
          secret:
            secretName: "asterisk-config"

Custom Configuration source

By default, Asterisk Config looks for the file /source/asterisk-config.zip as the source of configuration. However, this can be customized by setting the SOURCE environment variable.

You may also obtain the source from an HTTP URL by specifying that URL as the SOURCE. Additional environment variables may be provided for HTTP authentication:

  • URL_USERNAME (for basic authentication)
  • URL_PASSWORD (for basic authentication),
  • URL_AUTHORIZATION (explicit "Authorization" header)

If no SOURCE file can be found or is specified, Asterisk Config will attempt to load the (expanded) configuration tree in the /custom/ directory. In this way, you may plug in your own source-obtaining method and have it populate the custom configuration files in this directory.

To make sure the Asterisk container is not successfully started before the configuration can be loaded, Asterisk Config will die if no valid custom configuration can be obtained. Asterisk will already die if it cannot find its configuration. Kubernetes will automatically restart each of these if they die.

Templates

Asterisk Config will process any file within the source bundle which ends in the .tmpl extension. These files will be processed as Go text/template files and the output stored as the same filename without the .tmpl extension.

Values for the templates may come from a number of sources:

  • ConfigMap
  • Environment Variables
  • Service
  • Endpoints (of a Service)
  • EndpointIPs (of a Service)
  • Network

ConfigMap

To obtain ConfigMap entries, Asterisk Config will use the Kubernetes API to attempt to pull in the ConfigMap and key requested.

Format: {{.ConfigMap "<name>" "<namespace>" "<key>"}}

The provided namespace may be "" if both the ConfigMap is in the same namespace as the Pod and the POD_NAMESPACE environment variable is properly set.

The ConfigMap will be monitored by Asterisk Config, and if it is updated, the configuration files will be regenerated, and a reload will be performed.

Note that this will likely require an RBAC entry to allow the ServiceAccount under which Asterisk Config is running to access the referenced ConfigMap.

Environment Variables

Format: {{.Env "<name>"}}

It is useful to note that IP addresses of services within the same namespace will automatically be populated as environment variables by kubernetes. These will be of the form <SERVICE_NAME>_SERVICE_HOST. For instance, the IP of a service named "kamailio" will be stored in the environment variable KAMAILIO_SERVICE_HOST. This is a normal, default feature of all kubernetes containers. See the documentation for more information.

Service

Data from a kubernetes Service may be obtained using the Kubernetes API.

Format: {{.Service "<name>" "<namespace>]"}}

The provided namespace may be "" if both the Service is in the same namespace as the Pod and the POD_NAMESPACE environment variable is properly set.

The value returned here is the Kubernetes Service. Keep in mind that Go uses PascalCase for the fields, so "clusterIP" becomes "ClusterIP".

For example, to get the ClusterIP of a service named "kamailio" in the "voip" namespace:

{{ with .Service "kamailio" "voip"}}{{.Spec.ClusterIP}}{{end}}

Note that the IP address of a service within the same namespace can be obtained more simply by environment variable, as described above.

Endpoints

Data from the kubernetes Endpoints of a Service may be obtained using the Kubernetes API.

Format: {{.Service "<name>" "<namespace>"}}

The provided namespace may be "" if both the Service is in the same namespace as the Pod and the POD_NAMESPACE environment variable is properly set.

The value returned is the Kubernetes Endpoints.

The Endpoints will be monitored by Asterisk Config, and if it is updated, the configuration files will be regenerated, and a reload will be performed.

This is usually used to obtain the dynamic set of proxy servers, but since the most common reason to do this is to obtain the set of IPs for endpoints of a service, we provide a second helper function just for that.

Endpoint IPs

One of the most common pieces of dynamic data to retrieve is the set of IPs for the endpoints of a service. Therefore, to simplify the relatively tedious iteration of these directly from the Endpoints spec, we provide the EndpointIPs macro, which returns the list of IPs of all Endpoints of the given service name.

Format: {{.EndpointIPs "<name>" "<namespace>"}}

The provided namespace may be "" if both the Service is in the same namespace as the Pod and the POD_NAMESPACE environment variable is properly set.

Using this is then easy. For example, to create a PJSIP endpoint from the set of proxy servers running as the "kamailio" service:

pjsip.d/proxies.conf:

[proxies]
type=endpoint
transport=k8s-internal-ipv4-external-media
context=from-proxies
disallow=all
allow=ulaw
aors=proxies
rtp_symmetric=yes

[proxies]
type=aor
{{range .EndpointIPs "kamailio"}}
contact=sip:{{.}}
{{end}}

[proxies]
type=identify
endpoint=proxies
{{range .EndpointIPs "kamailio"}}
match={{.}}
{{end}}

[proxies]
type=acl
deny=0.0.0.0/0.0.0.0
{{range .EndpointIPs "kamailio"}}
permit={{.}}
{{end}}

The Endpoints IPs will be monitored by Asterisk Config, and if they are updated, the configuration files will be regenerated, and a reload will be performed.

Network data

The IP addresses for the running Pod are made available, as well.

Format: {{.Network "<kind>"}}

The available data kinds correspond to the data available from NetDiscover:

  • "hostname"
  • "privatev4"
  • "publicv4"
  • "publicv6"

Note that PJSIP transports are already automatically set up, as described above.

asterisk-config's People

Contributors

basheuft avatar ulexus avatar vkruoso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asterisk-config's Issues

Configuration users

hello, I would like to congratulate you on this project.
I have installed and configured but I have a problem with the test I would like to know how a user A can reach another user B with asterisk-config.

allow for unzipped config

I want to be able to construe /source directly from one or several configmaps / secrets without the need to package them as zip file previously. So that I can use kubernetes native (kustomize) gitops workflows (I could write my own kustomize zip generator, though) and factor configuration into layers through (kustomize) merge directives:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./00-rbac.yaml
- ./01-nats.yaml
- ./02-kamailio.yaml
- ./03-asterisk.yaml
secretGenerator:
- name: asterisk-config-base
  namespace: voip
  behavior: [create|replace|merge]  # this allows me to better factor configuration into pieces
  files:
  - modules.conf=asteriskconfig/modules.conf

- name: asterisk-config-ari.d
  namespace: voip
  behavior: [create|replace|merge]  # this allows me to better factor configuration into pieces
  files:
  - admin.conf=asteriskconfig/ari.d/admin.conf

- name: asterisk-config-pjsip.d
  namespace: voip
  behavior: [create|replace|merge]  # this allows me to better factor configuration into pieces
  files:
  - proxies.conf.tmpl=asteriskconfig/pjsip.d/proxies.conf.tmpl

- name: asterisk-config-extensions.d
  namespace: voip
  behavior: [create|replace|merge]  # this allows me to better factor configuration into pieces
  files:
  - inbound.conf.tmpl=asteriskconfig/extensions.d/inbound.conf.tmpl
    spec:
      volumes:
        - name: config
          emptyDir: {}
        - name: custom-base
          secret:
            secretName: asterisk-config-base
        - name: custom-ari-d
          secret:
            secretName: asterisk-config-ari.d
        - name: custom-pjsip-d
          secret:
            secretName: asterisk-config-pjsip.d
        - name: custom-extensions-d
          secret:
            secretName: asterisk-config-extensions.d
      containers:
        - name: config
          image: cycoresystems/asterisk-config
          volumeMounts:
            - name: config
              mountPath: /etc/asterisk
            - name: custom-base
              mountPath: /source
            - name: custom-arid
              mountPath: /source/ari.d
            - name: custom-pjsipd
              mountPath: /source/pjsip.d
            - name: custom-extensions-d
              mountPath: /source/extensions.d

Re-render is not triggered on secret value change

When changing the zip file in the secret that is mounted in the asterisk-config volume, it does not detect it and re-renders the template. This makes it hard to have dynamic configuration except from the already implemented reactivity based on the network changes.

Possible solutions:

Race condition on asterisk custom configuration

I have been able to successfully deploy Kamailio and Asterisk with asterisk-config as a sidecar in GCP picking up the custom configuration files from a kubernetes secret. The overall setup is working fine (thanks for that Sean!) but occasionally asterisk-config container fails and the pod is restarted. Once the pod is restarted, asterisk fails to load the custom modules.conf stored in the K8s secret and instead, it loads the default modules.conf that is shipped with the cycore image hosted at Dockerhub.

These are the startup logs for asterisk-config. It seems to be detecting lots of changes even though nothing has changed and maybe this is causing the issue.

2018/10/08 21:23:34 WARNING: unhandled cloud
2018/10/08 21:23:34 running service
2018/10/08 21:23:34 change detected
2018/10/08 21:23:34 service exited: failed to reload asterisk modules: failed to contact ARI to reload module res_pjsip.so: Put http://127.0.0.1:8088/ari/asterisk/modules/res_pjsip.so: dial tcp 127.0.0.1:8088: connect: connection refused
2018/10/08 21:23:34 running service
2018/10/08 21:23:35 change detected
2018/10/08 21:23:35 service exited: failed to reload asterisk modules: failed to contact ARI to reload module res_pjsip.so: Put http://127.0.0.1:8088/ari/asterisk/modules/res_pjsip.so: dial tcp 127.0.0.1:8088: connect: connection refused
2018/10/08 21:23:35 running service
2018/10/08 21:23:35 change detected
2018/10/08 21:23:35 service exited: failed to reload asterisk modules: module res_pjsip.so not already loaded
2018/10/08 21:23:35 running service
2018/10/08 21:23:35 change detected
2018/10/08 21:23:35 service exited: failed to reload asterisk modules: module res_pjsip.so reload failed: 503 Service Unavailable
2018/10/08 21:23:35 running service
2018/10/08 21:23:35 change detected
2018/10/08 21:23:35 reloads complete
2018/10/08 21:23:35 change detected
2018/10/08 21:23:35 reloads complete
2018/10/08 21:23:35 change detected
2018/10/08 21:23:35 reloads complete
2018/10/08 21:23:35 change detected
2018/10/08 21:23:35 reloads complete
2018/10/08 21:23:35 change detected
2018/10/08 21:23:35 reloads complete
2018/10/08 21:23:35 change detected
2018/10/08 21:23:35 reloads complete

I've noticed that the first warning indicates that no cloud has been selected but, as you identified in a previous issue from last year's Astricon repo, GKE generates k8s nodes with very long hostnames and includes the word "default" which is problematic for Kamailio. Netdiscover in best-effort mode is able to pick up the same public IP and private IP as if the environment variable was set to GCP. The only difference is in the hostname, when set-up to GCP it gets something such as gke--cluster-default-pool--..*****.internal and in best-effort ....bc.googleusercontent.com.

If I can provide any additional information to debug this issue, please let me know.

Asterisk Applications are not Loaded if Cloud is not Set

Hello,

I am currently trying to get this up and running on Amazon EKS and it is working for the most part. The only problem is if I do not specify a cloud, and run "core show applications" inside of the asterisk cli, these are the applications that I get:


              Answer: Answer a channel if ringing.
            BackGround: Play an audio file while waiting for digits of an extension to go to.
                Bridge: Bridge two channels.
            BridgeWait: Put a call into the holding bridge.
                  Busy: Indicate the Busy condition.
  CallCompletionCancel: Cancel call completion service
  CallCompletionRequest: Request call completion service for previous call
             ClearHash: Clear the keys from a specified hashname.
            ConfBridge: Conference bridge application.
            Congestion: Indicate the Congestion condition.
                  Dial: Attempt to connect to another device or endpoint and bridge the call.
             Directory: Provide directory of voicemail extensions.
            ExecIfTime: Conditional application execution based on the current time.
                 Gosub: Jump to label, saving return address.
               GosubIf: Conditionally jump to label, saving return address.
                  Goto: Jump to a particular priority, extension, or context.
                GotoIf: Conditional goto.
            GotoIfTime: Conditional Goto based on the current time.
                Hangup: Hang up the calling channel.
             ImportVar: Import a variable from a channel into a new variable.
            Incomplete: Returns AST_PBX_INCOMPLETE value.
                   Log: Send arbitrary text to a selected log level.
         MailboxExists: Check to see if Voicemail mailbox exists.
           MessageSend: Send a text message.
                  MSet: Set channel variable(s) or function value(s).
           MusicOnHold: Play Music On Hold indefinitely.
                  NoOp: Do Nothing (No Operation).
              Playback: Play a file.
            Proceeding: Indicate proceeding.
              Progress: Indicate progress.
        RaiseException: Handle an exceptional condition.
             RetryDial: Place a call, retrying on failure allowing an optional exit extension.
                Return: Return from gosub routine.
               Ringing: Indicate ringing tone.
              SayAlpha: Say Alpha.
          SayAlphaCase: Say Alpha.
             SayDigits: Say Digits.
             SayNumber: Say Number.
           SayPhonetic: Say Phonetic.
                   Set: Set channel variable or function value.
           SetAMAFlags: Set the AMA Flags.
              StackPop: Remove one address from gosub stack.
      StartMusicOnHold: Play Music On Hold.
                Stasis: Invoke an external Stasis application.
       StopMusicOnHold: Stop playing Music On Hold.
               Verbose: Send arbitrary text to verbose output.
        VMAuthenticate: Authenticate with Voicemail passwords.
             VMSayName: Play the name of a voicemail user
             VoiceMail: Leave a Voicemail message.
         VoiceMailMain: Check Voicemail messages.
      VoiceMailPlayMsg: Play a single voice mail msg from a mailbox by msg id.
                  Wait: Waits for some time.
             WaitDigit: Waits for a digit to be entered.
             WaitExten: Waits for an extension to be entered.
    -= 54 Applications Registered =-
asterisk-585c5c4ff4-6nqz5*CLI> core show applications
    -= Registered Asterisk Applications =-
              ADSIProg: Load Asterisk ADSI Scripts into phone
                AELSub: Launch subroutine built with AEL
                   AGI: Executes an AGI compliant application.
                Answer: Answer a channel if ringing.
           AudioSocket: Transmit and receive audio between channel and TCP socket
          Authenticate: Authenticate a user
            BackGround: Play an audio file while waiting for digits of an extension to go to.
      BackgroundDetect: Background a file with talk detect.
                Bridge: Bridge two channels.
             BridgeAdd: Join a bridge that contains the specified channel.
            BridgeWait: Put a call into the holding bridge.
                  Busy: Indicate the Busy condition.
  CallCompletionCancel: Cancel call completion service
  CallCompletionRequest: Request call completion service for previous call
       CELGenUserEvent: Generates a CEL User Defined Event.
         ChangeMonitor: Change monitoring filename of a channel.
           ChanIsAvail: Check channel availability
       ChannelRedirect: Redirects given channel to a dialplan target
               ChanSpy: Listen to a channel, and optionally whisper into it.
             ClearHash: Clear the keys from a specified hashname.
            ConfBridge: Conference bridge application.
            Congestion: Indicate the Congestion condition.
         ContinueWhile: Restart a While loop.
       ControlPlayback: Play a file with fast forward and rewind.
             DAHDIScan: Scan DAHDI channels to monitor calls.
              DateTime: Says a specified time in a custom format.
                 DBdel: Delete a key from the asterisk database.
             DBdeltree: Delete a family or keytree from the asterisk database.
               DeadAGI: Executes AGI on a hungup channel.
                  Dial: Attempt to connect to another device or endpoint and bridge the call.
               Dictate: Virtual Dictation Machine.
             Directory: Provide directory of voicemail extensions.
                  DISA: Direct Inward System Access.
              DumpChan: Dump Info About The Calling Channel.
                  EAGI: Executes an EAGI compliant application.
                  Echo: Echo media, DTMF back to the calling party
              EndWhile: End a while loop.
                  Exec: Executes dialplan application.
                ExecIf: Executes dialplan application, conditionally.
            ExecIfTime: Conditional application execution based on the current time.
             ExitWhile: End a While loop.
              ExtenSpy: Listen to a channel, and optionally whisper into it.
           ExternalIVR: Interfaces with an external IVR application.
               ForkCDR: Forks the current Call Data Record for this channel.
              GetCPEID: Get ADSI CPE ID.
                 Gosub: Jump to label, saving return address.
               GosubIf: Conditionally jump to label, saving return address.
                  Goto: Jump to a particular priority, extension, or context.
                GotoIf: Conditional goto.
            GotoIfTime: Conditional Goto based on the current time.
                Hangup: Hang up the calling channel.
      HangupCauseClear: Clears hangup cause information from the channel that is available through HANGUPCAUSE.
                  ICES: Encode and stream using 'ices'.
             ImportVar: Import a variable from a channel into a new variable.
            Incomplete: Returns AST_PBX_INCOMPLETE value.
                   Log: Send arbitrary text to a selected log level.
                 Macro: Macro Implementation.
        MacroExclusive: Exclusive Macro Implementation.
             MacroExit: Exit from Macro.
               MacroIf: Conditional Macro implementation.
         MailboxExists: Check to see if Voicemail mailbox exists.
           MessageSend: Send a text message.
             Milliwatt: Generate a Constant 1004Hz tone at 0dbm (mu-law).
         MinivmAccMess: Record account specific messages.
          MinivmDelete: Delete Mini-Voicemail voicemail messages.
           MinivmGreet: Play Mini-Voicemail prompts.
             MinivmMWI: Send Message Waiting Notification to subscriber(s) of mailbox.
          MinivmNotify: Notify voicemail owner about new messages.
          MinivmRecord: Receive Mini-Voicemail and forward via e-mail.
            MixMonitor: Record a call and mix the audio during the recording.  Use of StopMixMonitor is required to guarantee the audio file is available for processing during dialplan execution.
               Monitor: Monitor a channel.
             Morsecode: Plays morse code.
             MP3Player: Play an MP3 file or M3U playlist file or stream.
                  MSet: Set channel variable(s) or function value(s).
           MusicOnHold: Play Music On Hold indefinitely.
                NBScat: Play an NBS local stream.
                 NoCDR: Tell Asterisk to not maintain a CDR for this channel.
                  NoOp: Do Nothing (No Operation).
             Originate: Originate a call.
                  Page: Page series of phones
          PauseMonitor: Pause monitoring of a channel.
                Pickup: Directed extension call pickup.
            PickupChan: Pickup a ringing channel.
              Playback: Play a file.
             PlayTones: Play a tone list.
        PrivacyManager: Require phone number to be entered, if no CallerID sent
            Proceeding: Indicate proceeding.
              Progress: Indicate progress.
        RaiseException: Handle an exceptional condition.
                  Read: Read a variable.
             ReadExten: Read an extension into a variable.
            ReceiveFAX: Receive a FAX and save as a TIFF/F file.
                Record: Record to a file.
              ResetCDR: Resets the Call Data Record.
             RetryDial: Place a call, retrying on failure allowing an optional exit extension.
                Return: Return from gosub routine.
               Ringing: Indicate ringing tone.
              SayAlpha: Say Alpha.
          SayAlphaCase: Say Alpha.
             SayDigits: Say Digits.
             SayNumber: Say Number.
           SayPhonetic: Say Phonetic.
           SayUnixTime: Says a specified time in a custom format.
              SendDTMF: Sends arbitrary DTMF digits
               SendFAX: Sends a specified TIFF/F file as a FAX.
             SendImage: Sends an image file.
              SendText: Send a Text Message on a channel.
               SendURL: Send a URL.
                   Set: Set channel variable or function value.
           SetAMAFlags: Set the AMA Flags.
                   SMS: Communicates with SMS service centres and SMS capable analogue phones.
            SoftHangup: Hangs up the requested channel.
  SpeechActivateGrammar: Activate a grammar.
      SpeechBackground: Play a sound file and wait for speech to be recognized.
          SpeechCreate: Create a Speech Structure.
  SpeechDeactivateGrammar: Deactivate a grammar.
         SpeechDestroy: End speech recognition.
     SpeechLoadGrammar: Load a grammar.
  SpeechProcessingSound: Change background processing sound.
           SpeechStart: Start recognizing voice in the audio stream.
   SpeechUnloadGrammar: Unload a grammar.
              StackPop: Remove one address from gosub stack.
      StartMusicOnHold: Play Music On Hold.
                Stasis: Invoke an external Stasis application.
        StopMixMonitor: Stop recording a call through MixMonitor, and free the recording's file handle.
           StopMonitor: Stop monitoring a channel.
       StopMusicOnHold: Stop playing Music On Hold.
         StopPlayTones: Stop playing a tone list.
            StreamEcho: Echo media, up to 'N' streams of a type, and DTMF back to the calling party
                System: Execute a system command.
            TestClient: Execute Interface Test Client.
            TestServer: Execute Interface Test Server.
              Transfer: Transfer caller to remote extension.
               TryExec: Executes dialplan application, always returning.
             TrySystem: Try executing a system command.
        UnpauseMonitor: Unpause monitoring of a channel.
             UserEvent: Send an arbitrary user-defined event to parties interested in a channel (AMI users and relevant res_stasis applications).
               Verbose: Send arbitrary text to verbose output.
        VMAuthenticate: Authenticate with Voicemail passwords.
             VMSayName: Play the name of a voicemail user
             VoiceMail: Leave a Voicemail message.
         VoiceMailMain: Check Voicemail messages.
      VoiceMailPlayMsg: Play a single voice mail msg from a mailbox by msg id.
                  Wait: Waits for some time.
             WaitDigit: Waits for a digit to be entered.
             WaitExten: Waits for an extension to be entered.
          WaitForNoise: Waits for a specified amount of noise.
           WaitForRing: Wait for Ring Application.
        WaitForSilence: Waits for a specified amount of silence.
             WaitUntil: Wait (sleep) until the current time is the given epoch.
                 While: Start a while loop.
            Zapateller: Block telemarketers with SIT.
    -= 152 Applications Registered =-

All of the Applications including the AudioSocket Application shows up. The problem is when the Audiosocket application is not registered when I do not specify the cloud, the call ends because Asterisk can not find the AudioSocket Application.

However, if I specify "aws" as the cloud, the asterisk-config container finds the wrong privateIPv4 address and puts it in the pjsip.d/k8s-asterisk-config.conf.tmpl file. So when the ACK comes from my provider, kamailio is unable to send the ACK back to the right nated ip address and the call hangs up after 32 seconds by asterisk because it never received the ACK.

I have solved this by 1) not providing it a cloud parameter. and 2) ssh into the asterisk container, running netdiscover or "hostname -I" to get the containers privateIPv4 and setting it in the pjsip.d/k8s-asterisk-config.conf.tmpl.

I would like to know, what is the best solution to get both the right ip address and to get the asterisk Audiosocket application to register?

Migrate to mainline k8s client

The ericchiang client we currently use was great for its time, but now that the kubernetes client is split off from the main package, we should use it instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.