Connect PSTN to asteriskwith SIP trunk

I have a physical SIP trunk and PBX now, and I connected the SIP trunk to the PBX with RJ45 LAN port.
Now, how can I config the SIP in Asterisk pjsip?

here is my pjsip.conf

[hkbn]
type=endpoint
context=from-hkbn
disallow=all
allow=ulaw
aors=hkbn

[hkbn]
type=identify
endpoint=hkbn
match=192.168.0.1:5060

[hkbn]
type=aor
contact=sip:XXXXXXXX@192.168.0.1

here is my extensions.conf

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

exten => _X.,1,Dial(${LOCAL}/hkbn/${EXTEN})

Although the settings seem incomplete and somewhat confusing, I would not think this is right. 10.132.29.52 might be right.

Same here, but also I would not expect the XXXXXXXX@ part to be used. If they really have a proxy, you mighta actually need another address, or a domain name here.

Please provide the definition of LOCAL and explain what the whole line is trying to achieve. I would have expected PJSIP/${EXTEN}@hkbn (last example in Dialing PJSIP Channels - Asterisk Documentation ).

Can the PBX IP reach SIP proxy?

I think that is why they have given the gateway address. There needs to be an explicit route to the proxy via that gateway.,

Port 3 on that router I have to assume is programmed to provide the path to the SIP proxy over a VPN, in addition; that hardware is likely expecting your PBX to be a specific IP. This is less VoIP specific and more general networking.

You don’t interact with 192.168.0.1, that’s a gateway. You have to configure Asterisk to hit the SIP Proxy’s private IP.

I can ping 192.168.0.1 but not 10.132.29.52

You’re correct, the line in extensions.conf should be changed to PJSIP/${EXTEN}@hkbn.

However, I’m still encountering issues with the configuration. I understand that the ITSP settings should be configured in pjsip_wizard.conf. Could you clarify if my physical SIP trunk qualifies as an ITSP, or does ITSP specifically refer to cloud-based SIP providers?

Additionally, I’ve come across other PBX configurations involving my SIP provider. Could you please advise on where to input the following information within Asterisk?

HKBN-configuration.pdf (unify.com)

Have to contact to HKBN about route connection between WAN router port to SIP Proxy (probably they will offer a VPN service).

I consider them still to be in the cloud, just a private part of it.

That information says that the contact should be sip:ippbx.hkbn.net and that you need a proxy defining (probably either sip:10.15.224.199\;lr or sip:10.15.224.199\;lr\;hide. It doesn’t make clear what should be used for match=

You will need a route to 10.15.224.199 added through 192.168.0.1

My starting point for match= would be 10.15.224.199

Apologies, I’m still struggling to grasp the configuration process. The guideline provided by my SIP provider is meant to cover all necessary steps, but it’s leaving me perplexed.

Some sources suggest registering in the pjsip_wizard.conf, while others advocate for creating endpoints in pjsip.conf. My SIP service encompasses 8 Channels and 20 PSTN numbers, all managed by 3 digital DIDs.

I’m uncertain about which components should be configured in pjsip and which in pjsip_wizard.


I’d suggest you start by trying to make an incoming call and capture everything that appears on the LAN. There are certain guesses I can make, but actually seeing a request from them will give a more definitive answer.

You should be able to use tcpdump, in promiscuous mode. You should, at the very least see an ARP, even though you don’t have broadcast media, and that will tell you what IP address you need to set on your interface to the stub LAN.

If Contact-URI is what I think it is, the router is set for NAT operation, which complicates things.

Can you make a ping or traceroute to IP PBX.HKBN.net? From HKBN private IP 10.xx.xx.xx network interface?
Is the router (for 3 to PBX) provided by HKBN?

The router (for 3 to PBX) is provided by HKBN

I can NOT ping ippbx.hkbn.net

ping ippbx.hkbn.net -I enp1s0
ping: ippbx.hkbn.net: Name or service not known

DNS problem, this hostname doesn’t resolve at all

but seem i dont have the host IP? Any tools can search the server IP address?

Ask your provider to give you the right hostname or the IP

Most likely ippbx.hkbn.net does not allow ping.
If on your asterisk ippbx trunk is configured (without registration as indicated on ippbx.hkbn.net specification) could capture packets and analyze (wireshark).

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