Autopatch: Cannot start tone

Hello,

I am trying to get autopatch working on my simplex ASL3 node. Hardware is a Pi4 using usbradio. Asterisk version is:

Asterisk 20.9.1+asl3-3.0.4-1.deb12

First a very basic question. What is the “Allstar Autopatch service” listed in iax.conf? Is this an iax2 connection we can use for outgoing autopatch calls? Perhaps a depreciated offering?

In any case, I have used my own PBX (asterisk) server instead.

The error: When I try and dial an autopatch (DTMF or rpt fun), I see the following error and the call is not placed:

simplex900*CLI> rpt fun 617081 *615558745632 ; (not my actual number!)
[2024-08-16 14:07:13.835] WARNING[26197]: app_rpt/rpt_bridging.c:572 rpt_play_tone: Cannot start tone on DAHDI/pseudo-747982376
    -- Hungup 'DAHDI/pseudo-1203405822'
    -- Hungup 'DAHDI/pseudo-747982376'
simplex900*CLI>

Here is how the patch is connected up for me:
rpt.conf:

61 = autopatchup,noct = 1,farenddisconnect = 1,dialtime = 20000,context=pstn-out  ; Autopatch up
62 = autopatchdn  

extensions.conf (trying for super basic here until it works):

[pstn-out]
exten => _NXXNXXXXXX,1,Dial(IAX2/phonetrunk/\${EXTEN})
 same => n,Busy

iax.conf:

[phonetrunk]
type=peer
username=900
password=SuperSecretPasswordThatMatchesTheOtherServer
auth = md5
context=pstn-out
host=10.0.0.203
disallow=all
allow=ulaw
allow=alaw
allow=adpcm
allow=gsm

Note: my understanding is that if the host is not dynamic, then registration is not needed in iax.conf (because there’s nothing to “find”, each host knows where the other one is). Please tell me if this is incorrect though. Also is “peer” correct, or is “friend” better?

On the server:
iax.conf:

[900]
; This is for the 900 MHz simplex node
username=900
type=peer
secret=SuperSecretPasswordThatMatchesTheOtherServer
context=myphone
host=10.0.0.90
auth=md5
disallow=all
allow=ulaw
allow=alaw
allow=g726aal2
allow=gsm
codecpriority=host
transfer=no
callerid="W6EL" <(555) 555-1212>

extensions.conf:

[myphone]
exten=>41751,1,answer();
exten=>41751,n,rpt(41751|Pv);
include => pbx_server
include => autopatch_ext_process
include => voipms-outbound

I can supply more detail here but it’s working for my Nortel PBX, Zoiper, a SIP adapter, and so on. And thus far it isn’t making it far enough to be noticed by this asterisk server, so I think we’re good on this side.

Sorry for the long support posting, just trying to capture all the details.

Thanks,

–E
de W6EL

I am assuming you are using asl 1/2b
Phone patch will not start a dialtone or will give you an error.
Add this to the command…

quiet=1

It will not attempt to start the dialtone, and later error.

Hi Mike,

Ok, I have added this in, and we are getting further along:

simplex900*CLI> rpt fun 617081 *617475551247
[2024-08-17 16:23:32.675] WARNING[64894]: app_rpt/rpt_bridging.c:572 rpt_play_tone: Cannot start tone on DAHDI/pseudo-1602759307
    -- Executing [7472558630@pstn-out:1] Dial("DAHDI/pseudo-1313547418", "IAX2/phonetrunk/+17472558630") in new stack
    -- Called IAX2/phonetrunk/+17475551247
    -- Hungup 'IAX2/phonetrunk-11100'
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Auto fallthrough, channel 'DAHDI/pseudo-1313547418' status is 'CHANUNAVAIL'
    -- Hungup 'DAHDI/pseudo-1313547418'
[2024-08-17 16:23:43.716] WARNING[64894]: app_rpt/rpt_bridging.c:572 rpt_play_tone: Cannot start tone on DAHDI/pseudo-1602759307
    -- Hungup 'DAHDI/pseudo-1602759307'
  == Manager 'admin' logged on from 127.0.0.1
