Inbound routes are not split when multiple routes are set

I have a problem with the distribution of the different incoming calls

if the DID and CID are both set to Any/Any for the inbound routes, the numbers will be forwarded directly and correctly to the specified destination, but if this is split into different Routes based on which number (DID) is being called, it will not work

does anyone know what the problem is and what the fix is to solve this

I have been able to get the logs this information wise

[2023-03-24 16:49:23] VERBOSE[10204] res_pjsip_logger.c: <--- Received SIP request (1098 bytes) from UDP:9**.***.***.***:5060 --->
8851INVITE sip:s@89.***.***.***:5060;line=ofuqmpj SIP/2.0
8852Via: SIP/2.0/UDP 9**.***.***.***:5060;branch=z9hG4bK7d613cca;rport
8853Max-Forwards: 70
8854From: "+316********" <sip:+316********@9**.***.***.***>;tag=as0c8bff70
8855To: <sip:s@89.***.***.***:5060;line=ofuqmpj>
8856Contact: <sip:+316********@9**.***.***.***:5060>
8857Call-ID: 67d63a3a61be1f981a34ba3a643e14f5@9**.***.***.***:5060
8858CSeq: 102 INVITE
8859User-Agent: MOR Softswitch
8860Date: Fri, 24 Mar 2023 15:49:23 GMT
8861Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
8862Supported: replaces, timer
8863P-Asserted-Identity: <sip:+316********@ims.imscore.net;user=phone>
8864Privacy: none
8865Diversion: <sip:3113*******@1**.***.***.***>;reason=unconditional
8866Content-Type: application/sdp
8867Content-Length: 333
8868
8869v=0
8870o=root 1481913684 1481913684 IN IP4 9**.***.***.***
8871s=Asterisk PBX GIT-15-f361e65M
8872c=IN IP4 9**.***.***.***
8873t=0 0
8874m=audio 16522 RTP/AVP 8 18 0 101
8875a=rtpmap:8 PCMA/8000
8876a=rtpmap:18 G729/8000
8877a=fmtp:18 annexb=no
8878a=rtpmap:0 PCMU/8000
8879a=rtpmap:101 telephone-event/8000
8880a=fmtp:101 0-16
8881a=ptime:20
8882a=maxptime:150
8883a=sendrecv
8884
8885[2023-03-24 16:49:23] VERBOSE[1947] res_pjsip_logger.c: <--- Transmitting SIP response (355 bytes) to UDP:9**.***.***.***:5060 --->
8886SIP/2.0 100 Trying
8887Via: SIP/2.0/UDP 9**.***.***.***:5060;rport=5060;received=9**.***.***.***;branch=z9hG4bK7d613cca
8888Call-ID: 67d63a3a61be1f981a34ba3a643e14f5@9**.***.***.***:5060
8889From: "+316********" <sip:+316********@9**.***.***.***>;tag=as0c8bff70
8890To: <sip:s@89.***.***.***;line=ofuqmpj>
8891CSeq: 102 INVITE
8892Server: FPBX-16.0.39(16.27.0)
8893Content-Length: 0
8894
8895
8896[2023-03-24 16:49:23] VERBOSE[19834][C-00000013] pbx.c: Executing [s@from-pstn-toheader:1] NoOp("PJSIP/3113*******-00000012", "Attempting to extract DID from SIP To header") in new stack
8897[2023-03-24 16:49:23] VERBOSE[19834][C-00000013] pbx.c: Executing [s@from-pstn-toheader:2] GotoIf("PJSIP/3113*******-00000012", "0?SIP") in new stack
8898[2023-03-24 16:49:23] VERBOSE[19834][C-00000013] pbx.c: Executing [s@from-pstn-toheader:3] GotoIf("PJSIP/3113*******-00000012", "1?PJSIP") in new stack
8899[2023-03-24 16:49:23] VERBOSE[19834][C-00000013] pbx_builtins.c: Goto (from-pstn-toheader,s,7)
8900[2023-03-24 16:49:23] VERBOSE[19834][C-00000013] pbx.c: Executing [s@from-pstn-toheader:7] Goto("PJSIP/3113*******-00000012", "from-pstn,s,1") in new stack
8901[2023-03-24 16:49:23] VERBOSE[19834][C-00000013] pbx_builtins.c: Goto (from-pstn,s,1)
8902[2023-03-24 16:49:23] VERBOSE[19834][C-00000013] pbx.c: Executing [s@from-pstn:1] NoOp("PJSIP/3113*******-00000012", "No DID or CID Match") in new stack
8903[2023-03-24 16:49:23] VERBOSE[19834][C-00000013] pbx.c: Executing [s@from-pstn:2] Answer("PJSIP/3113*******-00000012", "") in new stack
8904[2023-03-24 16:49:23] VERBOSE[18265] res_pjsip_logger.c: <--- Transmitting SIP response (877 bytes) to UDP:9**.***.***.***:5060 --->
8905SIP/2.0 200 OK
8906Via: SIP/2.0/UDP 9**.***.***.***:5060;rport=5060;received=9**.***.***.***;branch=z9hG4bK7d613cca
8907Call-ID: 67d63a3a61be1f981a34ba3a643e14f5@9**.***.***.***:5060
8908From: "+316********" <sip:+316********@9**.***.***.***>;tag=as0c8bff70
8909To: <sip:s@89.***.***.***;line=ofuqmpj>;tag=2c22208e-8f64-438c-bcb9-bcbdca926dfd
8910CSeq: 102 INVITE
8911Server: FPBX-16.0.39(16.27.0)
8912Contact: <sip:89.***.***.***:5060>
8913Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, REFER, MESSAGE
8914Supported: 100rel, timer, replaces, norefersub
8915Content-Type: application/sdp
8916Content-Length: 259
8917
8918v=0
8919o=- 1481913684 1481913686 IN IP4 89.***.***.***
8920s=Asterisk
8921c=IN IP4 89.***.***.***
8922t=0 0
8923m=audio 11598 RTP/AVP 0 8 101
8924a=rtpmap:0 PCMU/8000
8925a=rtpmap:8 PCMA/8000
8926a=rtpmap:101 telephone-event/8000
8927a=fmtp:101 0-16
8928a=ptime:20
8929a=maxptime:150
8930a=sendrecv
8931
8932[2023-03-24 16:49:23] VERBOSE[10204] res_pjsip_logger.c: <--- Received SIP request (446 bytes) from UDP:9**.***.***.***:5060 --->
8933ACK sip:89.***.***.***:5060 SIP/2.0
8934Via: SIP/2.0/UDP 9**.***.***.***:5060;branch=z9hG4bK20f071bc;rport
8935Max-Forwards: 70
8936From: "+316********" <sip:+316********@9**.***.***.***>;tag=as0c8bff70
8937To: <sip:s@89.***.***.***:5060;line=ofuqmpj>;tag=2c22208e-8f64-438c-bcb9-bcbdca926dfd
8938Contact: <sip:+316********@9**.***.***.***:5060>
8939Call-ID: 67d63a3a61be1f981a34ba3a643e14f5@9**.***.***.***:5060
8940CSeq: 102 ACK
8941User-Agent: MOR Softswitch
8942Content-Length: 0
8943
8944
8945[2023-03-24 16:49:23] ERROR[19834][C-00000013] pbx_functions.c: Function SIP_HEADER not registered
8946[2023-03-24 16:49:23] VERBOSE[19834][C-00000013] pbx.c: Executing [s@from-pstn:3] Log("PJSIP/3113*******-00000012", "WARNING,Friendly Scanner from ") in new stack
8947[2023-03-24 16:49:23] WARNING[19834][C-00000013] Ext. s: Friendly Scanner from
8948[2023-03-24 16:49:23] VERBOSE[19834][C-00000013] pbx.c: Executing [s@from-pstn:4] Wait("PJSIP/3113*******-00000012", "2") in new stack
8949[2023-03-24 16:49:25] VERBOSE[19834][C-00000013] pbx.c: Executing [s@from-pstn:5] Playback("PJSIP/3113*******-00000012", "ss-noservice") in new stack
8950[2023-03-24 16:49:25] VERBOSE[19834][C-00000013] file.c: <PJSIP/3113*******-00000012> Playing 'ss-noservice.alaw' (language 'en')
8951[2023-03-24 16:49:30] VERBOSE[19834][C-00000013] pbx.c: Executing [s@from-pstn:6] SayAlpha("PJSIP/3113*******-00000012", "") in new stack
8952[2023-03-24 16:49:30] VERBOSE[19834][C-00000013] pbx.c: Executing [s@from-pstn:7] Hangup("PJSIP/3113*******-00000012", "") in new stack
8953[2023-03-24 16:49:30] VERBOSE[19834][C-00000013] pbx.c: Spawn extension (from-pstn, s, 7) exited non-zero on 'PJSIP/3113*******-00000012'
8954[2023-03-24 16:49:30] VERBOSE[19834][C-00000013] pbx.c: Executing [h@from-pstn:1] Macro("PJSIP/3113*******-00000012", "hangupcall,") in new stack
8955[2023-03-24 16:49:30] VERBOSE[19834][C-00000013] pbx.c: Executing [s@macro-hangupcall:1] GotoIf("PJSIP/3113*******-00000012", "1?theend") in new stack
8956[2023-03-24 16:49:30] VERBOSE[19834][C-00000013] pbx_builtins.c: Goto (macro-hangupcall,s,3)
8957[2023-03-24 16:49:30] VERBOSE[19834][C-00000013] pbx.c: Executing [s@macro-hangupcall:3] ExecIf("PJSIP/3113*******-00000012", "0?Set(CDR(recordingfile)=)") in new stack
8958[2023-03-24 16:49:30] VERBOSE[19834][C-00000013] pbx.c: Executing [s@macro-hangupcall:4] Hangup("PJSIP/3113*******-00000012", "") in new stack
8959[2023-03-24 16:49:30] VERBOSE[19834][C-00000013] app_macro.c: Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'PJSIP/3113*******-00000012' in macro 'hangupcall'
8960[2023-03-24 16:49:30] VERBOSE[19834][C-00000013] pbx.c: Spawn extension (from-pstn, h, 1) exited non-zero on 'PJSIP/3113*******-00000012'
8961[2023-03-24 16:49:30] VERBOSE[16910] res_pjsip_logger.c: <--- Transmitting SIP request (470 bytes) to UDP:9**.***.***.***:5060 --->
8962BYE sip:+316********@9**.***.***.***:5060 SIP/2.0
8963Via: SIP/2.0/UDP 89.***.***.***:5060;rport;branch=z9hG4bKPje5433a88-793f-429e-87b5-8be36ea0b288
8964From: <sip:s@89.***.***.***;line=ofuqmpj>;tag=2c22208e-8f64-438c-bcb9-bcbdca926dfd
8965To: "+316********" <sip:+316********@9**.***.***.***>;tag=as0c8bff70
8966Call-ID: 67d63a3a61be1f981a34ba3a643e14f5@9**.***.***.***:5060
8967CSeq: 12375 BYE
8968Reason: Q.850;cause=16
8969Max-Forwards: 70
8970User-Agent: FPBX-16.0.39(16.27.0)
8971Content-Length: 0
8972
8973
8974[2023-03-24 16:49:30] VERBOSE[10204] res_pjsip_logger.c: <--- Received SIP response (529 bytes) from UDP:9**.***.***.***:5060 --->
8975SIP/2.0 200 OK
8976Via: SIP/2.0/UDP 89.***.***.***:5060;branch=z9hG4bKPje5433a88-793f-429e-87b5-8be36ea0b288;received=89.***.***.***;rport=5060
8977From: <sip:s@89.***.***.***;line=ofuqmpj>;tag=2c22208e-8f64-438c-bcb9-bcbdca926dfd
8978To: "+316********" <sip:+316********@9**.***.***.***>;tag=as0c8bff70
8979Call-ID: 67d63a3a61be1f981a34ba3a643e14f5@9**.***.***.***:5060
8980CSeq: 12375 BYE
8981Server: MOR Softswitch
8982Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
8983Supported: replaces, timer
8984Content-Length: 0
8985
8986
8987[2023-03-24 16:49:36] VERBOSE[10204] res_pjsip_logger.c: <--- Received SIP request (573 bytes) from UDP:9**.***.***.***:5060 --->
8988OPTIONS sip:s@89.***.***.***:5060;line=upeqsna SIP/2.0
8989Via: SIP/2.0/UDP 9**.***.***.***:5060;branch=z9hG4bK43d14308;rport
8990Max-Forwards: 70
8991From: "asterisk" <sip:asterisk@9**.***.***.***>;tag=as6c680a28
8992To: <sip:s@89.***.***.***:5060;line=upeqsna>
8993Contact: <sip:asterisk@9**.***.***.***:5060>
8994Call-ID: 6147d82174840cc15286317b3c6dc591@9**.***.***.***:5060
8995CSeq: 102 OPTIONS
8996User-Agent: MOR Softswitch
8997Date: Fri, 24 Mar 2023 15:49:36 GMT
8998Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
8999Supported: replaces, timer
9000Content-Length: 0
9001
9002
9003[2023-03-24 16:49:36] VERBOSE[16910] res_pjsip_logger.c: <--- Transmitting SIP response (849 bytes) to UDP:9**.***.***.***:5060 --->
9004SIP/2.0 200 OK
9005Via: SIP/2.0/UDP 9**.***.***.***:5060;rport=5060;received=9**.***.***.***;branch=z9hG4bK43d14308
9006Call-ID: 6147d82174840cc15286317b3c6dc591@9**.***.***.***:5060
9007From: "asterisk" <sip:asterisk@9**.***.***.***>;tag=as6c680a28
9008To: <sip:s@89.***.***.***;line=upeqsna>;tag=z9hG4bK43d14308
9009CSeq: 102 OPTIONS
9010Accept: application/sdp, application/dialog-info+xml, application/simple-message-summary, application/xpidf+xml, application/cpim-pidf+xml, application/pidf+xml, application/simple-message-summary, application/pidf+xml, application/dialog-info+xml, message/sipfrag;version=2.0
9011Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, REFER, MESSAGE
9012Supported: 100rel, timer, replaces, norefersub
9013Accept-Encoding: identity
9014Accept-Language: en
9015Server: FPBX-16.0.39(16.27.0)
9016Content-Length: 0
9017
9018
9019[2023-03-24 16:49:37] VERBOSE[10204] res_pjsip_logger.c: <--- Received SIP request (573 bytes) from UDP:9**.***.***.***:5060 --->
9020OPTIONS sip:s@89.***.***.***:5060;line=qsjtess SIP/2.0
9021Via: SIP/2.0/UDP 9**.***.***.***:5060;branch=z9hG4bK2cb075b8;rport
9022Max-Forwards: 70
9023From: "asterisk" <sip:asterisk@9**.***.***.***>;tag=as0c15cebd
9024To: <sip:s@89.***.***.***:5060;line=qsjtess>
9025Contact: <sip:asterisk@9**.***.***.***:5060>
9026Call-ID: 195f28b846ad3cd5242343c4709efedd@9**.***.***.***:5060
9027CSeq: 102 OPTIONS
9028User-Agent: MOR Softswitch
9029Date: Fri, 24 Mar 2023 15:49:37 GMT
9030Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
9031Supported: replaces, timer
9032Content-Length: 0
9033
9034
9035[2023-03-24 16:49:37] VERBOSE[18265] res_pjsip_logger.c: <--- Transmitting SIP response (849 bytes) to UDP:9**.***.***.***:5060 --->
9036SIP/2.0 200 OK
9037Via: SIP/2.0/UDP 9**.***.***.***:5060;rport=5060;received=9**.***.***.***;branch=z9hG4bK2cb075b8
9038Call-ID: 195f28b846ad3cd5242343c4709efedd@9**.***.***.***:5060
9039From: "asterisk" <sip:asterisk@9**.***.***.***>;tag=as0c15cebd
9040To: <sip:s@89.***.***.***;line=qsjtess>;tag=z9hG4bK2cb075b8
9041CSeq: 102 OPTIONS
9042Accept: application/sdp, application/dialog-info+xml, application/simple-message-summary, application/xpidf+xml, application/cpim-pidf+xml, application/pidf+xml, application/simple-message-summary, application/pidf+xml, application/dialog-info+xml, message/sipfrag;version=2.0
9043Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, REFER, MESSAGE
9044Supported: 100rel, timer, replaces, norefersub
9045Accept-Encoding: identity
9046Accept-Language: en
9047Server: FPBX-16.0.39(16.27.0)
9048Content-Length: 0
9049
9050
9051[2023-03-24 16:49:40] VERBOSE[16910] res_pjsip_logger.c: <--- Transmitting SIP request (451 bytes) to UDP:9**.***.***.***:5060 --->
9052OPTIONS sip:3185*******@sip*****.**********.**:5060 SIP/2.0
9053Via: SIP/2.0/UDP 89.***.***.***:5060;rport;branch=z9hG4bKPj9f080e2f-606a-47e1-8774-5697ff6b34cd
9054From: <sip:3185*******@89.***.***.***>;tag=7c4934e6-cf17-4788-b11a-72bf9c012d37
9055To: <sip:3185*******@sip*****.**********.**>
9056Contact: <sip:3185*******@89.***.***.***:5060>
9057Call-ID: c440cce8-e5ee-4863-8104-343e25650076
9058CSeq: 61199 OPTIONS
9059Max-Forwards: 70
9060User-Agent: FPBX-16.0.39(16.27.0)
9061Content-Length: 0
9062
9063
9064[2023-03-24 16:49:40] VERBOSE[10204] res_pjsip_logger.c: <--- Received SIP response (560 bytes) from UDP:9**.***.***.***:5060 --->
9065SIP/2.0 200 OK
9066Via: SIP/2.0/UDP 89.***.***.***:5060;branch=z9hG4bKPj9f080e2f-606a-47e1-8774-5697ff6b34cd;received=89.***.***.***;rport=5060
9067From: <sip:3185*******@89.***.***.***>;tag=7c4934e6-cf17-4788-b11a-72bf9c012d37
9068To: <sip:3185*******@sip*****.**********.**>;tag=as51b5a301
9069Call-ID: c440cce8-e5ee-4863-8104-343e25650076
9070CSeq: 61199 OPTIONS
9071Server: MOR Softswitch
9072Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
9073Supported: replaces, timer
9074Contact: <sip:9**.***.***.***:5060>
9075Accept: application/sdp
9076Content-Length: 0
9077
9078
17610[2023-03-24 16:54:15] ERROR[21010][C-00000014] pbx_functions.c: Function SIP_HEADER not registered
17611[2023-03-24 16:54:15] VERBOSE[21010][C-00000014] pbx.c: Executing [s@from-pstn:3] Log("PJSIP/3185*******-00000013", "WARNING,Friendly Scanner from ") in new stack
17612[2023-03-24 16:54:15] WARNING[21010][C-00000014] Ext. s: Friendly Scanner from
17613[2023-03-24 16:54:15] VERBOSE[21010][C-00000014] pbx.c: Executing [s@from-pstn:4] Wait("PJSIP/3185*******-00000013", "2") in new stack
17614[2023-03-24 16:54:17] VERBOSE[21010][C-00000014] pbx.c: Executing [s@from-pstn:5] Playback("PJSIP/3185*******-00000013", "ss-noservice") in new stack
17615[2023-03-24 16:54:17] VERBOSE[21010][C-00000014] file.c: <PJSIP/3185*******-00000013> Playing 'ss-noservice.alaw' (language 'en')
17616[2023-03-24 16:54:22] VERBOSE[21010][C-00000014] pbx.c: Executing [s@from-pstn:6] SayAlpha("PJSIP/3185*******-00000013", "") in new stack
17617[2023-03-24 16:54:22] VERBOSE[21010][C-00000014] pbx.c: Executing [s@from-pstn:7] Hangup("PJSIP/3185*******-00000013", "") in new stack
17618[2023-03-24 16:54:22] VERBOSE[21010][C-00000014] pbx.c: Spawn extension (from-pstn, s, 7) exited non-zero on 'PJSIP/3185*******-00000013'
17619[2023-03-24 16:54:22] VERBOSE[21010][C-00000014] pbx.c: Executing [h@from-pstn:1] Macro("PJSIP/3185*******-00000013", "hangupcall,") in new stack
17620[2023-03-24 16:54:22] VERBOSE[21010][C-00000014] pbx.c: Executing [s@macro-hangupcall:1] GotoIf("PJSIP/3185*******-00000013", "1?theend") in new stack
17621[2023-03-24 16:54:22] VERBOSE[21010][C-00000014] pbx_builtins.c: Goto (macro-hangupcall,s,3)
17622[2023-03-24 16:54:22] VERBOSE[21010][C-00000014] pbx.c: Executing [s@macro-hangupcall:3] ExecIf("PJSIP/3185*******-00000013", "0?Set(CDR(recordingfile)=)") in new stack
17623[2023-03-24 16:54:22] VERBOSE[21010][C-00000014] pbx.c: Executing [s@macro-hangupcall:4] Hangup("PJSIP/3185*******-00000013", "") in new stack
17624[2023-03-24 16:54:22] VERBOSE[21010][C-00000014] app_macro.c: Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'PJSIP/3185*******-00000013' in macro 'hangupcall'
17625[2023-03-24 16:54:22] VERBOSE[21010][C-00000014] pbx.c: Spawn extension (from-pstn, h, 1) exited non-zero on 'PJSIP/3185*******-00000013'
17626[2023-03-24 16:54:22] VERBOSE[16910] res_pjsip_logger.c: <--- Transmitting SIP request (470 bytes) to UDP:9**.***.***.***:5060 --->
17627BYE sip:+316********@9**.***.***.***:5060 SIP/2.0
17628Via: SIP/2.0/UDP 89.**.**.**:5060;rport;branch=z9hG4bKPj060784fa-eb15-4744-b875-1923d4081fcb
17629From: <sip:s@89.**.**.**;line=qsjtess>;tag=0b4aff06-85a1-49df-bbff-b0de24ed758e
17630To: "+316********" <sip:+316********@9**.***.***.***>;tag=as4ea6cf60
17631Call-ID: 60ff5ae1404789ad174e03695fba300d@9**.***.***.***:5060
17632CSeq: 28856 BYE
17633Reason: Q.850;cause=16
17634Max-Forwards: 70
17635User-Agent: FPBX-16.0.39(16.27.0)
17636Content-Length: 

Your INVITEs show the “DID” as being “s” for both the two common ways of signalling such values, namely request URI and To header user field.

If this isn’t really direct in dialling, you should set the Contact User in the registration to be the DID value that you include in the route.

If this really is direct in dialling, it looks like the called number is actually in the Diversion header, There is no standard support for this, but you can take the from-pstn-toheader context as a pattern for a new, custom, context that looks at the diversion header, rather than the to header.

If the “DID” is not the user part of the diversion header, you will need to tell us where it appears in the INVITE.

The problem was with the provider wanting the trunks to be on sip instead of trunk

Still, thanks for the help

So the error above is generated if the provider has the trunk number on Sip

In addition, it will not be processed properly by the Inbound routes

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