Connecting ASL3 and AudioSocket

Setup Information

********** AllStarLink [ASL] Version Info **********

OS : Debian GNU/Linux 12 (bookworm)
OS Kernel : 6.11.0-29-generic

Asterisk : 22.4.1+asl3-3.5.4-1.deb12
ASL [app_rpt] : 3.5.4

Installed ASL packages :

Package Version
============================== ==============================
asl3 3.8-1.deb
asl3-asterisk 2:22.4.1+asl3-3.5.4-1.deb12
asl3-asterisk-config 2:22.4.1+asl3-3.5.4-1.deb12
asl3-asterisk-modules 2:22.4.1+asl3-3.5.4-1.deb12
asl3-menu 1.14-1.deb12
dahdi 1:3.1.0-2
dahdi-dkms 1:3.4.0-6+asl
dahdi-linux 1:3.4.0-6+asl

Inquiry

Hello,

I'm trying to create a node that will connect to an external application through AudioSocket. I managed to setup most of the stuff, and audio is going out through the AudioSocket, unfortunately, although is being received also, it's not sent to other connected clients because, I imagine, there's no PTT. AudioSocket doesn't support receiving DTMF, althgough it can send, receiving is not an option thus, no *99/# to enable/disable PTT.

I tried later to research for a method to use VOX, but, the dialplan doesn't call rpt, so I can't instruct rpt to use vox... or at least, I'm not figuring out how.

Suppose my node is 123456 and my private note running audiosocket is 1001, this is a network only setup, in which I connect to the node using DVSwitch Mobile to do the whole testing.

Here are the relevant configurations for my setup

in rpt.conf

[nodes]
63807 = radio@127.0.0.1/63807,NONE
1001 = radio@127.0.0.1/1001,NONE

[123456](node-main)
statpost_url = http://stats.allstarlink.org/uhandler
idrecording = |iNO0CALL
duplex = 0
rxchannel = dahdi/pseudo
telemdefault = 0

[1001](node-main)
duplex = 0
rxchannel = dahdi/pseudo
telemdefault = 0
context = testsocket

in extensions.conf

[radio-secure]
...
;appended to the [radio-secure] dialplan
exten => 1001,1,Goto(testsocket,1001,1)

[testsocket]
exten => 1001,1,Answer()
      same => n,AudioSocket(66b7feb0-8938-11ee-abd7-0242ac150002,192.168.1.253:5002)

The connection is made manually, the usual, connecting node 123456 with 1001.
I connect with my dvswitch mobile to node 123456, and when talking, my application connected through audiosocket receives audio correctly, but the reply is never heard because the PTT isn't activated.

I tested audio between my application and asl3 using the iax-client dialplan, replacing

same => n,rpt(${NODE}|P|${CALLSIGN}-P)

with

same => n,AudioSocket(66b7feb0-8938-11ee-abd7-0242ac150002,192.168.1.253:5002)

When connecting to asl3 with DVSwitch mobile, this dialplan is executed and I'm able to have bidirectional audio between my audiosocket application and dvswitch mobile. When using rpt I can't, guessing it's related to ptt activation/deactivation, any pointers on how I could activate Vox control in this scenario for node 1001 ?

I couldn't find any option in node definition in rpt.conf to enable a node as a phone node and thus enable vox... any hints ?

Thanks.

While I am not able to completely follow along,
There is no 'phone node', perhaps just a poor choice of words.

I will say that you do not 'make connections' in rpt.conf but define nodes.
Nodes are asterisk cid extensions governed by app_rpt.

Connections are made in extensions.conf
A defined connection in phone mode as far as I know 'may' be limited to node numbers defined in rpt.conf

at the end of a connect stanza in extensions.conf
ie
exten => 29283,n,Rpt,29283|P
So notice the pipe/command separator and the P. That is phone mode.

So, if you have a legit node defined in rpt.conf, by whatever means, you could use the example to connect to it in phone mode. Which by default uses *99 to TX and # to switch back to RX (i think the defaults have not changed anyway).

edit
So, it seems it must be treated as a inbound call to use phone mode.

In your case, you have this audiosocket(?) that must be treated a inbound call and routed in extensions.conf to a node it seems.

Or perhaps you could make a phone patch to the defined device (extension definition required) and have full duplex as desired. Extending the timeout to achieve that.
Sorry, can't help with that without all the ugly details.

Hello Mike,

Thanks for your quick reply.

