ASL3 Autopatch w/ VoIP.ms

I know there have been multiple ASL3 autopatch threads already, but I feel like my situation is different enough to warrant a separate thread. It seems like the issues in the other threads were reported as fixed recently, so I’m unsure if I’m running into bugs or just failing to get the configuration correct.

I am attempting to implement autopatch (and hopefully reverse autopatch too) on my single-node ASL3 system. My single node is a VOTER system. I can find several guides and examples online for autopatch setup, all of which seem to differ slightly:

These are the Asterisk configuration examples provided by VoIP.ms:

I have been through all of these and can’t get an outgoing call established. The farthest I have been able to get is this, using IAX2:

[2024-08-22 11:20:13.030] WARNING[25684]: app_rpt/rpt_bridging.c:572 rpt_play_tone: Cannot start tone on DAHDI/pseudo-1855143395
[2024-08-22 11:20:15.445] WARNING[25685][C-00000009]: bridge.c:776 bridge_base_init: Bridge 19cd1d38-b099-4684-9397-babcc4a22322: Could not create class basic.  No technology to support it.
[2024-08-22 11:20:15.467] WARNING[25684]: app_rpt/rpt_bridging.c:572 rpt_play_tone: Cannot start tone on DAHDI/pseudo-1855143395

Or this, using SIP:

[2024-08-22 08:06:08.510] WARNING[19549] app_rpt/rpt_bridging.c: Cannot start tone on DAHDI/pseudo-1337296973
[2024-08-22 08:06:08.510] ERROR[19550][C-00000009] rtp_engine.c: No RTP engine was found. Do you have one loaded?
[2024-08-22 08:06:08.510] NOTICE[19550][C-00000009] app_dial.c: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
[2024-08-22 08:06:08.520] WARNING[19549] app_rpt.c:  has no PBX?
[2024-08-22 08:06:08.540] WARNING[19549] app_rpt/rpt_bridging.c: Cannot start tone on DAHDI/pseudo-1337296973

Here are my configurations (with some non-related info removed for a cleaner thread)…

rpt.conf:

[general]
node_lookup_method = both

[nodes]
55199 = radio@127.0.0.1/55199,NONE

[node-main](!)
rxchannel = dahdi/pseudo
duplex = 2
context = radio
callerid = "Repeater" <VOIPMS_DID_NUMBER>
accountcode = RADIO

[55199](node-main)
rxchannel = Voter/55199
duplex = 2
context = voipms

[functions]
6=autopatchup,context=voipms,noct=1,farenddisconnect=1,dialtime=20000,quiet=1
0=autopatchdn

iax.conf:

[general]
register => VOIPMS_USERID:VOIPMS_PASSWORD@dallas1.voip.ms
bindport = 4569
disallow = all
allow = ulaw
allow = adpcm
allow = gsm
jitterbuffer = yes
forcejitterbuffer = yes
dropcount = 2
maxjitterbuffer = 4000
maxjitterinterps = 10
resyncthreshold = 1000
maxexcessbuffer = 80
minexcessbuffer = 10
jittershrinkrate = 1
tos = 0x1E
autokill = yes
delayreject = yes

[voipms]
type = peer
username = VOIPMS_USERID
secret = VOIPMS_PASSWORD
host = dallas1.voip.ms
context = voipms
disallow = all
allow = ulaw
requirecalltoken = yes
insecure = port,invite

[radio]
type = user
disallow = all
allow = ulaw
allow = adpcm
allow = gsm
codecpriority = host
context = radio-secure
transfer = no

#tryinclude custom/iax.conf

sip.conf:

[general]
context=default
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
register => VOIPMS_USERID:VOIPMS_PASSWORD@dallas1.voip.ms:5060

[voipms]
type=peer
context=voipms
host=dallas1.voip.ms
username=VOIPMS_USERID
secret=VOIPMS_PASSWORD
disallow=all
allow=ulaw
nat=yes
canreinvite=no
insecure=invite

extensions.conf:

[general]
static = yes
writeprotect = yes

[globals]
HOMENPA = 501
NODE = 55199

[default]
exten => i,1,Hangup

[voipms]
include => voipms-outbound

