Re: [asterisk-users] Help needed with ARI RTP externalMedia bridging please

2021-01-04 Thread Jonathan H
You're a genius, sir! I don't know how I missed the part about ports, but
anyway...

Looks for "channelvars": {
"UNICASTRTP_LOCAL_PORT": "*14880*",

and then

vlc -vvv https://media-ssl.musicradio.com/LBCUK --sout
'#transcode{vcodec=none,acodec=*a*
law,channels=1,samplerate=8000}:rtp{dst=127.0.0.1,port=14880}'

Then the rest as before...

The other change I made was from ulaw to alaw, as ulaw sounded horribly
scratchy, particularly with "s" sounds. alaw was much better.

At last no more dynamic rewriting of moh files and then reloading moh etc
etc!

Thanks again.

On Mon, 4 Jan 2021 at 17:03, Joshua C. Colp  wrote:

> On Sun, Jan 3, 2021 at 4:14 PM Jonathan H  wrote:
>
>> Very simply, I want to pipe some external audio into a channel (bridge)
>> using the externalMedia channel option.
>> Running Asterisk 18 on ubuntu, here's what I did to try and test things
>> out:
>>
>> open a console tab
>> vlc -vvv https://media-ssl.musicradio.com/LBCUK --sout
>> '#transcode{vcodec=none,acodec=ulaw,channels=1,samplerate=8000}:rtp{dst=127.0.0.1,port=5005}'
>>
>> open another console tab
>> wscat -c
>> "ws://localhost:8088/ari/events?api_key=asterisk:asterisk=playback-example"
>>
>> open another console tab
>> curl -v -u asterisk:asterisk -X POST "
>> http://localhost:8088/ari/channels/externalMedia?external_host=127.0.0.1:5005=musicChannel=ulaw=playback-example
>> "
>> curl -v -u asterisk:asterisk -X POST "
>> http://localhost:8088/ari/bridges/musicBridge?type=mixing;
>> then dial in from a phone
>> curl -v -u asterisk:asterisk -X GET "http://localhost:8088/ari/channels
>> "
>> and note the new call channel ID
>> curl -v -u asterisk:asterisk -X POST "
>> http://localhost:8088/ari/bridges/musicBridge/addChannel?channel=> channel from above>,musicChannel"
>>
>
> You're sending media from Asterisk to VLC, not the other way around,
> currently. You need to examine the result from the call to
> channels/externalMedia, this will include the RTP port that Asterisk is
> listening for media on. You then need to pass this to vlc somehow (I'm not
> familar with the VLC options) and have it send RTP to that port.
>
> --
> Joshua C. Colp
> Asterisk Technical Lead
> Sangoma Technologies
> Check us out at www.sangoma.com and www.asterisk.org
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Check out the new Asterisk community forum at:
> https://community.asterisk.org/
>
> New to Asterisk? Start here:
>   https://wiki.asterisk.org/wiki/display/AST/Getting+Started
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Help needed with ARI RTP externalMedia bridging please

2021-01-04 Thread Joshua C. Colp
On Sun, Jan 3, 2021 at 4:14 PM Jonathan H  wrote:

> Very simply, I want to pipe some external audio into a channel (bridge)
> using the externalMedia channel option.
> Running Asterisk 18 on ubuntu, here's what I did to try and test things
> out:
>
> open a console tab
> vlc -vvv https://media-ssl.musicradio.com/LBCUK --sout
> '#transcode{vcodec=none,acodec=ulaw,channels=1,samplerate=8000}:rtp{dst=127.0.0.1,port=5005}'
>
> open another console tab
> wscat -c
> "ws://localhost:8088/ari/events?api_key=asterisk:asterisk=playback-example"
>
> open another console tab
> curl -v -u asterisk:asterisk -X POST "
> http://localhost:8088/ari/channels/externalMedia?external_host=127.0.0.1:5005=musicChannel=ulaw=playback-example
> "
> curl -v -u asterisk:asterisk -X POST "
> http://localhost:8088/ari/bridges/musicBridge?type=mixing;
> then dial in from a phone
> curl -v -u asterisk:asterisk -X GET "http://localhost:8088/ari/channels;
> and note the new call channel ID
> curl -v -u asterisk:asterisk -X POST "
> http://localhost:8088/ari/bridges/musicBridge/addChannel?channel= channel from above>,musicChannel"
>

You're sending media from Asterisk to VLC, not the other way around,
currently. You need to examine the result from the call to
channels/externalMedia, this will include the RTP port that Asterisk is
listening for media on. You then need to pass this to vlc somehow (I'm not
familar with the VLC options) and have it send RTP to that port.

-- 
Joshua C. Colp
Asterisk Technical Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Help needed with ARI RTP externalMedia bridging please

2021-01-03 Thread Jonathan H
Very simply, I want to pipe some external audio into a channel (bridge)
using the externalMedia channel option.
Running Asterisk 18 on ubuntu, here's what I did to try and test things out:

open a console tab
vlc -vvv https://media-ssl.musicradio.com/LBCUK --sout
'#transcode{vcodec=none,acodec=ulaw,channels=1,samplerate=8000}:rtp{dst=127.0.0.1,port=5005}'

open another console tab
wscat -c
"ws://localhost:8088/ari/events?api_key=asterisk:asterisk=playback-example"

open another console tab
curl -v -u asterisk:asterisk -X POST "
http://localhost:8088/ari/channels/externalMedia?external_host=127.0.0.1:5005=musicChannel=ulaw=playback-example
"
curl -v -u asterisk:asterisk -X POST "
http://localhost:8088/ari/bridges/musicBridge?type=mixing;
then dial in from a phone
curl -v -u asterisk:asterisk -X GET "http://localhost:8088/ari/channels;
and note the new call channel ID
curl -v -u asterisk:asterisk -X POST "
http://localhost:8088/ari/bridges/musicBridge/addChannel?channel=,musicChannel"

... and there is silence when I expected either music or at least some kind
of noise.

Is it something I'm doing wrong with the channel mixing, or with the
transcoding with vlc? Been battling this all day and could really use a
second pair of eyes on this.
Thanks.

(PS - of course, I would use the node SDK for live stuff, and not
"asterisk:asterisk" as username/password!)

Here's the VLC output - does "PCMU/8000 on port 5005 RTP/AVP 0" look
reasonable?

o=- 16401160996019665100 16401160996019665100 IN IP4 ip-172-31-37-244
s=Unnamed
i=N/A
c=IN IP4 127.0.0.1
t=0 0
a=tool:vlc 3.0.11
a=recvonly
a=type:broadcast
a=charset:UTF-8
m=audio 5005 RTP/AVP 0
b=AS:64
b=RR:0
a=rtpmap:0 PCMU/8000
a=rtcp:5006
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users