As you can imagine, although a developer, I'm not really into asterisk, so I'm not aware of where to start tackling this issue.

My intention is to have an application running through AudioSocket (app_audiosocket.so) to receive and send audio from/to asterisk sitting on a private node, and, on demand, connect it to the allstarlink node.

I tested the audiosocket and my implementation directly using dvswitch mobile, basically in extensions.conf, in the iax-client extension definition I replaced the rpt call with audiosocket call. I tried leaving both, with no success, they appear (both) to be blocking, whichever is called first, it stays there untill user disconnects. Here is my iax-client used to test audiosocket:

[iax-client]                            ; for IAX VoIP clients.
exten => ${NODE},1,Ringing()
        same => n,Wait(2)
        same => n,Answer()
        same => n,Set(CALLSIGN=${CALLERID(name)})
        same => n,NoOp(Caller ID name is ${CALLSIGN})
        same => n,NoOp(Caller ID number is ${CALLERID(number)})
        same => n,GotoIf(${ISNULL(${CALLSIGN})}?hangit)
        same => n,Playback(rpt/connected-to&rpt/node)
        same => n,SayDigits(${NODE})
        same => n,AudioSocket(66b7feb0-8938-11ee-abd7-0242ac150002,192.168.1.253:5002)
        same => n,rpt(${NODE}|P|${CALLSIGN}-P) ; this is never called while audiosocket is connected, and vice versa
        same => n(hangit),NoOp(No Caller ID Name)
        same => n,Playback(connection-failed)
        same => n,Wait(1)
        same => n,Hangup

My extension definition that uses the AudioSocket is as simple just

[testsocket]
exten => 1001,1,Answer()
      same => n,AudioSocket(66b7feb0-8938-11ee-abd7-0242ac150002,192.168.1.253:5002)

I then added the exten => 1001,1,Goto(alice,1001,1) to [radio-secure] in order to run this extension when the 1001 node connection happens.

This all works fine, when sending audio out through AudioSocket, whoever talks or plays in the connected nodes, is sent out through the AudioSocket, the Audio reception does not, and that's where I imagine the problem is related to PTT, because extension 1001, running app AudioSocket, doesn't have a method to signal a PTT when audio is incomming.

