PJSIP Configuration For AWS/EC2 Based Asterisk 13.1.0

Home » Asterisk Users » PJSIP Configuration For AWS/EC2 Based Asterisk 13.1.0
Asterisk Users 2 Comments

Hello All,

I have an Asterisk server v13.1.0 running on EC2 and I am able to connect and register SIP devices and “see” them on the asterisk CLI. I am also able to place calls, but I am not able to hear any audio on either end after the call is picked up.

I was wondering if you can tell me what a minimal configuration for Asterisk on EC2 looks like. My current pjsip.conf configuration looks like this:

type=transport protocol=udp bind=0.0.0.0
local_net2.31.32.0/20
; In the following two lines, replace “” with the output of
; curl -s http://169.254.169.254/latest/meta-data/public-ipv4
external_media_address= external_signaling_address=

[endpoint_internal](!)
type=endpoint context=from-internal disallow=all allow=ulaw direct_media=no

[auth_userpass](!)
type=auth auth_type=userpass

[aor_dynamic](!)
type=aor max_contacts=1
remove_existing=yes
;Definitions for our phones, using the templates above

;; usernames and passwords etc. below

My security group configuration allows TCP, UDP posrt 5060 inbound, outbound from/to 0.0.0.0/0 and TCP, UDP ports 10000-20000 from/to 0.0.0.0/0.

Should I turn on STUN for my zoiper softphones? Any specific flavor?

What am I doing wrong? Any help appreciated.

2 thoughts on - PJSIP Configuration For AWS/EC2 Based Asterisk 13.1.0

  • OK. I think I found the issue.

    The key is to add

    rtp_symmetric=yes

    Here’s what my final configuration looks like:

    [transport-udp]

    type=transport

    protocol=udp

    bind=0.0.0.0

    ;; for within EC2

    local_net2.31.32.0/20

    ;; For softphones within EC2

    local_net2.168.1.0/24

    external_media_address=

    external_signaling_address=

    ;Templates for the necessary config sections

    [endpoint_internal](!)

    type=endpoint

    context=from-internal

    disallow=all

    allow=!all,ulaw

    direct_media=no

    rtp_symmetric=yes

  • BTW, the allow=!all is equivalent to disallow=all, so you can drop the disallow line.