simplex900*CLI>

We still get a “cannot start tone” but it seems to get a lot further.

On the server, I see this:

[Aug 17 16:23:32] NOTICE[13567]: chan_iax2.c:9575 socket_process: Host 10.0.0.90 failed to authenticate as 900

I tried changing to dynamic, and in that case, I do see the initial registration, but then the same failed message.

    -- Registered IAX2 '900' (AUTHENTICATED) at 10.0.0.90:4568
...
[some time later when calling] NOTICE[13567]: chan_iax2.c:9575 socket_process: Host 10.0.0.90 failed to authenticate as 900

I tried adding some more things to the iax config, on both sides, which didn’t change the behavior any:

insecure=port,invite
requirecalltoken=no

Next, I thought I’d add the username and password within the extensions.conf Dial stanza, like this:

exten => _NXXNXXXXXX,1,Dial(IAX2/900:mypasswordhere@phonetrunk/+1${EXTEN})

With this, the error changes on the server to:

[Aug 17 16:43:43] NOTICE[13826]: chan_iax2.c:9587 socket_process: Rejected connect attempt from 10.0.0.90, request '+17475551212@myphone' does not exist

I think I’m close, but what’s missing?

Thanks,

–E
de W6EL

I really can’t say much on limited info about the actual setup in context.

I might suggest , since you appear to be trying to dial out a pre-defined trunk, try that first on a sip/softphone and not app_rpt phone patch.
Because if all is well in your stanzas and context is correct, then the single line in rpt.conf is all that is needed to use the same…

There are plenty of ways to set-up a trunk and part of that may depend on the trunk itself. So I can not judge that on partial info and knowing the requirements of that specific trunk… Whatever I might say can likely be wrong so why try.

But I will say, there is no way you should be getting the dialtone error if you use the quite=1 in the patchup command.

61 = autopatchup, noct = 1,farenddisconnect =1,dialtime = 2000, context=pstn-out, quite=1

That is all that is required of app_rpt/asl the rest is all asterisk if you are pointed to the correct context in extensions.conf.

There is plenty of help for asterisk trunking online but start with the requirements of your Trunk provider. i have to assume you are using a external service but you did not say…
If you maintain a registered connection, you do not need to do it per instance of a dialstring.connection. Not that you can’t do it that way…
You are showing that the trunk is iax. Is that correct or is it suppose to be a sip trunk ?

Then you have the possibility your trunk provider is also placing the +1 country code and you don’t need to, but I doubt you are that far with a valid config yet.

Also know that with versions of asterisk pre ASLv3, the version of asterisk is very much older and some minor settings may have changed or not the same as help pages you may be looking at…
You still did not say what version of the software you are using.

And I would say you are not communicating with your trunk at all. But that is a guess.

Hi Mike,

The server which I am trying to connect to runs the closed-source hamvoip version from several years ago. I regret this, but it is how it is for now. Once I am sure ASL3 autopatch is working, I will switch the server over to ASL3 as well. ASL3 is much, much better in so many ways, but especially since we can examine the source and contribute meaningfully. The exact version is: “Asterisk 1.4.23-pre.hamvoip-V1.5.3-40-app_rpt-0.327-08/14/2018”

The server currently works fine with my SIP to analog adapter as well as an IAX2 connection to Zoiper on my iPhone. Indeed, the IAX connection for Zoiper and to the ASL3 Simplex Node are nearly the same configuration. The outbound provider is voip.ms, and it’s working fine. The SIP adapter connects two analog lines to my Nortel PBX, and I regularly receive and make calls over it.

Due to the server currently working with an IAX connection to Zoiper as well as SIP to my PBX, I believe the server to basically work. But I am honestly lacking expertise here in exactly how one asterisk connects to another.

The error, Rejected connect attempt from 10.0.0.90, request '+17475551212@myphone' does not exist, seems really strange to me. What exactly doesn’t exist? Clearly the connection attempt does exist, so what does it mean exactly?

