NOTICE[72781]: res_pjsip_session.c:4046 new_invite: 1000: Call (UDP:X.X.X.X:5060) to extension 's' rejected because extension not found in context 'outbound'

  • while using AMI I am getting this error:

[Feb 3 10:27:41] NOTICE[71973]: res_pjsip_session.c:4046 new_invite: 1000: Call (UDP:x.x.x.x:5060) to extension ‘s’ rejected because extension not found in context ‘outbound’. <— Transmitting SIP response (404 bytes) to UDP:x.x.x.x:5060 —> SIP/2.0 404 Not Found Via: SIP/2.0/UDP x.x.x.x:5060;rport=5060;received=x.x.x.x;branch=z9hG4bKPjd56544eb-19d5-4ff5-9ad1-6698ec562472 Call-ID: bb6e3cc2-e7f3-4cd3-94c1-abedf5240672 From: “Test Call” sip:asterisk@x.x.x.x;tag=2bc55c1f-1911-4177-90b1-ef8de0e9d0e2 To: sip:x.x.x.x;tag=464d7ffe-ba55-4673-92f9-840cb54f18c3 CSeq: 3429 INVITE Server: Asterisk PBX 20.11.1 Content-Length: 0

  • These are my files for reference:

pjsip.conf
[simpletrans]
type=transport
protocol=udp
bind=0.0.0.0

[reg1000]
type=registration
outbound_auth=auth1000
server_uri=sip:x.x.x.x
client_uri=sip:1000@x.x.x.x
retry_interval=60

[auth1000]
type=auth
auth_type=userpass
password=password
username=1000

[1000]
type=aor
contact=sip:x.x.x.x:5060
max_contacts=5

[1000]
type=endpoint
context=outbound
disallow=all
allow=ulaw
outbound_auth=auth1000
aors=1000

[id1000]
type=identify
endpoint=1000
match=x.x.x.x

[reg1001]
type=registration
outbound_auth=auth1001
server_uri=sip:x.x.x.x
client_uri=sip:1001@x.x.x.x
retry_interval=60

[auth1001]
type=auth
auth_type=userpass
password=password
username=1001

[1001]
type=aor
contact=sip:x.x.x.x:5060
max_contacts=5

[1001]
type=endpoint
context=outbound
disallow=all
allow=ulaw
outbound_auth=auth1001
aors=1001

[id1001]
type=identify
endpoint=1001
match=x.x.x.x

extensions.conf
[general]
static=yes
writeprotect=no
clearglobalvars=no

[outbound]
exten => 1000,1,NoOp(Call received for extension 1000)
same => n,Answer()
same => n,Dial(PJSIP/1000,30)
same => n,Hangup()

exten => 1001,1,NoOp(Call received for extension 1001)
same => n,Answer()
same => n,Dial(PJSIP/1001,30)
same => n,Hangup()

exten => _X.,1,NoOp(Invalid Extension ${EXTEN})
same => n,Playback(sorry-cant-dial)
same => n,Hangup()

  • pjsip show contacts is showing both 1000 and 1001.

It means what it says. A call came in to extension “s” in the context “outbound”. Your dialplan has no match for that.

I want to call 1001 from 1000. Can you please provide me solution for this.

Have 1000 dial 1001 then. If it’s just dialling the registration, then you could also set “contact_user” to “1001” in the registration to it, which would probably cause it to dial 1001. It would always dial 1001 though.

Having both max-contacts and type=registration, for the same endpoint, makes no sense. Which way are you registering?

I am using Linphone for registration. So I am using max-contacts.

I am registering using Linphone. So I have I have removed type=registration. Can you please provide me solution according to that

It’s a Linphone setting problem, in that case, not an Asterisk one.

It’s possible that the LinPhone is still remembering the registration from when you had the type=registration section, or that you didn’t reload the configuration in Asterisk.

I have removed type=registration from pjsip.conf and set callerId manually from java code. Error is resolved. Thanks!