Patton Smartnode 4120: Number display on incoming

Hello,
Excuse me for my English, I translate with Deepl.
I have a problem with my Patton Smartnode 4120 gateway and the number display on incoming calls.
To check, I had the variable CallerId(all) displayed with a NoOp.
It displays: “”
That is, the number is empty.
The Patton in Telnet displays the number well.
Here are my configurations:
Patton:


#----------------------------------------------------------------#
#                                                                #
# SN4120/2BIS4V                                                  #
# R6.11 2019-07-02 H323 SIP                                      #
# 1970-01-23T23:32:02                                            #
# SN/00A0BA107E7B                                                #
# Generated configuration file                                   #
#                                                                #
#----------------------------------------------------------------#

cli version 3.20
clock local default-offset +00:00
webserver port 80 language en

system

  ic voice 0
    low-bitrate-codec g729

system
  clock-source 1 bri 0 0
  clock-source 2 bri 0 1

profile ppp default

profile tone-set default

profile voip default
  codec 1 g711alaw64k rx-length 20 tx-length 20
  codec 2 g711ulaw64k rx-length 20 tx-length 20

profile pstn default

profile sip default
  no autonomous-transitioning

profile aaa default
  method 1 local
  method 2 none

context ip router

  interface WAN
    ipaddress 192.168.40.21 255.255.255.0

context ip router
  route 0.0.0.0 0.0.0.0 192.168.40.1 0

context cs switch

  routing-table called-e164 RT_ISDN_TO_SIP
    route .T dest-interface IF_SIP

  interface isdn IF_ISDN_00
    route call dest-table RT_ISDN_TO_SIP
    call-reroute emit
    diversion emit

  interface isdn IF_ISDN_01
    route call dest-table RT_ISDN_TO_SIP
    call-reroute emit
    diversion emit

  interface sip IF_SIP
    bind context sip-gateway GW_SIP
    route call dest-service SRV_HG
    remote 192.168.40.10
    address-translation outgoing-call from-header user-part fix patton host-part call
    trust remote

  service hunt-group SRV_HG
    drop-cause normal-unspecified
    drop-cause no-circuit-channel-available
    drop-cause network-out-of-order
    drop-cause temporary-failure
    drop-cause switching-equipment-congestion
    drop-cause access-info-discarded
    drop-cause circuit-channel-not-available
    drop-cause resources-unavailable
    route call 1 dest-interface IF_ISDN_00
    route call 2 dest-interface IF_ISDN_01

context cs switch
  no shutdown

authentication-service AUTH_SRV
  realm 1 patton
  username patton password abcd= encrypted

location-service SER_LOC
  domain 1 192.168.40.10
  match-any-domain

  identity patton

    authentication outbound
      authenticate 1 authentication-service AUTH_SRV username patton

    registration outbound
      registrar 192.168.40.10
      register auto

context sip-gateway GW_SIP

  interface IF_GWSIP
    bind interface WAN context router port 5060

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

port ethernet 0 0
  medium auto
  bind interface WAN router
  no shutdown

port bri 0 0
  clock auto
  encapsulation q921

  q921
    permanent-layer2
    uni-side auto
    encapsulation q931

    q931
      protocol dss1
      uni-side user
      bchan-number-order ascending
      encapsulation cc-isdn
      bind interface IF_ISDN_00 switch

port bri 0 0
  no shutdown

port bri 0 1
  clock auto
  encapsulation q921

  q921
    permanent-layer2
    uni-side auto
    encapsulation q931

    q931
      protocol dss1
      uni-side user
      bchan-number-order ascending
      encapsulation cc-isdn
      bind interface IF_ISDN_01 switch

port bri 0 1
  no shutdown

Patton debug

01:36:35  ICC   > [EP IF_ISDN_00-00b75f78] State: OVERLAP SENDING, Event: TERMINAL PROCEEDING IND
01:36:35  ICC   > [EP IF_ISDN_00-00b75f78] Set state to OUTGOING PROCEEDING
01:36:37  ICC   > [IF_ISDN_00] << Message: primitive=64
01:36:37  ICC   > [IF_ISDN_00] Added endpoint IF_ISDN_00-00b765f8
01:36:37  ICC   > [IF_ISDN_00] NEW CALL. Allocated Endpoint IF_ISDN_00-00b765f8
01:36:37  ICC   > [EP IF_ISDN_00-00b765f8] << [080005]
SETUP (DSS1 User)
  [A1]
  Sending complete
  [04039090A3]
  Bearer capability : 3.1kHz Audio - CCITT
    circuit mode - 64kBit/s - G.711 A-law
  [18018A]
  Channel id : 2 - exclusive
    basic rate interface - is not d-channel - CCITT - b-channel units
  [1E028481]
  Progress indicator : call is not end-to-end isdn, inband info may be present
    public network serving remote user - CCITT
  [6C0B2180333837303635333930]
  Calling party number : 3xxxx5390
    national number - E.164 numbering plan
    presentation allowed - user provided not screened
  [6C0B2083333837303635333930]
  Calling party number : 3xxxx5390
    national number - unknown numbering plan
    presentation allowed - network provided
  [70058135333930]
  Called party number : 5390
    unknown number - E.164 numbering plan

