# Node.js serving audiosocket to Asterisk 18

**URL:** <https://community.asterisk.org/t/node-js-serving-audiosocket-to-asterisk-18/88042>\
**Category:** Asterisk APIs\
**Created:** [March 24, 2021, 1:13pm UTC](https://community.asterisk.org/t/node-js-serving-audiosocket-to-asterisk-18/88042 "2021-03-24T13:13:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcmatak](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/mcmatak/32/5035_2.png) [@mcmatak](https://community.asterisk.org/u/mcmatak)\
**Post date:** [March 24, 2021, 1:13pm UTC](https://community.asterisk.org/t/node-js-serving-audiosocket-to-asterisk-18/88042/1 "2021-03-24T13:13:56Z")

</div>

Hi, i am trying to dial audiosocket from Asterisk 18.

I need this audiosocket at different geo location, so tcp socket is ok for me, chan\_console etc. i think is not solution for me.

I wrote node.js test of how to serve this audio socket

> <https://github.com/matak/audiosocket/blob/main/index.js>

but i get these errors

```auto
Executing [1002@from-internal:1] Verbose("PJSIP/6001-0000000f", ""Call to AudioSocket via Channel interface"") in new stack
Call to AudioSocket via Channel interface
    -- Executing [1002@from-internal:2] Answer("PJSIP/6001-0000000f", "") in new stack
       > 0x7f095403eff0 -- Strict RTP learning after remote address set to: 192.168.4.21:4018
    -- Executing [1002@from-internal:3] AudioSocket("PJSIP/6001-0000000f", "40325ec2-5efd-4bd3-805f-53576e581d13,192.168.4.21:4000") in new stack
       > 0x7f095403eff0 -- Strict RTP switching to RTP target address 192.168.4.21:4018 as source
[Mar 24 00:48:38] WARNING[2799][C-0000000e]: res_audiosocket.c:264 ast_audiosocket_receive_frame: Received non-audio AudioSocket message
[Mar 24 00:48:38] ERROR[2799][C-0000000e]: res_audiosocket.c:297 ast_audiosocket_receive_frame: Failed to read data from AudioSocket
[Mar 24 00:48:38] ERROR[2799][C-0000000e]: app_audiosocket.c:206 audiosocket_run: Failed to receive frame from AudioSocket message forchannel PJSIP/6001-0000000f

```

Is there a better documentation for audiosocket or any information how to implement it? Is it a problem with headers?

Thanks for help

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [April 23, 2021, 1:14pm UTC](https://community.asterisk.org/t/node-js-serving-audiosocket-to-asterisk-18/88042/2 "2021-04-23T13:14:15Z")

</div>

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