[voipms-outbound]
exten => _1NXXNXXXXXX,1,Dial(IAX2/voipms/${EXTEN})
exten => _1NXXNXXXXXX,n,Hangup()
exten => _NXXNXXXXXX,1,Dial(IAX2/voipms/1${EXTEN})
exten => _NXXNXXXXXX,n,Hangup()
exten => _011.,1,Dial(IAX2/voipms/${EXTEN})
exten => _011.,n,Hangup()
exten => _00.,1,Dial(IAX2/voipms/${EXTEN})
exten => _00.,n,Hangup()

[radio-secure]
exten => _XXXX!,1,NoOp(Connect from node: ${CALLERID(num)})
same => n,NoOp(Connect to: ${EXTEN})
same => n,NoOp(The Channel IP is ${CHANNEL(peerip)})
same => n,GotoIf($["${CHANNEL(peerip)}" = "127.0.0.1"]?connect)
same => n,GotoIf($[${DB_KEYCOUNT(allowlist/${EXTEN})} = 0]?denylist)
same => n,GotoIf(${DB_EXISTS(allowlist/${EXTEN}/${CALLERID(num)})}?connect)
same => n,NoOp(${EXTEN} not in allowlist, Hangup)
same => n,Hangup
same => n(denylist),GotoIf(${DB_EXISTS(denylist/${EXTEN}/${CALLERID(num)})}?:connect)
same => n,NoOp(${EXTEN} is in denylist, Hangup)
same => n,Hangup
same => n(connect),rpt(${EXTEN})
same => n,Hangup

[pstn-out]
exten => _NXXNXXXXXX,1,playback(ss-noservice)
same => n,Congestion

[radio]
exten => _X11,1,Goto(check_route,${EXTEN},1)
exten => _NXXXXXX,1,Goto(check_route,1${HOMENPA}${EXTEN},1)
exten => _1XXXXXXXXXX,1,Goto(check_route,${EXTEN},1)
exten => _07XX,1,Goto(parkedcalls,${EXTEN:1},1)
exten => 00,1,Goto(my-ip,s,1)

[check_route]
exten => _X.,1,Noop(${EXTEN})
exten => _1800NXXXXXX,2,Goto(invalidnum,s,1)
exten => _1888NXXXXXX,2,Goto(invalidnum,s,1)
exten => _1877NXXXXXX,2,Goto(invalidnum,s,1)
exten => _1866NXXXXXX,2,Goto(invalidnum,s,1)
exten => _1855NXXXXXX,2,Goto(invalidnum,s,1)
exten => _1X00XXXXXXX,2,Goto(invalidnum,s,1)
exten => _1X11XXXXXXX,2,Goto(invalidnum,s,1)
exten => _X11,2,Goto(invalidnum,s,1)
exten => _1NXX555XXXX,2,Goto(invalidnum,s,1)
exten => _1NXX976XXXX,2,Goto(invalidnum,s,1)
exten => _1809XXXXXXX,2,Goto(invalidnum,s,1)
exten => _1900XXXXXXX,2,Goto(invalidnum,s,1)
exten => _1NXXXXXXXXX,2,Goto(pstn-out,${EXTEN:1},1)
exten => _X.,2,Goto(invalidnum,s,1)

#tryinclude custom/extensions.conf

I have this working on voip.ms using the guide. You dont need both sip and iax.

I will review your configs with mine tonight and report back.

Thank you! Just to clarify, I am not trying to use SIP and IAX2 at the same time - I tried them both separately. I would rather use IAX2, but tried SIP since IAX2 was not working and SIP was used in most online examples I found.

My understanding is once you see “Cannot start tone” part of the call is dropped. The rpt_play_dialtone() function tries to play a tone, gives you the “Cannot start tone” message, and returns -1. Then these functions run which, I think, take down the call or part of the call. I say “part of the call” because in my testing, I was able to hear the receiver audio over the phone for a while after this happened. But I could not send any audio from the phone to the transmitter.

 /* start dialtone if patchquiet is 0. Special patch modes don't send dial tone */
        if (!myrpt->patchquiet && !myrpt->patchexten[0] && rpt_play_dialtone(genchannel) < 0) {
                ast_hangup(mychannel);
                ast_hangup(genchannel);
                myrpt->callmode = 0;
                pthread_exit(NULL);
        }