At any rate, can I do an autopatch via SIP, just to try something a bit different? I’m thinking this should work if I add a sip configuration and then change the Dial to be a SIP dial. It’ll at least generate new error messages! This would be the ASL3 Simplex Node connecting to the other asterisk server over SIP.

And yes, I do have quiet=1 in the config on the ASL 3 Simplex Node:

61 = autopatchup,noct = 1,farenddisconnect = 1,dialtime = 20000,quiet=1,context=pstn-out; Autopatch up

I’m gonna try the SIP dial, maybe it will work?

Thank you Mike, I appreciate your help.

–E
de W6EL

Ok, I have to admit, I am over my head, I do not actually know how to setup an outgoing SIP trunk. If you have an article somewhere about it, I’m all ears.

–E
de W6EL

You have me confused as to each item you address.

If your sip phone works, then duplicate the contents of the stanza and place it in the autopatch dialing context you are using in extensions.conf and it should function the same.

Otherwise it’s not finding it or is different.

When you dial the autopatch, it goes right to the ‘specified context’ for it’s first instruction, where you should be pattern matching and acting on a matched pattern.

If you are still having issues, post your context stanza for the sip that works and the context stanza of the autopatch.
(mask any passwords)

But I do also have to note that I am not aware of differences with hamvoip. But I would think them the same as asl/1/2 ??

As I said before, most of this is a asterisk thing with exception to the one line in rpt.conf

But here is the wiki on ‘ASL’ autopatch
https://wiki.allstarlink.org/wiki/Setup_Autopatch

There is also this if it helps any
https://wiki.allstarlink.org/wiki/AllStar_SIP_Phone_Configuration

There was a page in the wiki that explained connecting 2 servers via iax but it does not seem to exist anymore or I am blind. I am sure you can google the same.

Hi Mike,

My hamvoip asterisk server accepts SIP from my sip adapter.

Can I make it accept a SIP from my ASL asterisk node? The link you provided is interesting but it seems to be the other way around – the link talks about calling in to your own ASL node via a SIP phone. I don’t really need to do that.

I have this working fine:
SIP Phone → SIP Call → hamvoip asterisk server → PSTN provider

I’d like to try this:
ASL3 AutoPatch → SIP Call → hamvoip asterisk server → PSTN provider

My understanding is that I need to get the ASL3 asterisk to consider the SIP as a trunk through which it can initiate calls. From my readings, it seems that (on the ASL3 side) the “PJSIP” module (chan_pjsip) can do this but chan_sip cannot. But I am not knowledgeable about either.

I’d rather keep it all IAX2 but as you saw, I had an issue with that which has me stumped.

Thanks,

–E
de W6EL

Ok, I found a howto on adding SIP as a trunk:

https://wiki.voip.ms/article/Asterisk_SIP

And this got me so much closer.

However, when I place the call from ASL3, I see the following:

simplex900*CLI> rpt fun 617081 *6115205551212 ; not my actual number... 
[2024-08-18 20:04:55.852] WARNING[105435]: app_rpt/rpt_bridging.c:572 rpt_play_tone: Cannot start tone on DAHDI/pseudo-650545241
    -- Executing [15202610264@pstn-out:1] Dial("DAHDI/pseudo-1909037000", "SIP/+15202610264@555") in new stack
[2024-08-18 20:04:55.852] ERROR[105436][C-0000000d]: rtp_engine.c:511 ast_rtp_instance_new: No RTP engine was found. Do you have one loaded?
[2024-08-18 20:04:55.852] NOTICE[105436][C-0000000d]: app_dial.c:2766 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Auto fallthrough, channel 'DAHDI/pseudo-1909037000' status is 'CHANUNAVAIL'
    -- Hungup 'DAHDI/pseudo-1909037000'
[2024-08-18 20:05:05.891] WARNING[105435]: app_rpt/rpt_bridging.c:572 rpt_play_tone: Cannot start tone on DAHDI/pseudo-650545241
    -- Hungup 'DAHDI/pseudo-650545241'
simplex900*CLI>

