Rejected because extension not found in context 'local-office-extension'

I’m trying to make a simple call between two extensions from last 3 days but getting error upon error but also got good hands on practice asterisk now.

After trying everything now I’m getting this error

Using SIP RTP CoS mark 5
[Dec  4 21:20:52] NOTICE[2237][C-00000008]: chan_sip.c:26828 handle_request_invite: Call from '1001' (192.168.1.126:54859) to extension '1002' rejected because extension not found in context 'local-office-extension'.

Here are my configure file

extensions.conf
[local-office-extension]
exten => 1001,1,Dial(PJSIP/1001)
exten => 1002,n,Dial(PJSIP/1002)

pjsip.conf
[1001]
type=endpoint
transport=transport-udp
context=local-office-extension
disallow=all
allow=ulaw
allow=gsm
auth=1001
aors=1001

[1002]
type=endpoint
transport=transport-udp
context=local-office-extension
disallow=all
allow=ulaw
allow=gsm
auth=1002
aors=1002
[1001]
type=auth
auth_type=userpass
password=1001
username=1001

[1002]
type=auth
auth_type=userpass
password=1002
username=1002

[1001]
type=aor
max_contacts=1
contact=sip:1001@192.168.1.126:5060

[1002]
type=aor
max_contacts=1
contact=sip:1002@192.168.1.126:5060

sip.cong
[1001]
username=1001
secret=1001
;nat=no
host=dynamic
type=peer
qualify=yes
context=local-office-extension

[1002]
username=1002
secret=1002
host=dynamic
;nat=no
type=peer
qualify=yes
context=local-office-extension

192.168.1.126 is my asterisk server IP address , OS Ubuntu 22.04, Asterisk Current Stable one

I’m trying to call within my local network

Thank you

exten => 1002,n,Dial(PJSIP/1002)

That line should be:

exten => 1002,1,Dial(PJSIP/1002)

Also, I suspect you are making life more complex / difficult / confusing for
yourself by configuring both chan_sip and chan_pjsip.

chan_sip is deprecated and unmaintained. Stop using it (especially for a
new setup) and use chan_pjsip instead.

Antony.

Especially as the second one to load will fail because it can’t bind to port 5060. Looks like chan_sip loaded first.

I unloaded Chan_sip module and also in modules.conf I uncommitted noload = chan_sip.so after this I’m not able to register my extension from client like zoiper or microsip

This is my modules.conf configuration

;
; Asterisk configuration file
;
; Module Loader configuration file
;

[modules]
autoload=yes
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger initialization) can be loaded
; using 'preload'.  'preload' forces a module and the modules it
; is known to depend upon to be loaded earlier than they normally get
; loaded.
;
; NOTE: There is no good reason left to use 'preload' anymore.  It was
; historically required to preload realtime driver modules so you could
; map Asterisk core configuration files to Realtime storage.
; This is no longer needed.
;
preload = your_special_module.so
;
; If you want Asterisk to fail if a module does not load, then use
; the "require" keyword. Asterisk will exit with a status code of 2
; if a required module does not load.
;
require = chan_pjsip.so
;
; If you want you can combine with preload
; preload-require = your_special_module.so
;
;load = res_musiconhold.so
;
; Load one of: alsa, or console (portaudio).
; By default, load chan_console only (automatically).
;
noload = chan_alsa.so
;noload = chan_console.so
;
; Do not load res_hep and kin unless you are using HEP monitoring
; <http://sipcapture.org> in your network.
;
noload = res_hep.so
noload = res_hep_pjsip.so
noload = res_hep_rtcp.so
;
; Do not load chan_sip by default, it may conflict with res_pjsip.
noload = chan_sip.so
;
; Load one of the voicemail modules as they are mutually exclusive.
; By default, load app_voicemail only (automatically).
;
;noload = app_voicemail.so
noload = app_voicemail_imap.so
noload = app_voicemail_odbc.so

What output do you get for “core reload chan_pjsip”?

saml-OptiPlex-3050CLI> core reload chan_pjsip
Usage: core reload
Execute a global reload.
saml-OptiPlex-3050
CLI>

This showing

Sorry, module, not core.

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