Configuration contains a duplicate object

Hi all, the following configuration gives me those errors:

[Jun 18 16:12:22] ERROR[219]: res_sorcery_config.c:405 sorcery_config_internal_load: Config file ‘pjsip.conf’ could not be loaded; configuration contains a duplicate object: ‘1000-auth’ of type ‘auth’
[Jun 18 16:12:22] ERROR[219]: res_sorcery_config.c:405 sorcery_config_internal_load: Config file ‘pjsip.conf’ could not be loaded; configuration contains a duplicate object: ‘1000’ of type ‘aor’
[Jun 18 16:12:22] ERROR[219]: res_sorcery_config.c:405 sorcery_config_internal_load: Config file ‘pjsip.conf’ could not be loaded; configuration contains a duplicate object: ‘1000’ of type ‘endpoint’

But I cannot understand what is wrong on my pjsip.conf. Can you point me at the issue?

CONF:

; Configurazione globale
[global]
all_codecs_on_empty_reinvite=false
allow_sending_180_after_183=false
contact_expiration_check_interval=30
debug=no
default_auth_algorithms_uac=MD5
default_auth_algorithms_uas=MD5
default_from_user=asterisk
default_outbound_endpoint=default_outbound_endpoint
default_realm=asterisk
disable_multi_domain=false
endpoint_identifier_order=ip,username,anonymous
ignore_uri_user_options=false
keep_alive_interval=90
max_forwards=70
max_initial_qualify_time=0
mwi_disable_initial_unsolicited=false
mwi_tps_queue_high=500
mwi_tps_queue_low=-1
norefersub=yes
send_contact_status_on_update_registration=no
taskprocessor_overload_trigger=global
unidentified_request_count=5
unidentified_request_period=5
unidentified_request_prune_interval=30
use_callerid_contact=no
user_agent=Asterisk 22.2.0

; Configurazione trasporto (UDP, con TLS opzionale)
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
external_media_address=192.168.1.200 ; Sostituisci con l’IP pubblico del server
external_signaling_address=192.168.1.200
local_net=172.19.0.0/16 ; Sostituisci con la tua rete locale
allow_reload=yes

; Template per endpoint SIP
endpoint-template
type=endpoint
context=from-internal ; Contesto del dialplan in extensions.conf
disallow=all
allow=alaw ; Codec supportati
dtmf_mode=rfc4733
rtp_timeout=30
rtp_timeout_hold=300
send_rpid=yes
send_pai=yes
trust_id_outbound=yes
ice_support=no
rtcp_mux=no
aggregate_mwi=yes
max_audio_streams=1
max_video_streams=0
device_state_busy_at=1

; Template per autenticazione
auth-template
type=auth
auth_type=userpass

; Template per AOR (Association of Record)
aor-template
type=aor
max_contacts=1
remove_existing=yes
qualify_frequency=60 ; Invia pacchetti keep-alive ogni 60 secondi
qualify_timeout=3.0
maximum_expiration=300 ; Lease di registrazione massimo (5 minuti)
minimum_expiration=60
default_expiration=120

1000
aors=1000
auth=1000-auth
callerid=Utente 1000 <1000>

1000-auth
username=1000
password=secure_password_1000

1000

1001
aors=1001
auth=1001-auth
callerid=Utente 1001 <1001>

1001-auth
username=1001
password=secure_password_1001

1001

1002
aors=1002
auth=1002-auth
callerid=Utente 1002 <1002>

1002-auth
username=1002
password=secure_password_1002

1002

1003
aors=1003
auth=1003-auth
callerid=Utente 1003 <1003>

If you don’t see the square brackets it’s because site’s formatting. The

[ ]

are present in conf.

Actually it’s because they re not marked up correctly:

[Jun 18 16:12:22] ERROR[219]: res_sorcery_config.c:405 sorcery_config_internal_load: Config file 'pjsip.conf' could not be loaded; configuration contains a duplicate object: '1000-auth' of type 'auth'
[Jun 18 16:12:22] ERROR[219]: res_sorcery_config.c:405 sorcery_config_internal_load: Config file 'pjsip.conf' could not be loaded; configuration contains a duplicate object: '1000' of type 'aor'
[Jun 18 16:12:22] ERROR[219]: res_sorcery_config.c:405 sorcery_config_internal_load: Config file 'pjsip.conf' could not be loaded; configuration contains a duplicate object: '1000' of type 'endpoint'
; Configurazione globale
[global]
all_codecs_on_empty_reinvite=false
allow_sending_180_after_183=false
contact_expiration_check_interval=30
debug=no
default_auth_algorithms_uac=MD5
default_auth_algorithms_uas=MD5
default_from_user=asterisk
default_outbound_endpoint=default_outbound_endpoint
default_realm=asterisk
disable_multi_domain=false
endpoint_identifier_order=ip,username,anonymous
ignore_uri_user_options=false
keep_alive_interval=90
max_forwards=70
max_initial_qualify_time=0
mwi_disable_initial_unsolicited=false
mwi_tps_queue_high=500
mwi_tps_queue_low=-1
norefersub=yes
send_contact_status_on_update_registration=no
taskprocessor_overload_trigger=global
unidentified_request_count=5
unidentified_request_period=5
unidentified_request_prune_interval=30
use_callerid_contact=no
user_agent=Asterisk 22.2.0
 
; Configurazione trasporto (UDP, con TLS opzionale)
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060
external_media_address=192.168.1.200 ; Sostituisci con l'IP pubblico del server
external_signaling_address=192.168.1.200
local_net=172.19.0.0/16 ; Sostituisci con la tua rete locale
allow_reload=yes

 
; Template per endpoint SIP
[endpoint-template](!)
type=endpoint
context=from-internal ; Contesto del dialplan in extensions.conf
disallow=all
allow=alaw ; Codec supportati
dtmf_mode=rfc4733
rtp_timeout=30
rtp_timeout_hold=300
send_rpid=yes
send_pai=yes
trust_id_outbound=yes
ice_support=no
rtcp_mux=no
aggregate_mwi=yes
max_audio_streams=1
max_video_streams=0
device_state_busy_at=1

; Template per autenticazione
[auth-template](!)
type=auth
auth_type=userpass

; Template per AOR (Association of Record)
[aor-template](!)
type=aor
max_contacts=1
remove_existing=yes
qualify_frequency=60 ; Invia pacchetti keep-alive ogni 60 secondi
qualify_timeout=3.0
maximum_expiration=300 ; Lease di registrazione massimo (5 minuti)
minimum_expiration=60
default_expiration=120


[1000](endpoint-template)
aors=1000
auth=1000-auth
callerid=Utente 1000 <1000>

[1000-auth](auth-template)
username=1000
password=secure_password_1000

[1000](aor-template)

[1001](endpoint-template)
aors=1001
auth=1001-auth
callerid=Utente 1001 <1001>

[1001-auth](auth-template)
username=1001
password=secure_password_1001

[1001](aor-template)

[1002](endpoint-template)
aors=1002
auth=1002-auth
callerid=Utente 1002 <1002>

[1002-auth](auth-template)
username=1002
password=secure_password_1002

[1002](aor-template)

[1003](endpoint-template)
aors=1003
auth=1003-auth
callerid=Utente 1003 <1003>