From 3f1ce20a5a4d92457fd3b0981bc2a4ace9a72dd8 Mon Sep 17 00:00:00 2001 From: Jay Date: Sat, 27 Aug 2022 17:23:19 +0000 Subject: [PATCH] Initial Instructions --- README.md | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 114 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fb67606..2b514c0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,115 @@ -# hamshackhotline-iax-trunk-quickstart +# Quickstart/Cheatsheet For IAX Trunks On Hamshack Hotline -Confirmation of what config works for an IAX2 trunk in to Hamshack Hotline. \ No newline at end of file +Hamshack Hotline is a VoIP network available to licensed hams. They do allow IAX2 trunking if you run your own PBX. The TOS only allows you to use this trunk for HSH services only. + +It's easy enough to keep everybody seperated on my PBX. I don't bother with dial prefixes because everyone has a line: + +- VOIP.MS US number: PJSIP/shackus +- VOIP.MS CA number: PJSIP/shackca +- VOIP.MS UK number: PJSIP/shackuk +- VOIP.MS US PICKMY: PJSIP/pickmyus +- Hamshack Hotline: PJSIP/hsh +- INTERNAL: PJSIP/internal + + +Dial rules for each account specify where calls go. Yeah, it'd be crazy easy to just pick up the phone; dial a string of numbers; and route it where I want. But my phone literally supports 16 SIP accounts/lines. I have no problem hitting a button; I want that physical line feeling. + + +## iax.conf + +``` +[general] +register => user:secret@hhus.hamshackhotline.com + +[guest] +type=user +context=internal + +[hshot] +type=friend +host=hhus.hamshackhotline.com +trunk=yes +username=user/extension +secret=HHSECRETCODE +insecure = port,invite +requirecalltoken = no +context=hamshackhotline +auth = md5 +disallow = all +allow = ulaw +codecpriority = host +transfer = no +callerid = asreceived +;deny = 0.0.0.0/0.0.0.0 +;permit = 144.202.54.216/255.255.255.255 +``` + +If you try to decipher their FreePBX instructions in to something Asterisk uses; it's doing the method of creating an inbound AND outbound trunk. I've also seen a configuration floating around that looke like this: + +``` +;[userID] +;type = peer +;context = hamshackhotline +;secret = secret +;host = dynamic +;encryption = no +;insecure = port,invite +;requirecalltoken = no +;qualify = yes +;trunk = yes + +;[userID] +;type = user +;host=hhus.hamshackhotline.com +;context = hamshackhotline +;username = user/extension +;secret = secret +;encryption = no +;insecure = port,invite +;requirecalltoken = no +;trunk = yes +;callerid = HamshackHotline +``` + +This configuration would work; but it gets in to how IAX authentication works. For incoming where `type=user` it totally ignores the `username=` option and instead looks for a context that matches. Outgoing is entirely different. + +Look...there's probably a reason that when I've always been trunking two Asterisk machines together, I use `type=friend`. + +## extensions.conf + +Hamshack hotline uses 3, 5, 8, and 10 digit extensions. Our incoming extension *should* be our full number. Since I have all my stuff split out in to their own configuration files, here's my `hamshackhotline.conf` file: + + +``` +[hamshackshotline] +include => hsh-inbound +include => hsh-outbound + +[hsh-inbound] +exten => 6100001142,1,Dial(PJSIP/hsh) + +[hsh-outbound] +exten = _XXX,1,Set(CALLERID(all)=NQ4T <6100001142>) +same = n,Dial(IAX2/hshot/${EXTEN}) +exten = _XXXX,1,Set(CALLERID(all)=NQ4T <6100001142>) +same = n,Dial(IAX2/hshot/${EXTEN}) +exten = _XXXXX,1,Set(CALLERID(all)=NQ4T <6100001142>) +same = n,Dial(IAX2/hshot/${EXTEN}) +exten = _XXXXXXXXXX,1,Set(CALLERID(all)=NQ4T <6100001142>) +same = n,Dial(IAX2/hshot/${EXTEN}) +exten = _*XX,1,Set(CallerID(all)=NQ4T <6100001142>) +same = n,Dial(IAX2/hshot/${EXTEN}) +``` + +This does in fact follow the same convention as others; the context we call from the trunk just includes seperate sets of rules. Naturally you could combine everythig under one context. This just helps keep things nice and neat. + +The dialplan for PJSIP/hsh is literally just this: + +``` +[hshotline] +include => hsh-outbound +``` + +This is the other reasons I seperate the outgoing dial rules; it allows for some flexibility in the future. For my VOIP.MS configuration there's an outgoing context and then Goto's for my phones. I could probably clean all that up and simplify it. + +Oh well, good luck. 73.