Skip to main content

Hi All,

Last weekend I’ve been migrated from XS4ALL to KPN VOIP.

After almost 12 hours of struggles I managed to get Asterisk 18 configured.

Information is scarce and it was a lot of trial and error.

Here is my config:

pjsip.conf

============

psimpletrans]
type = transport
protocol = udp
bind = 0.0.0.0

pkpn-auth]
type = auth
auth_type = userpass
username = aabaXXXXXXXX@ims.imscore.net
password = XXXXXXXXXXXXXXXX

pkpn-reg]
type = registration
outbound_auth = kpn-auth
transport = simpletrans
server_uri = sip:ims.imscore.net
client_uri = sip:+31XXXXXXXXX@ims.imscore.net
contact_user = inbound-kpn
outbound_proxy = sip:voip1-ext.kpn.net\;lr
retry_interval = 60

pkpn-aor]
type = aor
contact = sip:ims.imscore.net
outbound_proxy = sip:voip1-ext.kpn.net\;lr

pkpn-out]
type = endpoint
context = default
disallow = all
allow = alaw
outbound_auth = kpn-auth
aors = kpn-aor
outbound_proxy = sip:voip1-ext.kpn.net\;lr
from_user = +31XXXXXXXXX
from_domain = ims.imscore.net

pkpn-id]
type = identify
endpoint = kpn-out
match = voip1-ext.kpn.net

==========

 

Just define an extension inbound-kpn where all the incoming calls are sent.

To send calls to kpn define an extension as below:

exten => _9., 1, Dial(PJSIP/${EXTEN:1}@kpn-out,60)
 same => n, Hangup

All the dialled numbers starting with 9 are forwarded to kpn.

 

I hope it will save hours from your life.

 

 

Ja, dankjewel.

Hieronder vrijwel dezelfde pjsip.conf.  Dit zijn de verschillen:

  • Mijn Asterisk zit achter het modem dat NAT doet. Daarom definieer ik wat mijn vast IPv4-adres is  ( 82.NNN.NNN.NNN ) zoals Asterisk weet hoe de buitenwereld haar ziet.
  • Mijn interne netwerk is 192.168.0.0/24
  • Ik heb twee VoIP toestellen. Interne nummers zijn 1107 en 1109
  • Die 1107 en 1109 komen uit basic-pbx van Asterisk source. Daar komt ook de context DCS-Incoming vandaan.
  • Op 192.168.0.9 zit een test Asterisk, gesprekken van die SIP trunk landen ook in context DCS-Incoming.  Daarmee kan ik binnenkomen gesprekken testen zonder dat ik via de (dure) telefoniewolk ga.

;================================ TRANSPORTS ==

; Our primary transport definition for UDP communication behind NAT.

transport-udp-nat]

type = transport

protocol = udp

bind = 0.0.0.0

; NAT settings

local_net = 192.168.0.0/24

external_media_address = 82.NNN.NNN.NNN

external_signaling_address = 82.NNN.NNN.NNN

;================================ CONFIG FOR SIP ITSP ==

; Registration for KPN VoIP

dkpn-auth]

type = auth

auth_type = userpass

username = aabaNNNNNNN@ims.imscore.net

password = PA55W0RDPA55W0RD

dkpn-trunk]

type = registration

outbound_auth = kpn-auth

transport = transport-udp-nat

server_uri = sip:ims.imscore.net

client_uri = sip:+31NNNNNNNNN@ims.imscore.net

contact_user = inbound-kpn

outbound_proxy = sip:voip1-ext.kpn.net\;lr

retry_interval = 60

dkpn-aor]

type = aor

contact = sip:ims.imscore.net

outbound_proxy = sip:voip1-ext.kpn.net\;lr

dkpn-out]

type = endpoint

context = DCS-Incoming

disallow = all

allow = alaw

outbound_auth = kpn-auth

aors = kpn-aor

outbound_proxy = sip:voip1-ext.kpn.net\;lr

from_user = +31NNNNNNNNN

from_domain = ims.imscore.net

dkpn-id]

type = identify

endpoint = kpn-out

match = voip1-ext.kpn.net

;================================ ENDPOINT TEMPLATES ==

; Our primary endpoint template for internal desk phones.

endpoint-internal-d70](!)

type = endpoint

context = Long-Distance

allow = !all,alaw

direct_media = no

trust_id_outbound = yes

device_state_busy_at = 1

dtmf_mode = rfc4733

dauth-userpass](!)

type = auth

auth_type = userpass

daor-single-reg](!)

type = aor

max_contacts = 1

;================================ ENDPOINT DEFINITIONS ==

; Below are the definitions for all staff devices, listed by department.

;

; Super Awesome Company uses the MAC address of their devices for the auth

; username and the extension number for the name of the endpoint, auth and

; aor objects. If your phones must use the same user ID and auth name then

; you will need to customize the endpoints accordingly.

;================================ MANAGEMENT ==

;Lindsey Freddie

;President for Life

d1107](endpoint-internal-d70)

auth = 1107

aors = 1107

callerid = Lindsey Freddie <1107>

d1107](auth-userpass)

password = PA55W0RDPA55W0RD

username = 1107

d1107](aor-single-reg)

mailboxes = 1107@example

;================================

;Terry Jules

;Director of Sales

d1109](endpoint-internal-d70)

auth = 1109

aors = 1109

callerid = Lin Phone <1109>

d1109](auth-userpass)

password = PA55W0RDPA55W0RD

username = 1109

d1109](aor-single-reg)

mailboxes = 1109@example

;================================

dmy-itsp]

type = endpoint

aors = my-itsp

outbound_auth = my-itsp-auth

disallow = all

allow = alaw

context = DCS-Incoming

dmy-itsp]

type = aor

contact = sip:192.168.0.9

qualify_frequency = 15

dmy-itsp-auth]

type = auth

auth_type = userpass

username = my_username

password = PA55W0RDPA55W0RD

; >my-itsp-reg]

type = registration

; outbound_auth = my-itsp-auth

; server_uri = sip:192.168.0.9

; client_uri = sip:my_username@192.168.0.9

dmy-itsp-identify]

type = identify

endpoint = my-itsp

match = 192.168.0.9

;================================

 

P.S. dit is met Asterisk 16.16, dat is een LTS versie.