Is there a possibility in rpt.conf node configuration to explicitely say its a node with Vox activation ? Or tell rpt that extension/node 1001 is a node that requires vox activation (similar to a SIP phone) ? I though about signaling as a Phone because of the SIP autopatch to a voip client method (although many use *99/#, I read a few who managed to use Vox).

I'm a bit lost in this matter, I'd really like to avoid implementing a IAX2/USRP/SIP client for a simple project, AudioSocket is perfect for this.

I can make available the whole set of configuration files for viewing, but it's a basic setup, standard out of the box ASL3 in a docker image, I only added the node config in rpt.conf, the extension and the changes in modules.conf to load res_audiosocket.so and app_audiosocket.so

Thanks.

P.S. I did configure my ASL node in this setup, but just about that.

Several issues to tackle here...
I may not handle them in the same order presented.

The phone mode does have a vox option
|Pv
You might check the wiki for better details. I'm not sure there are better details.

Since you have this connectable from dvs, and as a extension,
that means it is dialable in the dialplan as extension.
So, if that works well enough for you, you might try a phone patch connection and dial that extension.

Check your command assignment for these as my old settings are not likely what they use now. (rpt.conf)

0=autopatchdn ; Autopatch down
69=autopatchup,context=testsocket,noct=1,farenddisconnect=1,dialtime=90000,quiet=1

I took the liberty of using a command of 69 for the phone patch work-around. If you have a autopatchup command default, leave it as is. It probably starts with a 60 or 61.
You can have many as long as they do not conflict with existing commands numerically.

You would dial to reach that extension...
*691001

However, there are other ways to do this I think, but I'm not writing a book here.

Give that a whirl and see if it yields what you are after. Or tell me the issues you run into.

Doing it this way, you don't need to worry about 'phone mode or vox'.
It will be full duplex or half depending on the node/channel driver you care calling it from.
And you have a single direct connect command.
To disconnect, you will need to issue a patch hangup command. ?=autopatchdn

And BTW...
Where is the info on the web on this 'AudioSocket' ?

I'll give it a whirl tomorrow with the autopatch method.

AudioSocket is an app that has been on asterisk for quite a while and really simple protocol, just a type of packet, size and payload

Information on the protocol can be found here

It's pretty much what has been used for Asterisk to connect to audio assistants for callcenters.

Thanks for the help!

I forgot to mention some other....
The iax-client stanza you were using has a qualifier in iax.conf.
So, unless you are a logged-in user with proper credentials, that stanza is not likely to work for you anyway.
So, if you were the iax-client it might?

You would not need this with method above using phone patch.
Not seeing all of your dialplan, I would suggest you remove it in the test.
Careful editing. Don't make it a working thing that you miss for fat fingers.

And I am not qualifying the following in any way.

Because I am not familiar with it. But it looks straight forward enough.

And so it looks. I was using the USRP driver for similar.
I may have use for this animal.Winter project.

1 Like

I'm quite tired, it's late (4am here), yet, can't stop... I'm probably missing something simple...

Stock install, my ASL node configured, all working, added to the bottom of rpt.conf

[1001]
rxchannel = dahdi/pseudo
duplex = 0
context = autopatch
callerid = "Repeater" <0000000000>

and to [functions]

0=autopatchdn ; Autopatch down
61=autopatchup,context=autopatch,noct=1,farenddisconnect=1,dialtime=90000,quiet=1

in extentions.conf

[autopatch]
exten => 1001,1,Verbose(Connecting to AudioSocket)
      same => n,Answer()
      ;same => n,AudioSocket(66b7feb0-8938-11ee-abd7-0242ac150002,192.168.1.253:5002)
      same = n,Dial(AudioSocket/192.168.1.253:5002/40325ec2-5efd-4bd3-805f-53576e581d13/c(slin))
      same => n,Verbose(AudioSocket connection for Node 1001 ended or failed.)
      same => n,Hangup()

The behaviour is the same, using Dial(AudioSocket) or AudioSocket(), 12345 is a placeholder for the node.

Connected to Asterisk 22.4.1+asl3-3.5.4-1.deb12 currently running on 0f95d0e73dec (pid = 13)
0f95d0e73dec*CLI> rpt fun 12345 *611001

allstarlink_3  | ioctl(DAHDI_FREEZONE) failed: Inappropriate ioctl for device
allstarlink_3  | Failed to register zone 'United States / North America': No data available
allstarlink_3  | [2025-07-21 02:38:35.335] WARNING[73]: app_rpt/rpt_bridging.c:568 rpt_play_tone: Cannot start tone on DAHDI/pseudo-891391030
allstarlink_3  | ioctl(DAHDI_FREEZONE) failed: Inappropriate ioctl for device
allstarlink_3  | Failed to register zone 'United States / North America': No data available
allstarlink_3  | [2025-07-21 02:40:03.217] WARNING[73]: app_rpt/rpt_bridging.c:568 rpt_play_tone: Cannot start tone on DAHDI/pseudo-891391030

And with debug 99, verbose 99, rpt debug level 7

0f95d0e73dec*CLI> rpt fun 12345 *611001
[2025-07-21 02:46:25.645] DEBUG[60]: app_rpt/rpt_telemetry.c:386 cancel_pfxtone: cancel_pfxfone!!
[2025-07-21 02:46:25.645] DEBUG[60]: app_rpt.c:1527 collect_function_digits: digits=6  source=0
[2025-07-21 02:46:25.745] DEBUG[60]: app_rpt/rpt_telemetry.c:386 cancel_pfxtone: cancel_pfxfone!!
[2025-07-21 02:46:25.745] DEBUG[60]: app_rpt.c:1527 collect_function_digits: digits=61  source=0
[2025-07-21 02:46:25.745] DEBUG[60]: app_rpt.c:1579 collect_function_digits: @@@@ action: autopatchup, param = context=autopatch,noct=1,farenddisconnect=1,dialtime=90000,quiet=1
[2025-07-21 02:46:25.745] DEBUG[60]: app_rpt/rpt_functions.c:904 function_autopatchup: @@@@ Autopatch up
[2025-07-21 02:46:25.745] DEBUG[60]: app_rpt.c:1588 collect_function_digits: rv=3
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: chan_dahdi.c:14022 dahdi_request: Using channel -2
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: channel_internal_api.c:681 ast_channel_nativeformats_set:  <initializing>: Formats: (none)
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: channel_internal_api.c:693 ast_channel_nativeformats_set:  Channel is being initialized or destroyed
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: stream.c:655 ast_stream_topology_alloc:  Topology Create
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: stream.c:667 ast_stream_topology_alloc:  Created: 0x719198008108
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: stasis.c:605 stasis_topic_create_with_detail: Creating topic. name: channel:1753065985.31, detail:
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: stasis.c:639 stasis_topic_create_with_detail: Topic 'channel:1753065985.31': 0x719198004fe0 created
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: channel.c:949 __ast_channel_alloc_ap: Channel 0x719198002340 'DAHDI/pseudo-510186350' allocated
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: channel_internal_api.c:681 ast_channel_nativeformats_set:  DAHDI/pseudo-510186350: Formats: (ulaw)
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: stream.c:655 ast_stream_topology_alloc:  Topology Create
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: stream.c:667 ast_stream_topology_alloc:  Created: 0x719198008828
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: stream.c:644 stream_topology_destroy:  Topology: 0x719198008108:
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: stream.c:648 stream_topology_destroy:  Destroyed: 0x719198008108
[2025-07-21 02:46:25.745] DEBUG[123][C-00000020]: channel_internal_api.c:701 ast_channel_nativeformats_set:  New topology set
[2025-07-21 02:46:25.745] DEBUG[123]: app_rpt.c:1271 rpt_call: Requested channel DAHDI/pseudo-510186350
[2025-07-21 02:46:25.745] DEBUG[123]: app_rpt/rpt_call.c:32 rpt_disable_cdr: No CDR present on DAHDI/pseudo-510186350
[2025-07-21 02:46:25.745] DEBUG[27]: devicestate.c:364 _ast_device_state: No provider found, checking channel drivers for DAHDI - pseudo
[2025-07-21 02:46:25.745] DEBUG[123]: chan_dahdi.c:9430 dahdi_indicate: Requested indication -1 on channel DAHDI/pseudo-510186350
[2025-07-21 02:46:25.745] DEBUG[123]: app_rpt/rpt_bridging.c:374 dahdi_conf_add: Channel DAHDI/pseudo-510186350 joining conference 1022
[2025-07-21 02:46:25.745] DEBUG[27]: devicestate.c:469 do_state_change: Changing state for DAHDI/pseudo - state 2 (In use)
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: chan_dahdi.c:14022 dahdi_request: Using channel -2
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: channel_internal_api.c:681 ast_channel_nativeformats_set:  <initializing>: Formats: (none)
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: channel_internal_api.c:693 ast_channel_nativeformats_set:  Channel is being initialized or destroyed
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: stream.c:655 ast_stream_topology_alloc:  Topology Create
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: stream.c:667 ast_stream_topology_alloc:  Created: 0x719198011448
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: stasis.c:605 stasis_topic_create_with_detail: Creating topic. name: channel:1753065985.32, detail:
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: stasis.c:639 stasis_topic_create_with_detail: Topic 'channel:1753065985.32': 0x719198011da0 created
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: channel.c:949 __ast_channel_alloc_ap: Channel 0x71919800e620 'DAHDI/pseudo-1775038094' allocated
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: channel_internal_api.c:681 ast_channel_nativeformats_set:  DAHDI/pseudo-1775038094: Formats: (ulaw)
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: stream.c:655 ast_stream_topology_alloc:  Topology Create
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: stream.c:667 ast_stream_topology_alloc:  Created: 0x71919800f7e8
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: stream.c:644 stream_topology_destroy:  Topology: 0x719198011448:
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: stream.c:648 stream_topology_destroy:  Destroyed: 0x719198011448
[2025-07-21 02:46:25.745] DEBUG[123][C-00000021]: channel_internal_api.c:701 ast_channel_nativeformats_set:  New topology set
[2025-07-21 02:46:25.746] DEBUG[27]: devicestate.c:364 _ast_device_state: No provider found, checking channel drivers for DAHDI - pseudo
[2025-07-21 02:46:25.746] DEBUG[27]: devicestate.c:469 do_state_change: Changing state for DAHDI/pseudo - state 2 (In use)
[2025-07-21 02:46:25.746] DEBUG[123]: app_rpt.c:1288 rpt_call: Requested channel DAHDI/pseudo-1775038094
[2025-07-21 02:46:25.746] DEBUG[123]: app_rpt/rpt_call.c:32 rpt_disable_cdr: No CDR present on DAHDI/pseudo-1775038094
[2025-07-21 02:46:25.746] DEBUG[123]: chan_dahdi.c:9430 dahdi_indicate: Requested indication -1 on channel DAHDI/pseudo-1775038094
[2025-07-21 02:46:25.746] DEBUG[123]: app_rpt/rpt_bridging.c:374 dahdi_conf_add: Channel DAHDI/pseudo-1775038094 joining conference 1022
[2025-07-21 02:46:25.846] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:25.846] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:25.846] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:25.846] DEBUG[60]: pbx.c:1391 new_find_extension: returning a canmatch/matchmore--- str=1
[2025-07-21 02:46:25.946] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:25.946] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:25.946] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:25.946] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:25.946] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:25.946] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:25.946] DEBUG[60]: pbx.c:1391 new_find_extension: returning a canmatch/matchmore--- str=0
[2025-07-21 02:46:25.946] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:26.046] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.046] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.046] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.046] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:26.046] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:26.046] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:26.046] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.046] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.046] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.046] DEBUG[60]: pbx.c:1391 new_find_extension: returning a canmatch/matchmore--- str=0
[2025-07-21 02:46:26.046] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:26.046] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1390 new_find_extension: returning an exact match-- first found-- 1001
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1391 new_find_extension: returning an exact match-- 1001
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1391 new_find_extension: returning an exact match-- 1001
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1391 new_find_extension: returning an exact match-- 1001
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1389 new_find_extension: Nothing strange about this match
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:26.147] DEBUG[60]: pbx.c:1394 new_find_extension: return at end of func
[2025-07-21 02:46:26.164] WARNING[123]: app_rpt/rpt_bridging.c:568 rpt_play_tone: Cannot start tone on DAHDI/pseudo-1775038094
[2025-07-21 02:46:26.164] DEBUG[123]: app_rpt/rpt_bridging.c:374 dahdi_conf_add: Channel DAHDI/pseudo-479314194 joining conference 32805

