Trouble settings up the hello world example

Hi everyone,

I’m toying around and a trying to setup the Hello World example on a Cloud server. I’m currently unable to hear the Hello World message although I believe Asterisk is playing it correctly. Let me give you a little bit more context.

How I installed Asterisk

Im using Asterisk 16.2.1~dfsg-1+deb10u1 that I installed from Debian 10’s repositories using the following command:

sudo apt install asterisk

Configuration files

/etc/asterisk/extensions.conf

[from-internal]
exten = 100,1,Answer()
same = n,Wait(1)
same = n,Playback(hello-world)
same = n,Hangup()

/etc/asterisk/sip.conf

[general]
context=default

[6001]
type=friend
context=from-internal
host=dynamic
secret=******
disallow=all
allow=ulaw

/etc/asterisk/pjsip.conf

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0

[6001]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=6001
aors=6001

[6001]
type=auth
auth_type=userpass
password=******
username=6001

[6001]
type=aor
max_contacts=1

My cloud server has a public IP address and I’m using Zoiper on Ubuntu to make the call. If it’s relevant, my workstation is on a home network using NAT.

Using Asterisk’s console, I’m able to to see that my calls somehow reaches the server by I cannot hear anything. I’ve confirmed that may audio works correctly using Zoiper’s audio check. Here are the logs printed by Asterisk when I make the call.

Connected to Asterisk 16.2.1~dfsg-1+deb10u1 currently running on ov-90142f (pid = 8219)
  == Setting global variable 'SIPDOMAIN' to '185.181.160.39'
    -- Executing [100@from-internal:1] Answer("PJSIP/6001-00000003", "") in new stack
       > 0x7f5130011ef0 -- Strict RTP learning after remote address set to: 83.77.39.XXX:8000
    -- Executing [100@from-internal:2] Wait("PJSIP/6001-00000003", "1") in new stack
    -- Executing [100@from-internal:3] Playback("PJSIP/6001-00000003", "hello-world") in new stack
    -- <PJSIP/6001-00000003> Playing 'hello-world.gsm' (language 'en')
    -- Executing [100@from-internal:4] Hangup("PJSIP/6001-00000003", "") in new stack
  == Spawn extension (from-internal, 100, 4) exited non-zero on 'PJSIP/6001-00000003'

It looks like it answering correctly and playing the sound but I can’t here anything as I said. Am I missing something ? Do I need to setup anything more ?

Any help would be much appreciated.

Good evening.

Did you open and forward the RTP ports to your cloud server?

/etc/asterisk/rtp.conf should have the range defined.

This isn’t the cause of the problem (well it shouldn’t be based on the log), but just be aware that while you can load both channel drivers it’s not recommended unless needed. And unless you change the transport bind port in one of the configurations you’ll potentially have other problems depending on which driver loads first.

I’d recommend dropping chan_sip, and removing the configuration and just use pjsip here.

1 Like

Hi,

Thank you for your replies.

@johnkiniston

The range specified in the /etc/asterisk/rtp.conf file is the following:

;
; RTP Configuration
;
[general]
;
; RTP start and RTP end configure start and end addresses
;
; Defaults are rtpstart=5000 and rtpend=31000
;
rtpstart=10000
rtpend=20000

for the purpose of my tests, I had already disabled any firewall so I guess Asterisk can freely access those ports. What do you mean by forward ?

@kharwell Good catch. I must have read too fast. I did not realize that I had to choose one. I’ll drop sip.conf and try again.

Edit: It does not appear to change anything

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