KPN SIP Asterisk configuration pjsip

  • 20 April 2022
  • 1 reactie
  • 918 keer bekeken

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

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

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

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

[kpn-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

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

[kpn-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

[kpn-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.

 

 


Dit topic is gesloten. Staat je antwoord hier niet bij, gebruik dan de zoekfunctie van de Community of stel je vraag in een nieuw topic.

1 reactie

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

[kpn-auth]

type = auth

auth_type = userpass

username = aabaNNNNNNN@ims.imscore.net

password = PA55W0RDPA55W0RD

[kpn-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

[kpn-aor]

type = aor

contact = sip:ims.imscore.net

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

[kpn-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

[kpn-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

[auth-userpass](!)

type = auth

auth_type = userpass

[aor-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

[1107](endpoint-internal-d70)

auth = 1107

aors = 1107

callerid = Lindsey Freddie <1107>

[1107](auth-userpass)

password = PA55W0RDPA55W0RD

username = 1107

[1107](aor-single-reg)

mailboxes = 1107@example

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

;Terry Jules

;Director of Sales

[1109](endpoint-internal-d70)

auth = 1109

aors = 1109

callerid = Lin Phone <1109>

[1109](auth-userpass)

password = PA55W0RDPA55W0RD

username = 1109

[1109](aor-single-reg)

mailboxes = 1109@example

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

[my-itsp]

type = endpoint

aors = my-itsp

outbound_auth = my-itsp-auth

disallow = all

allow = alaw

context = DCS-Incoming

[my-itsp]

type = aor

contact = sip:192.168.0.9

qualify_frequency = 15

[my-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

[my-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.