0f95d0e73dec*CLI> rpt stats 12345
************************ NODE 12345 STATISTICS *************************

Selected system state............................: 0
Signal on input..................................: NO
System...........................................: ENABLED
Parrot Mode......................................: DISABLED
Scheduler........................................: ENABLED
Tail Time........................................: STANDARD
Time out timer...................................: ENABLED
Incoming connections.............................: ENABLED
Time out timer state.............................: RESET
Time outs since system initialization............: 0
Identifier state.................................: CLEAN
Kerchunks today..................................: 0
Kerchunks since system initialization............: 0
Keyups today.....................................: 0
Keyups since system initialization...............: 0
DTMF commands today..............................: 5
DTMF commands since system initialization........: 5
Last DTMF command executed.......................: 61
TX time today....................................: 00:00:00:00
TX time since system initialization..............: 00:00:00:00
Uptime...........................................: 00:13:18
Nodes currently connected to us..................: <NONE>
Autopatch........................................: ENABLED
Autopatch state..................................: CONNECTING
Autopatch called number..........................: 1001
Reverse patch/IAXRPT connected...................: DOWN
User linking commands............................: ENABLED
User functions...................................: ENABLED

Yes, the AudioSocket app isn't ran, it doesn't start the connection to my application, the autopatch is always in state connecting.... It's most likely something simple, I'm probably too tired to figure it out, I'll sleep over it, yet, I'll hope for any input!

