This config is to allow a Yealink W70B / W56H DECT phone to register as ‘101’, and then place and receive calls via the PSTN (using port fxo 0 0). It’s useful while waiting for number ports (PSTN to SIP provider) to complete instead of putting PSTN on call-divert, and in my case I actually just want to install the SIP-only DECT phone and leave the copper line in place for now. I am aware of the Gigaset N300IP (combined SIP and POTS) but those don’t support PoE. This will allow me to put the W70B PoE DECT base in a good central location and still use the POTS line.

I spent an afternoon trying to figure out why the location service wasn’t working. I could see that directing PSTN to IF_SIP worked, but IF_SIP didn’t know where to send the call. Directing it to the location service didn’t work and there was nothing at all in the syslog. It turns out I needed the mapping function to rewrite the called_nr to 101 so that it would match the registered identity in the location service.

Also, outgoing calls do not work with dial-after dialtone. I had to use dial-after timeout 1. However I was using an ATA to simulate a PSTN line at home so YMMV. Ignore that. When I connected to a real line, the default dial-after dialtone worked fine.

You should update the password to something strong.
That’s this bit here:
authentication-service SER_AUTH
realm 1 smartnode-gw
username 101 password 101



#----------------------------------------------------------------#
#                                                                #
# SN4112/JO/EUI                                                  #
# R6.11 2019-07-02 H323 SIP FXS FXO                              #
# 2024-08-09T18:47:19                                            #
# SN/00A0BA0BD2B7                                                #
# Generated configuration file                                   #
#                                                                #
#----------------------------------------------------------------#

cli version 3.20

clock local default-offset +00:00
webserver port 80 language en
sntp-client
sntp-client server primary uk.pool.ntp.org port 123 version 4

system

  ic voice 0
    low-bitrate-codec g729

profile ppp default

profile call-progress-tone UK_Dialtone
  play 1 5000 350 -13 440 -13

profile call-progress-tone UK_Alertingtone
  play 1 400 400 0 450 0
  pause 2 200
  play 3 400 400 0 450 0
  pause 4 2000

profile call-progress-tone UK_Busytone
  play 1 375 400 0
  pause 2 375

profile call-progress-tone UK_CongestionTone
  play 1 400 400 0
  pause 2 350
  play 3 225 400 0
  pause 4 525

profile call-progress-tone UK_WaitingTone
  play 1 100 400 0
  pause 2 5000

profile call-progress-tone UK_ReleaseTone
  play 1 1500 400 0

profile tone-set default
profile tone-set UK
  map call-progress-tone dial-tone UK_Dialtone
  map call-progress-tone ringback-tone UK_Alertingtone
  map call-progress-tone busy-tone UK_Busytone
  map call-progress-tone waiting-tone UK_WaitingTone
  map call-progress-tone release-tone UK_ReleaseTone
  map call-progress-tone congestion-tone UK_CongestionTone

profile voip default
  codec 1 g711alaw64k rx-length 20 tx-length 20 silence-suppression
  codec 2 g711ulaw64k rx-length 20 tx-length 20 silence-suppression
  no high-pass-filter

profile pstn default
  echo-canceler-hybrid-loss 9

profile sip default
  no autonomous-transitioning

profile aaa default
  method 1 local
  method 2 none

context ip router

  interface eth0
    ipaddress dhcp
    tcp adjust-mss rx mtu
    tcp adjust-mss tx mtu

context cs switch
  national-prefix 0
  international-prefix 00

  routing-table called-e164 RT_FROM_PSTN
    route default dest-service SIP_LOC_SER MAP_CALLED_NR_101

  mapping-table called-e164 to called-e164 MAP_CALLED_NR_101
    map "" to 101

  interface sip IF_SIP
    bind context sip-gateway GW_SIP
    route call dest-interface IF_PSTN_00
    early-disconnect
    use profile tone-set UK

  service sip-location-service SIP_LOC_SER
    bind location-service SER_LOCATION

  interface fxo IF_PSTN_00
    route call dest-table RT_FROM_PSTN
    loop-break-duration min 80 max 300
    disconnect-signal loop-break
    use profile tone-set UK

context cs switch
  no shutdown

authentication-service SER_AUTH
  realm 1 smartnode-gw
  username 101 password 101

location-service SER_LOCATION
  domain 1 smartnode-gw
  match-any-domain

  identity-group default

    registration inbound
      lifetime default 3600 min 1 max 4294967295

  identity 101 inherits default
    display-name 101

    authentication inbound
      authenticate 1 authentication-service SER_AUTH username 101

    registration inbound
      lifetime default 3600 min 1 max 4294967295

context sip-gateway GW_SIP

  interface WAN
    bind interface eth0 context router port 5060

context sip-gateway GW_SIP
  bind location-service SER_LOCATION
  no shutdown

port ethernet 0 0
  medium auto
  encapsulation ip
  bind interface eth0 router
  no shutdown

port fxo 0 0
  use profile fxo gb
  encapsulation cc-fxo
  bind interface IF_PSTN_00 switch
  no shutdown

port fxo 0 1
  shutdown