Call rejected because extension was not found in context

Merry Christmas, everyone! I have a problem when trying to make a call over websocket in asterisk.I’m using sipml5 as a client.
Asterisk prints this when i’ve set sip debugging to on when I try to make a call. :
Transmitting(no NAT) to —>
SIP/2.0 200 OK
NOTICE[10642][C-00000005]: chan_sip.c:25637 handle_request_invite: Call from ‘malcolm’( to extension ‘jake’ rejected because extension not found in context ‘outgoing’.
Via : SIP/2.0/WS df7jal23ls0d.invalid; branch = …; rport;received=
From : "malcolm"sip:malcolm@;tag=vJKB3Tx6e1F1AFfytJz4c
To : sip:jake@;tag=as621ef12b
Call-ID: 20d670ce-5d56-2bd6-f271-fa80a7ab6003
CSEQ: 38681
Content-Length: 0

PS : i’m using their online demo. I’ve set the expert mode options to what they should be. demo

Oh and one more thing - my server ip is I have no idea what this is (I guess and the port seems to be 5060 even though I connect to asterisk on 8088 through websocket connection.

You have tried to call jake.

The call is from a device which has its context specified as outgoing.

The outgoing context contains no extension that matches the string jake.

Fix whichever of these is wrong in your situation.

Note your subject is wrong: the message clearly says extension,not peer.


I have both of the extensions’s context set as outgoing in sip.conf.
My extensions.conf looks like that for outgoing :
exten => _X.,1,Dial(SIP/${EXTEN})
;exten => _X.,n,Answer()
exten => _X.,n,Hangup()

Is there something i should change in it ?
I’m sorry. I still haven’t figured out how the extensions.conf and contexts work.

“j” is not a digit between 0 and 9!

_X only matches digits between 0 and 9!

1 Like

Thanks, mate. That fixed it and i’m right back at my initial problem because of which I tried to reinstall asterisk because I thought I was the one to mess up something. Can you give me some input on why the 603 “failed to get local SDP” error happens ? Asterisk output :
EXECUTING [6000@outgoing:1] Dial(“SIP/6001-000000000”, “SIP/6000”) in new stack.
Error[23046][C-00000] netsock2.c:303 ast_sockaddr_resolve: getaddrinfo(df7jal23ls0d.invalid","(null)", …): Name of service not known
WARNING[23046][C-0000000000] chan_sip.c:16159 __set_address_from_contact: Invalid host name in Contact: (can’t resolve in DNS): ‘df7jal23ls0d.invalid’)
Called SIP/6000
SIP/6000 - 0000001 is ringing
Got SIP response 603 “Failed to get local SDP” back from
SIP/6000-00001 is busy
Everyone is busy/congested at this time
-Executing [6000@outgoing:2] Hangup(“SIP/6001-000000”,"") in new stack
WARNING[22994][C-0000000000] chan_sip.c:24306 handle_response: Remote host can’t match request ACK to call "76cfcaf6331c469e3d265117e5dbad61b@’. Giving up.
----end asterisk ouput

I also noticed with sip debug on that this happens when I’m also connecting to asterisk through the client.
Asterisk output after connecting with 6000 through wss with debug sip on :

<------ Transmitting (no NAT) to —>
SIP/2.0 200 OK
Via: SIP/2.0/WSS df7jal23s0d.invalid;branch=z9hG4bK5Zhr…;rport;received=
===end output asterisk
Why is this .invalid address there ?

The outgoing side peer responded 603 “Failed to get local SDP”.

That is a an issue with the peer, not with Asterisk.

1 Like

I edited my comment can you please read the second part and if you’re able to propose a solution to the peer problem ? The peer was just created through sip.conf and given probably the most fundamental options.

This is there because that was what was in the incoming request. The Via line on a response is mainly just a reflection of the Via line in the request.

One would need a more complete trace to completely understand the message about the mismatched ACK, but, at face value, the client has committed a protocol violation by sending ACK for a Call ID and from and to tag combination that does not exist.

1 Like

Thank you very much for your assistance.So from what I understand the issue is nowhere in my Asterisk configuration?

The incoming problems are unlikely to be related to Asterisk.

The outgoing problem could be an incompatibility between your Asterisk configuration and the configuration of the peer. That would typically be the case for 603, however the textual message suggests an internal problem in the peer. In any case, one cannot say what, if anything, is wrong on the Asterisk side, without understanding why the peer is generating the response, from its point of view.

(Without the text, 603 could be a class of service violation, e.g. you are trying to call a number that you don’t have permission to call. However, again, the text implies a fault at the remote end.))

Dear Mr.David,
I had the similar problem in my asterisk. Outgoing call works fine but incoming call not working.
Please help me to resolve this issue.
Error message:

NOTICE[11394][C-0000001c]: chan_sip.c:26458 handle_request_invite: Call from ‘’ ( to extension ‘+914134034900’ rejected because extension not found in context ‘outbound’.

Why do you allow external callers to make, presumably, chargeable outoging calls?

In any case, you haven’t provided any evidence to suggest that the caller isn’t in the “outbound” context, or that called extension was matcheable for calls in that context. As such, I would take the message at face value.