This typically means I need to load the RTP resource, however, this will not load:

simplex900*CLI> module load res_rtp_asterisk.so
Unable to load module res_rtp_asterisk.so
Command 'module load res_rtp_asterisk.so' failed.
[2024-08-18 20:06:17.872] ERROR[105307]: loader.c:283 module_load_error: Error loading module 'res_rtp_asterisk.so': /usr/lib/aarch64-linux-gnu/asterisk/modules/res_rtp_asterisk.so: undefined symbol: ast_sockaddr_to_pj_sockaddr

I’m thinking this means the module was not compiled with the correct dependencies or headers, but I am not that familiar with dynamic module loading.

Ideas?

Thanks,

–E
de W6EL

Well, I gave up on this method, and instead, I added another account with my same VoIP provider.

Things almost worked. Then I realized I needed to load another module:

simplex900*CLI> module load bridge_simple.so

And then I was able to place calls!

However, I still have the “Cannot stat tone” warning, and there is no audio transmitted. Using my phone, I can hear the receiver’s audio just fine, but speaking into the phone does not produce any transmission on the simplex node. Maybe this is the same issue as the other person posting this week on autopatch audio issues?

The warning:

simplex900*CLI> rpt fun 617081 *617475552323
[2024-08-18 20:46:42.630] WARNING[106534]: app_rpt/rpt_bridging.c:572 rpt_play_tone: Cannot start tone on DAHDI/pseudo-1757468243
    -- Executing [7475552323@voipmscontext:1] Set("DAHDI/pseudo-419251495", "CALLERID(all)="W6EL" <7472311234>") in new stack
    -- Executing [7475552323@voipmscontext:2] Dial("DAHDI/pseudo-419251495", "IAX2/voipms/+17475552323") in new stack
    -- Called IAX2/voipms/+17472558630
    -- Call accepted by 208.100.60.36:4569 (format ulaw)
    -- Format for call is (ulaw)
    -- IAX2/voipms-14109 is making progress passing it to DAHDI/pseudo-419251495
    -- IAX2/voipms-14109 is making progress passing it to DAHDI/pseudo-419251495
    -- IAX2/voipms-14109 answered DAHDI/pseudo-419251495
    -- Channel IAX2/voipms-14109 joined 'simple_bridge' basic-bridge <1be7e30d-a13c-4e43-aeb7-39779c244703>
    -- Channel DAHDI/pseudo-419251495 joined 'simple_bridge' basic-bridge <1be7e30d-a13c-4e43-aeb7-39779c244703>
    -- Hungup 'DAHDI/pseudo-2146448769'
    -- Channel IAX2/voipms-14109 left 'simple_bridge' basic-bridge <1be7e30d-a13c-4e43-aeb7-39779c244703>
    -- Channel DAHDI/pseudo-419251495 left 'simple_bridge' basic-bridge <1be7e30d-a13c-4e43-aeb7-39779c244703>
  == Spawn extension (voipmscontext, 7472558630, 2) exited non-zero on 'DAHDI/pseudo-419251495'
    -- Hungup 'DAHDI/pseudo-419251495'
    -- Hungup 'IAX2/voipms-14109'
[2024-08-18 20:46:53.833] WARNING[106534]: app_rpt/rpt_bridging.c:572 rpt_play_tone: Cannot start tone on DAHDI/pseudo-1757468243
    -- Hungup 'DAHDI/pseudo-1757468243'
    -- Hungup 'DAHDI/pseudo-1701003639'
simplex900*CLI> 

Indeed, I do have quiet set to 1:

61 = autopatchup,noct=1,farenddisconnect=1,dialtime=20000,quiet=1,context=voipmscontext; Autopatch up

Is the “Cannot stat tone” related to the lack of transmit audio?

Thanks,

–E
de W6EL

I think that quiet mode is not being adhered to due to this commit:

My guess is that we need parenthesis around the negation operator, ie:

