title: How to configure on asterisk trunk PJSIP<->SIP?
body: <p>I've got a problem with configure trunk on asterisk with PJSIP(IP:X.X.X.X) to SIP-server(IP:Y.Y.Y.Y).
  I want to configure trunk by IP not with user:pass.</p>
  <p>On SIP-server i have config in sip.conf file like below:</p>
  <pre><code>[asterisk-pjsip]
  type=peer
  context=tests
  host=X.X.X.X
  deny=0.0.0.0/0.0.0.0
  permit=X.X.X.X
  qualify=yes
  disallow=all
  allow=g729
  allow=alaw
  allow=ulaw
  nat=yes
  canreinvite=no
  insecure=port,invite
  </code></pre>
  <p>and on SIP-server peer with PJSIP are available:</p>
  <pre><code>asterisk-pjsip            X.X.X.X                               Yes        Yes         A  5060     OK (11 ms)
  </code></pre>
  <p>On PJSIP-Server i use script to convert SIP.conf to PJSIP.conf
  and in SIP.conf i have:</p>
  <pre><code>[asterisk_sip]
  type=peer
  context=tests
  host=Y.Y.Y.Y
  deny=0.0.0.0/0.0.0.0
  permit=Y.Y.Y.Y
  qualify=yes
  disallow=all
  allow=g729
  allow=alaw
  allow=ulaw
  nat=no
  canreinvite=no
  insecure=port,invite
  </code></pre>
  <p>and after conversion to PJSIP.conf i've got this:</p>
  <pre><code>[asterisk_sip]
  type = aor
  contact = sip:Y.Y.Y.Y
  
  [asterisk_sip]
  type = identify
  endpoint = asterisk_sip
  match = Y.Y.Y.Y
  
  [asterisk_sip]
  type = endpoint
  context = tests
  disallow = all
  allow = g729
  allow = alaw
  allow = ulaw
  direct_media = no
  aors = asterisk_sip
  
  [acl]
  type = acl
  permit = Y.Y.Y.Y
  deny = 0.0.0.0/0.0.0.0
  </code></pre>
  <p>and when i past it to /etc/asterisk/pjsip.conf and reload configuration peer on SIP-server are Unavailable:</p>
  <pre><code> Endpoint:  asterisk_sip                                         Unavailable   0 of inf
    Transport:  transport-udp             udp      0      0  0.0.0.0:5060
  </code></pre>
  <p>Please help :)</p>