Sip.conf:

[general]

language=fr
qualify=yes
nat=force_rport,comedia
directmedia=update,nonat
localnet=192.168.0.0/255.255.0.0
externrefresh=15
directmediapermit=192.168.0.0/255.255.0.0
port=5060
disallow=all
allow=gsm
allow=alaw
allow=ulaw
dtmfmode=auto
textsupport=yes
accept_outofcall_message = yes
outofcall_message_context = messages
;mailbox=12@defaut				; pour contrôler la led de messagerie MWI
;subscribemwi=no
allowsubscribe=yes
subscribecontext=hints
limitonpeers=yes
notifyringing=yes
notifyhold=yes
notifycid=yes
callcounter=yes

[passerelle]
type=friend
context=entrant
username=patton
description=passerelle_BRI
secret=abc
host=192.168.40.21
insecure=port,invite
canreinvite=no

Thank you for your help.

There isn’t a builtin function called “Callerid”; there is one called “CALLERID”.

If that is not the problem, you will need to provide the “sip set debug on” output, so we can see what is in the From header, and whether the caller ID is present in another header.

Note that chan_sip is no longer effectively supported, canreinvite is the same as directmedia (It is a deprecated old name for it). and localnet is not useful unless you also specify a public address (for NAT).

If I interpret the Patton configuration correctly, you have set it to register with Asterisk, but you are using static addresses for it in Asterisk, so the registration serves no purpose. You appear to have set it to authenticate to Asterisk (outbound), but have disabled authentication, for it, in Asterisk. You have type=friend in Asterisk, which means you want to match on the user part of the From header, in preference to IP address, but the name you are trying to match on doesn’t appear to be configured in the gateway, and you haven’t provided any alternative to the From header to supply the caller ID.

Thank for your help.
To resume, I worked very badly… :upside_down_face:
Really, I thank you for your review. I am an amateur and it’s my first installation.
I used ${CALLERID(all)}. It’s not the problem: this function return me correctly the name but not the number.
I see all that and I come back.

I removed localnet and canreinvite. I replaced friend by type=peer.
The system works but displays always .
The sip debug is very verbose. Maybe I don’t use it very well. I could take this:

<--- Transmitting (NAT) to 192.168.40.21:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.40.21:5060;branch=z9hG4bKba0e82fb86cfc4fd7;received=192.168.40.21;rport=5060
From: <sip:patton@192.168.40.10>;tag=a0c0bf3567
To: <sip:patton@192.168.40.10>;tag=as2da967a4
Call-ID: 4de00ac9afac6a07
CSeq: 1851 REGISTER
Server: Asterisk PBX 16.15.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="337bb995"
Content-Length: 0

I don’t understand what I have to do for the authentication.

You don’t need to register, as you have static addresses, but if you did need to register, your sip.conf entry would need to be called “patton”, not “passerelle”, as the gateway is identifying itself as “patton”.

I put off authentication in patton and username/secret in sip.conf.
This works very well. But phones display always <patton>

sip debug says this:

<--- Transmitting (NAT) to 192.168.40.21:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.40.21:5060;branch=z9hG4bKd6f4aeeb66f0c3512;received=192.168.40.21;rport=5060
From: <sip:patton@192.168.40.10>;tag=d4c8ed4da1
To: <sip:patton@192.168.40.10>;tag=as678f4dbb
Call-ID: 709f5e3a162458a7
CSeq: 18286 REGISTER
Server: Asterisk PBX 16.15.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="30ccecf0"
Content-Length: 0

When I phone myself, sip debug is too verbose so I cannot copy it. But “from” of patton, is always like this:

From: <sip:patton@192.168.40.10>;

I write without Deepl. I hope it’s not too bad?
Thanks.

Unless the information you want appears in the INVITE header, there is nothing you can do at the Asterisk side. I need to know if and where the required information appears in the INVITE. The REGISTER is not useful for this.

What is the register?
The INVITE header is “From” and “to”?

I fond all this in the patton:

This also:

REGISTER is the request to which you provided a log of the response. It is how as system discovers the address of a peer whose address is not fixed.

INVITE has more mandatory headers than From and To. It is the request used to start a call. The headers I’m particularly interested in are From: (mandatory) and P-Asserted-Identity and Remote-Party-ID (both optional), although it is generally easier to provide the whole request, and one needs that to be absolutely sure that what you want to do is impossible.

And this (two images for one page):

The second print of the same page:

It looks like you may have configured it to use P-Asserted-Identity, in which case, for chan_sip, you would need to enable trustrpid. As you are using static addresses, you could have configured it to use From.

I’m not 100% sure, but I think chan_pjsip will always trust p-asserted-identity headers.

I’m sorry if I don’t understand and I’m very grateful for your help.
So I don’t understand what I have to do?
I didn’t set this up myself. These are the default settings of the Patton.
Where I have to use From?

Great!!! You give me the good solution. I modified the Outgoing and the From to use Use calling party URI or E.164 number (Default). I don’t understand why it was configured like this.


It works!

Merci beaucoup pour votre aide, David!
Thank you for your help, David! Can I close the topic?