if( (!myrpt->patchquiet) && (!myrpt->patchexten[0]) && rpt_play_dialtone(genchannel) < 0) { ...

instead of

if( !myrpt->patchquiet && !myrpt->patchexten[0] && rpt_play_dialtone(genchannel) < 0) { ...

I think it may be as simple as correcting that one line. The stanza above it about the tonezone may also need the same correction.

It seems that if this rpt_play_dialtone thing is called and it fails to play, then it may close down the call. Which doesn’t completely explain how I was able to hear the radio receiver on the phone, but maybe the call isn’t entirely shutdown until you hang up.

–E
de W6EL

I remember this from some time ago, but my memory is faint.

For a test, could you run this in your patchup command (make a duplicate with a new cmd num 65)

65 = autopatchup,noct=1,farenddisconnect=1,dialtime=20000,quiet=1,context=voipmscontext,exten=xxxx 

whereas xxxx is the extension of your siphone so you are in effect dialing your phone with just *65 in this example…

Let me know what works or does not.

Something like this…
Make a sip or iax connection from asl3

[PBX-trunk] ; Setup for outgoing calls - autopatch trunk to hamvoip
type=peer
host=192.168.1.xxx
username=5555
secret=TrunkAP01
context=radio
allow=all

That is the dialout trunk but you must have a receiving extension 5555 on the other server to accept with user/pass and possibly limited to the ip of the asl3 box for security.

So you would dial iax/sip PBX-trunk matched pattern or desired extension
Perhaps like this in extensions.conf …
exten =>_6XXX,1,Dial,IAX2/PBX-trunk/${EXTEN}

So you really must first have a working setup in that hamvoip box, and when you dialout through the trunk, you will be using whatever is required from that box as if it were just any other extension.

Whereas the above is a pattern match of anything 4 digits that starts with a 6 will dial out on the created trunk with the variable full 4 digit extension.(assumes only a 4 digit sip extension in example not a full phone dial trunk)

While the following is NOT a example of your exact needs at the moment,
this is currently how I dial out of my pbx and select the line by prefix.
I have both iax and sip trunks on my primary system. this is the sip part of it.

Example of pattern matching and flow in extensions.conf.
And lots of example of things for later reference.
The prefix I use is removed and the us dialing code (1) is inserted.

It does take some time to absorb this stuff. Trial and error I guess.

; dial-out sip trunk 2267
exten => _1NXXNXXXXXX,1,Set(CALLERID(num)=+1330xxxxxxx)
exten => _1NXXNXXXXXX,2,System(/bin/echo ${CALLERID(num)} - ${EXTEN} - $(date +"%T") - $(date +"%m-%d-%Y") >> /var/www/html/log/Rout-2267.data)
exten => _1NXXNXXNXXX,3,Dial(sip/forsale_out1/${EXTEN},35)    ;     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<;exten => _1NXXNXXNXXX,2,Dial(sip/forsale_out2/${EXTEN},40)    ;     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
exten => _1NXXNXXNXXX,3,Dial(sip/forsale_out2/${EXTEN},35)    ;     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
exten => _1NXXNXXNXXX,n,Hangup()

; dial-out RECORD sip trunk 2267
exten => _*NXXNXXXXXX,1,Set(CALLERID(num)=+1330xxxxxxx)
exten => _*NXXNXXXXXX,2,System(/bin/echo ${CALLERID(num)} - ${EXTEN} - $(date +"%T") - $(date +"%m-%d-%Y") >> /var/www/html/log/Rout-2267.data)
exten => _*NXXNXXNXXX,3,Dial(sip/forsale_out1/${EXTEN},35)    ;     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<;exten => _1NXXNXXNXXX,2,Dial(sip/forsale_out2/${EXTEN},40)    ;     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
exten => _*NXXNXXNXXX,3,Dial(sip/forsale_out2/${EXTEN},35)    ;     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
exten => _*NXXNXXNXXX,n,Hangup()

; dial-out sip trunk 2250
exten => _2NXXNXXNXXX,1,Set(CALLERID(num)=+1330xxxxxxx)
exten => _2NXXNXXNXXX,2,System(/bin/echo ${CALLERID(num)} - ${EXTEN} - $(date +"%T") - $(date +"%m-%d-%Y") >> /var/www/html/log/Rout-2250.data)
exten => _2NXXNXXNXXX,3,Dial(sip/forsale_out1/1${EXTEN:1},35)    ;     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<;exten => _1NXXNXXNXXX,2,Dial(sip/forsale_out2/${EXTEN},40)    ;     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
exten => _2NXXNXXNXXX,3,Dial(sip/forsale_out2/1${EXTEN:1},35)    ;     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
exten => _2NXXNXXNXXX,n,Hangup()

; dial-out sip trunk 9977
exten => _3NXXNXXXXXX,1,Set(CALLERID(num)=+1330xxxxxxx)
exten => _3NXXNXXXXXX,2,System(/bin/echo ${CALLERID(num)} - ${EXTEN} - $(date +"%T") - $(date +"%m-%d-%Y") >> /var/www/html/log/Rout-9977.data)
exten => _3NXXNXXNXXX,3,Dial(sip/forsale_out1/1${EXTEN:1},35)    ;     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
exten => _3NXXNXXNXXX,3,Dial(sip/forsale_out2/1${EXTEN:1},35)    ;     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
exten => _3NXXNXXNXXX,n,Hangup()

Hi Mike,

This is excellent and is very helpful. I had not noticed the extension argument to the autopatch.

Unfortunately there are two outstanding issues:

  1. I cannot use SIP on the ASL3 box because the module with RTP (res_rtp_asterisk.so) will not load (see my earlier email on the topic).

  2. Audio is still hit with the “Cannot start tone” issue, causing the call transmit audio to be dropped. I suspect this is the code issue I identified above that snuck in with some refactoring.

–E
de W6EL

Is that module loading (modules.conf)
And I do wonder if you can recompile dahdi the same with asl3, you might try that.
And the syntax is pretty much the same if you trunk it in iax.so try it.

I have yet to install a asl3 system on x86, because of the complexity of what i have built, and my available time to service or change it,. Pi is not a option for me in cloud installs. I thought it better to wait for it to be ironed out, so there may well be issues there I do not know about, but most times folks just have a problem with syntax issues. I have not the time to beta test on things I rely on.

Hi Mike,

I understand completely. This is also why I have not converted my main system over to ASL3 – too many things depend upon it and I have too little time to try it! This simplex node with ASL3 is helpful though.

Yes, the SIP thing is a module loading issue. Symbol not found (see earlier email). I have tried it in modules.conf as well as just manually loading it from the asterisk console. res_rtp_asterisk.so will not load. It has a dependency from another module which also won’t load. I can dig up details if anyone is interested. Or just try module load res_rtp_asterisk.so and see what happens. Possibly this is due to that module not being recompiled recently (stale), or a broken dependency.

I will probably get the compiling environment setup today on the Pi. I was a bit hesitant to do it due to the complexity of the “phreak” shell script, which is… enormous. But if this is the way, I suppose I will try it. I wish I could tell it to do a bit less config file moving and things like that. Maybe I will customize it for a less intrusive recompile.

Anyone want to volunteer to find why quiet=1 isn’t working? I think some step-by-step debug messages in function_autopatchup and rpt_call will show it pretty easily.

–E
de W6EL

If you think there’s a module bug, please file it in GitHub not post it here.

The problem with res_rpt_asterisk makes me ask if you have enabled pjsip. chan_sip has been deprecated in asterisk.

This is true, however, I was unable to load either module (pjsip or sip). I’ve found chan_sip seems to be working ok on my PBX system despite the depreciation.

I will post an issue on github once I confirm the issue(s) for sure.

–E
de W6EL

This is still fully functional with the latest asterisk.
Are you saying it is not compatible with ASL3 ?


They are due to drop support in next version due soon, but they did say that on the last version.

This may help some convert and or understand
https://docs.asterisk.org/Configuration/Channel-Drivers/SIP/Configuring-res_pjsip/PJSIP-Configuration-Wizard/?h=pjsip