The Latest
Hamshack Hotline - Asterisk PBX
Posted by AG6QV Frank
Tags: HAM

I've been using Asterisk PBX for a long time. It allows us to have multiple phone numbers, including a number in Denmark that all goes to the same phone system. When a fellow HAM pointed me to HamShack Hotline I wanted to expand my existing phone system and enable incoming and outgoing phone calls on the network to and from my HAM shack without adding any new hardware.

The process stared by requesting an new truck to be created on the HamShack Hotline network. This is done by creating a support ticket. The same process is used to obtain a number that can be used with a SIP phone.

A few days later I received an email with my new phone number, my secret password and the endpoint to connect my PBX to. Configuration of the system was to use the IAX protocol (or rather the IAX2 protocol) to connect my Asterisk PBX system to the system operated by HamShack Hotline. This sounds simple but since this was the first time I had to configure this type of connection I needed to do some research and as it turns out a bit of experimentation to get all the setting correct, especially since my PBX system is behind a firewall I needed to configure port forwarding to allow traffic originating from the outside to reach my server.

The first step was to enable port forwarding of the IAX2 protocol and to allow access to the same port from my internal network. The IAX2 protocol uses a single UDP port (4569) for all communication which makes the configuration simple. On the Linux server running the Asterisk PBX software I used these command to enable the port:

firewall.txt
sudo firewall-cmd --add-port=4569/udp --permanent sudo firewall-cmd --reload

Then it was time to configure the trunk and extensions. Asterisk use a number of different configuration files, all located in /etc/asterisk (the default directory for configuration files) In this case there are two files that require changes: iax.conf and extensions.conf. 

iax.conf
; HamShack Hotline Configuration ; Extension 12033 should be replaced with your extension ; Replace ***** with the secret provided by HamShack Hotline register => 12033:*****@hhus.wizworks.net [hamshack] type = friend host = hhus.wizworks.net trunk = yes username = 12033 secret = ***** context = hamshack auth = md5 disallow = all allow = ulaw allow = g726aal2 allow = gsm codecpriority = host transfer = no callerid = asreceived deny = 0.0.0.0/0.0.0.0 permit = 144.202.54.216/255.255.255.255

extensions.conf
; Configure this section to dial ; replace ##### with your extension ; replace <extension> with your own extension ; replace <voicemail> with your own voicemail address [hamshack] exten => #####,1,GotoIfTime(8:00-22:00,*,*,*?open) same => n,Voicemail(<voicemail>) same => n,Hangup() same => n(oepn),Dial(<extension>, 30) same => n,Hangup() ; This section configures asterisk to use HamShack for outgoing numbers ; but only for 4 and 5 digit numbers and 3 digit numbers starting with 3 ; replace "AG6QV" <12033> with your callsign and extension [outbound] ... exten => _XXXXX,1,Set(CALLERID(all)="AG6QV" <12033>) same => n,Dial(IAX2/hamshack/${EXTEN}) exten => _XXXX,1,Set(CALLERID(all)="AG6QV" <12033>) same => n,Dial(IAX2/hamshack/${EXTEN}) exten => _3XX,1,Set(CALLERID(all)="AG6QV" <12033>) same => n,Dial(IAX2/hamshack/${EXTEN})

After making these changes to the Asterisk configuration I was able to make calls to the HamShack Hotline system but I could not receive incoming calls. Instead of waiting on someone to call me I tried to call my own extension from another phone on my system. I got the same error but now had a way to debug the system. Enabling IAX debugging on the Asterisk console revealed the problem. As seen in the output below the incoming call was trying to connect to and extension called 's' and my system was only configured with the 12033 extension I was given by HamShack Hotline.

iax.debug.txt
Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: NEW Timestamp: 00082ms SCall: 06456 DCall: 00000 144.202.54.216:4569 VERSION : 2 CALLED NUMBER : s CODEC_PREFS : (ulaw|alaw|gsm) CALLING NUMBER : 12033 CALLING PRESNTN : 1 CALLING TYPEOFN : 0 CALLING TRANSIT : 0 CALLING NAME : AG6QV Trunk LANGUAGE : en FORMAT : 4 FORMAT2 : ulaw CAPABILITY : 14 CAPABILITY2 : Unknown ADSICPE : 2 DATE TIME : 2021-04-12 12:27:58 CALLTOKEN : 51 bytes

In order to fix this I added a new extension to my dial plan. This small change made incoming calls working. The hack works since I only have one extension on the HamShack Hotline network and there might be a better way of changing the configuration.

I created a support ticket with HamShack Hotline to verify if there was anything on their end that might fix the issue. I received phone calls from two different support engineers but they were not able to point me to a solution or to make any suggestions to changes I could make to my configuration. Since the system is able to bot make and receive phone calls I can live with the hack on using an extension called s. I'm not the only one with similar problems. I found this discussion about the topic but the suggested fix does now work and I already have that setting on my system.


Recent Blog Posts
    Calendar
    October 2021
    SuMoTuWeThFrSa
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31