Sometimes extension not found even if it exists in dialplan and works just fine for most of time

I have inbound context with extensions set which works for more than half of calls. But sometimes call is rejected like there is no extension set and with this in log:

asterisk_1  | [Oct 16 19:48:49]     -- Registered SIP '101' at 94.189.205.176:58717
asterisk_1  | [Oct 16 19:48:49]   == Using SIP RTP CoS mark 5
asterisk_1  | [Oct 16 19:48:49]     -- Called SIP/101
asterisk_1  | [Oct 16 19:48:49] NOTICE[68]: chan_sip.c:28519 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 101
asterisk_1  | [Oct 16 19:48:50]     -- SIP/101-00000021 is ringing
asterisk_1  | [Oct 16 19:48:51]     -- Stopped music on hold on SIP/flowroute-00000020
asterisk_1  | [Oct 16 19:48:51]   == Spawn extension (incoming, 12026555685, 5) exited non-zero on 'SIP/flowroute-00000020'
asterisk_1  | [Oct 16 19:49:06]     -- Unregistered SIP '101'
asterisk_1  | [Oct 16 19:49:10]   == Using SIP RTP CoS mark 5
asterisk_1  | [Oct 16 19:49:10] NOTICE[68][C-00000032]: chan_sip.c:26512 handle_request_invite: Call from '' (34.226.36.33:5060) to extension '12026555685' rejected because extension not found in context 'public'.
asterisk_1  | [Oct 16 19:49:12]   == Using SIP RTP CoS mark 5
asterisk_1  | [Oct 16 19:49:12]     -- Executing [12026555685@incoming:1] NoOp("SIP/flowroute-00000022", "Incoming call 12026555685") in new stack
asterisk_1  | [Oct 16 19:49:12]     -- Executing [12026555685@incoming:2] Wait("SIP/flowroute-00000022", "5") in new stack
asterisk_1  | [Oct 16 19:49:17]     -- Executing [12026555685@incoming:3] Set("SIP/flowroute-00000022", "CHANNEL(musicclass)=default") in new stack
asterisk_1  | [Oct 16 19:49:17]     -- Executing [12026555685@incoming:4] Answer("SIP/flowroute-00000022", "") in new stack
asterisk_1  | [Oct 16 19:49:17]     -- Executing [12026555685@incoming:5] Queue("SIP/flowroute-00000022", "call-center,,,,120") in new stack
asterisk_1  | [Oct 16 19:49:17]     -- Started music on hold, class 'default', on channel 'SIP/flowroute-00000022'
asterisk_1  | [Oct 16 19:49:20]     -- Stopped music on hold on SIP/flowroute-00000022
asterisk_1  | [Oct 16 19:49:20]   == Spawn extension (incoming, 12026555685, 5) exited non-zero on 'SIP/flowroute-00000022'
asterisk_1  | [Oct 16 19:49:23]   == Using SIP RTP CoS mark 5
asterisk_1  | [Oct 16 19:49:23]     -- Executing [12026555685@incoming:1] NoOp("SIP/flowroute-00000023", "Incoming call 12026555685") in new stack
asterisk_1  | [Oct 16 19:49:23]     -- Executing [12026555685@incoming:2] Wait("SIP/flowroute-00000023", "5") in new stack
asterisk_1  | [Oct 16 19:49:28]     -- Executing [12026555685@incoming:3] Set("SIP/flowroute-00000023", "CHANNEL(musicclass)=default") in new stack
asterisk_1  | [Oct 16 19:49:28]     -- Executing [12026555685@incoming:4] Answer("SIP/flowroute-00000023", "") in new stack
asterisk_1  | [Oct 16 19:49:28]     -- Executing [12026555685@incoming:5] Queue("SIP/flowroute-00000023", "call-center,,,,120") in new stack
asterisk_1  | [Oct 16 19:49:28]     -- Started music on hold, class 'default', on channel 'SIP/flowroute-00000023'
asterisk_1  | [Oct 16 19:49:30]     -- Stopped music on hold on SIP/flowroute-00000023
asterisk_1  | [Oct 16 19:49:30]   == Spawn extension (incoming, 12026555685, 5) exited non-zero on 'SIP/flowroute-00000023'
asterisk_1  | [Oct 16 19:49:35]     -- Registered SIP '101' at 94.189.205.176:54568
asterisk_1  | [Oct 16 19:49:35]     -- Unregistered SIP '101'
asterisk_1  | [Oct 16 19:49:35]     -- Registered SIP '101' at 94.189.205.176:54568
asterisk_1  | [Oct 16 19:49:36] NOTICE[68]: chan_sip.c:28519 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 101

From log you can see that extension exists and sometimes works just fine but sometimes call is rejected and I can’t understand what is a problem. Asterisk version is 15.6.1.

Please help…

issues is sometimes calls arrive to Asterisk as guest call and it goes to the public context instead of the incoming context

Thank you @ambiorixg12 , any idea how can I solve this?

Any of this could work.

  1. Make a dial pattern for public context

  2. create a sip peer for each flow route IP

  3. If use pjsip I guess you can use line option

Thank you very much @ambiorixg12

1 Like