Thanks.

[1001]
rxchannel = dahdi/pseudo
duplex = 2 ;< get this to work before trying duplex=1/0
context = radio
callerid = "Private-node" <1001>

(you probably need to define functions for this node which would include the autopatch commands, user function enable etc. under the node or under node-main template - you need commands on the node)


This should be contained for function of node 1001 or all nodes
0=autopatchdn ; Autopatch down
61=autopatchup,context=audiosocket,noct=1,farenddisconnect=1,dialtime=90000,quiet=1


[audiosocket]
exten => 1002,1,Verbose(Connecting to AudioSocket)
same => n,Answer()
;same => n,AudioSocket(66b7feb0-8938-11ee-abd7-0242ac150002,192.168.1.253:5002)
same = n,Dial(AudioSocket/192.168.1.253:5002/40325ec2-5efd-4bd3-805f-53576e581d13/c(slin))
same => n,Verbose(AudioSocket connection for Node 1001 ended or failed.)
same => n,Hangup()


So the node is 1001 and the extension having audiosocket is 1002
(you can't connect to yourself)

Dialing from 1001 or other defined node on the system
*611002

Your issue is choosing and following a context.
The patch would dial even without a extension because there is only one entry for the stanza [audiosocket], but that might confuse you I guess.

1st, you should be dialing from a radio node on the system to use phone patch.
And that means all needed functions for that have to be defined for that node.
I doubt you can 'call originate' from Rpt, 1001 inside the dialplan, but I never tried.

When you dial *611002 from a radio extension,
The phone patch goes to the stated context in extensions.conf (audiosocket) for the extension (1002) inside that context. In this case it has both context and extension.
It then executes by order inside that context for the extension, which eventually connects to the app for the calling node.
Follow the code in order and you will find your issues.
It's no different than any other dialplan function, it's how you get to the dialplan from the radio side that is calling a context.

For testing purposes, I might suggest using a sip phone if you have one setup to dial the 1002 extension to verify the dialplan works for the connection to audiosocket.
But don't create one if you don't have it. You have enough issues to fix.

Hello Mike, thank you very much for your help!

I changed 1001 node to inherit the node-main, and changed the context to radio as you said.

[1001](node-main)
rxchannel = dahdi/pseudo
duplex = 2
context = radio
callerid = "Private-Node" <1001>

This way, node 1001 inherits node-main functions, which include *0 and *61.

Regarding the extension, it's a bit puzzling for me, I assumed a Node could have the same extension nr and it would technically be the same, from what I understand of your post, I'm wrong to think this way, they're in fact, two separate things?

I changed the extension to 1002 as you suggested:

[autopatch]
exten => 1002,1,Verbose(Connecting to AudioSocket)
      same => n,Answer()
      ;same => n,AudioSocket(66b7feb0-8938-11ee-abd7-0242ac150002,192.168.1.253:5002)
      same = n,Dial(AudioSocket/192.168.1.253:5002/40325ec2-5efd-4bd3-805f-53576e581d13/c(slin))
      same => n,Verbose(AudioSocket connection for Node 1001 ended or failed.)
      same => n,Hangup()

About the SIP phone, I don't have one no :confused: I might get an android app to simulate a sip phone maybe ? :person_shrugging:

Anyway, after making said changes, here's the result

Connected to Asterisk 22.4.1+asl3-3.5.4-1.deb12 currently running on 0f95d0e73dec (pid = 13)
0f95d0e73dec*CLI> rpt fun 1001 *611002
[2025-07-21 15:51:26.149] WARNING[75]: app_rpt/rpt_bridging.c:568 rpt_play_tone: Cannot start tone on DAHDI/pseudo-1143604251
0f95d0e73dec*CLI>
allstarlink_3  | PBX UUID: 2d0dd10c-5919-4b08-b62c-4ab7e7e988f6
allstarlink_3  | [2025-07-21 15:50:47.061] NOTICE[13]: loader.c:2568 load_modules: 81 modules will be loaded.
allstarlink_3  | [2025-07-21 15:50:47.080] NOTICE[13]: cdr.c:4639 cdr_toggle_runtime_options: CDR simple logging enabled.
allstarlink_3  | [2025-07-21 15:50:47.081] NOTICE[13]: dnsmgr.c:493 do_reload: Managed DNS entries will be refreshed every 300 seconds.
allstarlink_3  | [2025-07-21 15:50:47.086] NOTICE[13]: indications.c:1100 load_indications: Default country for indication tones: us
allstarlink_3  | [2025-07-21 15:50:47.086] NOTICE[13]: indications.c:424 ast_set_indication_country: Setting default indication country to 'us'
allstarlink_3  | [2025-07-21 15:50:47.134] WARNING[13]: chan_dahdi.c:18782 process_dahdi: Only FXO signalled channels may belong to a call group
allstarlink_3  | [2025-07-21 15:50:47.134] WARNING[13]: chan_dahdi.c:18790 process_dahdi: Only FXO signalled channels may belong to a pickup group
allstarlink_3  | [2025-07-21 15:50:47.134] NOTICE[13]: chan_dahdi.c:19943 process_dahdi: Ignoring any changes to 'userbase' (on reload) at line 28.
allstarlink_3  | [2025-07-21 15:50:47.134] NOTICE[13]: chan_dahdi.c:19943 process_dahdi: Ignoring any changes to 'vmsecret' (on reload) at line 36.
allstarlink_3  | [2025-07-21 15:50:47.134] NOTICE[13]: chan_dahdi.c:19943 process_dahdi: Ignoring any changes to 'hasiax' (on reload) at line 40.
allstarlink_3  | [2025-07-21 15:50:47.134] NOTICE[13]: chan_dahdi.c:19943 process_dahdi: Ignoring any changes to 'hasmanager' (on reload) at line 48.
allstarlink_3  | [2025-07-21 15:50:47.134] WARNING[13]: chan_dahdi.c:18782 process_dahdi: Only FXO signalled channels may belong to a call group
allstarlink_3  | [2025-07-21 15:50:47.134] WARNING[13]: chan_dahdi.c:18790 process_dahdi: Only FXO signalled channels may belong to a pickup group
allstarlink_3  | [2025-07-21 15:50:47.451] WARNING[17]: pbx_config.c:2003 startup_event_cb: users.conf is deprecated and will be removed in a future version of Asterisk
allstarlink_3  | Asterisk Ready.
allstarlink_3  | [2025-07-21 15:50:47.646] NOTICE[54]: app_rpt.c:5552 load_config: Domain used for DNS node lookup is: nodes.allstarlink.org
allstarlink_3  | [2025-07-21 15:50:47.647] NOTICE[54]: app_rpt.c:5705 rpt_master: Normal Repeater Init  63807
allstarlink_3  | [2025-07-21 15:50:47.647] NOTICE[54]: app_rpt.c:5705 rpt_master: Normal Repeater Init  1999
allstarlink_3  | [2025-07-21 15:50:47.650] NOTICE[54]: app_rpt.c:5705 rpt_master: Normal Repeater Init  1001
allstarlink_3  | ioctl(DAHDI_FREEZONE) failed: Inappropriate ioctl for device
allstarlink_3  | Failed to register zone 'United States / North America': No data available
allstarlink_3  | [2025-07-21 15:51:26.149] WARNING[75]: app_rpt/rpt_bridging.c:568 rpt_play_tone: Cannot start tone on DAHDI/pseudo-1143604251

The same happens when connecting the public node to 1002, same messages.
The debug messages are also like the last post.

I've read something about a bug related with quiet in the autopatch ? Does this have anything to do with it ? Just because of the message

WARNING[125]: app_rpt/rpt_bridging.c:568 rpt_play_tone: Cannot start tone on DAHDI/pseudo-621209234

Even when I have quiet=1 in the function

61=autopatchup,context=autopatch,noct=1,farenddisconnect=1,dialtime=90000,quiet=1

Thank you for your patience Mike!

P.S.
I believe I am correct to think I also need to add 1001 node under the [nodes] in rpt.conf (or there no connections with him)

1001 = radio@127.0.0.1/1001,NONE

You are not using it as a channel driver for a radio node, but a endpoint to a assigned asterisk extension.
But that is interesting as you might be able to use it as a channel driver ???
I may look at that when I have time.

You did not add quite=1 to the phone patch string. ( a bug currently requires it because it can't play the dialtone sound). It is a work-around.

Hey Mike, I did add, it's there at the end, just to be sure, it's quiet=1 or quite=1 ?

I actually just tried both, and the result is the same, the warning

[2025-07-21 16:26:03.281] WARNING[73]: app_rpt/rpt_bridging.c:568 rpt_play_tone: Cannot start tone on DAHDI/pseudo-1159995446

P.S.

You are not using it as a channel driver for a radio node, but a endpoint to a assigned asterisk extension.
But that is interesting as you might be able to use it as a channel driver ???
I may look at that when I have time.

Well, it does have an option to be used as a channel driver

Channel interface:

exten = 101,1,Verbose("Call to AudioSocket via Channel interface")
 same = n,Answer()
 same = n,Dial(AudioSocket/server.example.com:9092/40325ec2-5efd-4bd3-805f-53576e581d13/c(slin))
 same = n,Hangup()

Spoke too soon!! I hadn't loaded chan_audiosocket.so!! Progress!

load = chan_audiosocket.so

[1001](node-main)
rxchannel = audiosocket/192.168.1.253:5002/40325ec2-5efd-4bd3-805f-53576e581d13
duplex = 2
context = radio
callerid = "Private-Node" <1001>
allstarlink_3  | [2025-07-21 16:38:28.293] NOTICE[54]: app_rpt.c:5705 rpt_master: Normal Repeater Init  1001
allstarlink_3  | [2025-07-21 16:38:28.294] ERROR[62]: app_rpt/rpt_bridging.c:253 __rpt_request: Requested channel AudioSocket/192.168.1.253:5002-40325ec2-5efd-4bd3-805f-53576e581d13 not up?
allstarlink_3  | [2025-07-21 16:38:28.294] WARNING[62]: app_rpt.c:2901 disable_rpt: Disabled broken repeater 1001

BUT!! I got a connection request on my application!! Progress!!

[AUDIOSOCKET CONNECTED] ('172.25.0.3', 52666)
[AUDIOSOCKET] Received UUID: 40325ec25efd4bd3805f53576e581d13
[AUDIOSOCKET] Client closed connection. 
[AUDIOSOCKET DISCONNECTED] ('172.25.0.3', 52666)

quiet=1

Well I just don't know if app_rpt will accept that.
But it might look something like this...

rpt.conf

[1001](node-main)
duplex = 2
rxchannel = AudioSocket/192.168.1.253:5002/40325ec2-5efd-4bd3-805f-53576e581d13/c(slin)
telemdefault = 0
context = Radio

If that works, you need nothing except the connection route for 1001 in the dialplan.
Likely in the radio or radio-secure context of extensions.conf
exten => 1001,1,Rpt,1001

But I can't be sure calling it or format are correct as channel driver.

From some other node, (not 1001)
*31001

You also need to be sure the codec slin is enabled and loading in modules.conf
OR, For best use, just change the codec to ulaw, if that is possible.

Yeah, RPT doesn't like the fact that AudioSocket channel stats is kept down even when connecting, apparently per source code...

https://github.com/AllStarLink/app_rpt/blob/2a61bbfb17d15cffb399d665b0fe9b125a6e237c/apps/app_rpt/rpt_bridging.c#L251C2-L251C15

if (ast_channel_state(chan) != AST_STATE_UP) {
		ast_log(LOG_ERROR, "Requested channel %s not up?\n", ast_channel_name(chan));
		ast_hangup(chan);
		return -1;
	}

After calling (it's a dummy call), rpt_bridging expect channel state to be AST_STATE_UP, but the AudioSocket channel state is DOWN

Object is init with state down

https://github.com/asterisk/asterisk/blob/baf729c7f29fb0ed09f4cb4d77355d647c2b42be/channels/chan_audiosocket.c#L272

Then rpt_bridging calls make call

https://github.com/asterisk/asterisk/blob/baf729c7f29fb0ed09f4cb4d77355d647c2b42be/channels/chan_audiosocket.c#L142

and in audiosocket_call(), ast_audiosocket_init() is called, which returns 0 on success, which is the same as AST_STATE_DOWN

https://github.com/asterisk/asterisk/blob/baf729c7f29fb0ed09f4cb4d77355d647c2b42be/res/res_audiosocket.c#L189

Well, this was almost perfect, unless this small oversight :slight_smile:

I'll install a virtual machine with stock latest asterisk, and install app_rpt manually with source of both, in order to tinker and debug, eventually figure out where to patch (I'm leaning towards patching app_rpt, but need to check if it's an oversight of asterisk keeping state down on audiosocket!).

I believe this to be the best solution to be honest, at least for me and what I intend to do, I'll keep this thread posted on the progress.

P.S. hmmm, forum doesn't let me post url's to github .... changed them to preformatted text instead.

Yes, if you can use it as a channel driver, it would be best.
But there is no reason why it can't be a extension endpoint.

Yea, perhaps you will figure it out before I test it,

You can't post attachments and stuff until you have been here a bit with posts etc.
You might be able to slip it in as code </>

Tbh, I'd love to have it working as an extension endpoint, I'm that stubborn, but I'm feeling quite frustrated with all the failures, and surely, it's because of my lack of knowledge of asterisk, I need to spend more time understanding it.

Can I ask why you are going down the AudioSocket path?

What type of application are you trying to use with the AudioSocket connection?

Is this just for connectivity to an ASL node from your favorite cell phone / PC?

The more you do, the more you learn.
That is just how it works, sorry to say.
Persistence is key. It does take time to acquire the flavor.

How did you make that work ?
Process of elimination... by trying the 9999 ways it does not work to be sure !

I will sit down with this sometime.
I'm just in between a lot of things right now.

What is at the end of your audiosocket connection if I may ask ?

I guess the answer is for both.

I'm developing an AI Assistant for Hams, similar to what of a chatgpt. Right now the aim is to build a simple one just with context added, but the purpose is to train one tailored for a repeater assistant.

The AudioSocket patch was chosen for simplicity tbh, I could on go and implement IAX2/USRP/SIP but would be spending more time with connections instead of what matters most, hence my stubborness with AudioSocket :slight_smile:

There are a couple existing but they're tailored for call center customer support, of little to no use for us, although that's where I found AudioSocket.