static int rpt_play_tone(struct ast_channel *chan, int tone)
{
        tone = tone ? DAHDI_TONE_DIALTONE : DAHDI_TONE_CONGESTION;
        if (tone_zone_play_tone(ast_channel_fd(chan, 0), tone)) {
                ast_log(LOG_WARNING, "Cannot start tone on %s\n", ast_channel_name(chan));
                return -1;
        }
        return 0;
}

int rpt_play_dialtone(struct ast_channel *chan)
{
        return rpt_play_tone(chan, 1);
}

Vopi.ms has worked great for me with autopatches on older asterisk systems. I followed their guide for IAX connections. I have reverse patch working as well.

Also, for SIP, I think you will need to be able to load the rtp module (module load res_rtp_asterisk.so), which I was unable to load in my testing.

Here are the changes that I made to my system to work with voip.ms. I am only using outgoing calls. These only show the changes or additions to the configuration files.

First, I added a sub account in the voip.ms console. The sub account is set to IAX2 protocol. I got the password from the email.

Next, I updated the following files.

Note: username is from voip.ms Username field on the sub account page. password is the password generated for voip.ms.

iax.conf

[general]

register => username:password@atlanta.voip.ms:4569

[voipms]
username=username
type=friend
context=autopatch
host=atlanta.voip.ms
secret=password
disallow=all
allow=ulaw
allow=g726aal2
allow=gsm
codecpriority=host
insecure=port,invite
requirecalltoken=yes

extensions.conf

[autopatch]
exten => _1NXXNXXXXXX,1,Dial(IAX2/voipms/${EXTEN})
exten => _1NXXNXXXXXX,2,Congestion
exten => _NXXNXXXXXX,1,Dial(IAX2/voipms/${EXTEN})
exten => _NXXNXXXXXX,2,Congestion

rpt.conf

[functions]
61 = autopatchup,noct = 1,farenddisconnect = 1,dialtime = 20000,context = autopatch  ; Autopatch up

As noted, I have not tried a reverse patch. This line is my primary home line, and it receives the “rings”.

Let me know if I can help further.

Thank you for the information. I have replicated your configuration and voip.ms account settings as you have described. If I leave quiet=1 out of the autopatchup function the same as you did, the node keys up for about half a second and I only get:

[2024-08-22 19:12:52.482] WARNING[41040]: app_rpt/rpt_bridging.c:572 rpt_play_tone: Cannot start tone on DAHDI/pseudo-973385658

and nothing else happens.

However, if I add quiet=1 to the autopatchup function, I get the same:

[2024-08-22 19:17:14.476] WARNING[41295]: app_rpt/rpt_bridging.c:572 rpt_play_tone: Cannot start tone on DAHDI/pseudo-943082306

BUT it does dial and the receiving party does ring. Unfortunately, as soon as the receiving party picks up, I get:

[2024-08-22 19:17:24.915] WARNING[41296][C-00000009]: bridge.c:776 bridge_base_init: Bridge e21994d9-5047-4999-8bff-8a7484c12ece: Could not create class basic.  No technology to support it.
[2024-08-22 19:17:24.942] WARNING[41295]: app_rpt/rpt_bridging.c:572 rpt_play_tone: Cannot start tone on DAHDI/pseudo-943082306

and the call immediately ends.

Got it! I found this post, and added the following line to modules.conf:

load => bridge_simple.so

Now, I am able to make outgoing calls and pass audio both ways. I still have to add quiet = 1 to the autopatchup function to get anything to work, and I still get the rpt_play_tone: Cannot start tone on DAHDI - but outgoing autopatch is working.

There was no mention of bridge in the modules.conf provided with ASL3.

Very nice!

Did you get it to answer? The key is to tell it to match the extension to your phone number, and then answer it like this:

exten=>phonenumber,1,answer();
exten=>phonenumber,n,rpt(nodenumber|Pv);

(put in your actual phone number and node number)

You have to put this in a context that is examined on incoming calls. If the phonenumber matches, then it will connect to the repeater. Don’t forget that you can use the Verbose() function to print text to the asterisk console, it helps debugging a lot.

–E
de W6EL

Yes! I have fully functional autopatch & reverse autopatch on ASL3. I’m working on a guide (still considered a “draft”): ASL3 Autopatch & Reverse Autopatch · GitHub

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.