Solved Problem: Caller ID passing through 3CX from original caller to external number (Twilio)

Status
Not open for further replies.

JimNX

Customer
Joined
Mar 21, 2021
Messages
27
Reaction score
4
I've searched and search for a solution to this but cannot find a solution. There is a thread stickied at the top of this forum (Caller ID not passed through to external mobile) but it doesn't have a clear answer that works for me. In short, I am trying to pass the Caller ID information from the original caller, through 3CX, to an external number. No matter which combinations of setting I try, I cannot get it to work.

I'm using 3CX 18.0 Update 2 (Build 314) and Twilio as my provider. According to 3CX, Twilio is compatible with CLNS/Clip No Screening Support.

Things I have tried:
  • Forward to external number
    • Result in no outbound rule, if I create an outbound rule, Twilio rejects the call because I don't own the caller's number
    • "The caller-ID +15********* is unverified. SIP Trunking terminating calls to PSTN must use a valid Caller ID in the From Field. A Valid Caller ID is either a DID you have purchased from Twilio or a verified Caller ID."
    • Also results in "Redirect URI is not allowed. Redirect target: <sip:+15*********@************.sip.twilio.com:5060>"
  • Forward to mobile
    • Result in the office's number showing on Caller ID instead of the original caller's ID
  • Ring mobile simultaneously
    • Doesn't pass through if the dummy extension isn't registered to anything (typically set to DND or unregistered)
I've tried various combinations of Outbound Parameters in the SIP trunk settings as well. I have a support ticket submitted with Twilio and I'm waiting to hear back from them too. My customer is threatening to port his number to another carrier if I can't get forwarding to work properly. Please let me know if you know of anything I can try.
 
  • Like
Reactions: jmelo22
Hello @JimNX

Unfortunately I do not have an answer for you at this time. We had other users that use Twilio report this lately but every time we try to replicate it on our accounts it always works. The solution so far was to change the outbound parameters to avoid calls from failing but not send the Originator caller id but this is not what you want. We are looking into this and if the issue persists we will need to remove support for CNS for Twilio.
 
Hi @YiannisH_3CX

Which settings are you using that work? I'll post exact configuration and logs here in a moment.
 
I called my customer's 3CX number (+131******69) from my office (+184******29). 3CX is configured to forward the call to an external number (+158******04). (either forward to mobile, external number, or call deflection)

-- 3CX configured to deflect call (302) to an external number --

From Twilio:
Code:
[ICODE]Properties

DEBUG EVENT SID NO39e39d9a15af2961e51489e5eabc5cff

SERVICE SID

RESOURCE SID CA639d4ed6b3f40b5a60d60af4dfa21670

TIMESTAMP 2022-01-25 20:46:27 UTC

MESSAGE

Redirect URI is not allowed. Redirect target: sip:+158******04@det**********ape.sip.twilio.com:5060

SIP: Redirect failed: Redirect URI is not allowed. Redirect target: sip:+158******04@det**********ape.sip.twilio.com:5060[/ICODE]



From 3CX:

[ICODE]01/25/2022 3:46:32 PM - CSTA: on info success: CSTA Recv 200/INFO from 68.**.**.129:5060 tid=5682a835b9676607 Call-ID=V0kzWZhCNAwym3cK3XQUOQ..:

SIP/2.0 200 OK

Via: SIP/2.0/UDP 104.***.**.212:5060;branch=z9hG4bK-524287-1---5682a835b9676607;rport=5060

Contact: sip:2002@68.**.**.129:5060

To: sip:2002@68.**.**.129:5060;tag=2839261220

From: sip:2002@det*****now.my3cx.us;tag=25e39032

Call-ID: V0kzWZhCNAwym3cK3XQUOQ..

CSeq: 33837 INFO

Content-Type: application/csta+xml

User-Agent: Yealink SIP-T46S 66.84.0.125 805ec0cc144d

Content-Length: 235

01/25/2022 3:46:32 PM - CSTA: onReadyToSend: CSTA Send Req INFO from 0.0.0.0:0 tid=2cedaa0cc0887735 Call-ID=V0kzWZhCNAwym3cK3XQUOQ..:

INFO sip:2002@68.**.**.129:5060 SIP/2.0

Via: SIP/2.0/ ;branch=z9hG4bK-524287-1---2cedaa0cc0887735;rport

Max-Forwards: 70

Contact: sip:2002@104.***.**.212:5060

To: sip:2002@68.**.**.129:5060;tag=2839261220

From: sip:2002@det*****now.my3cx.us;tag=25e39032

Call-ID: V0kzWZhCNAwym3cK3XQUOQ..

CSeq: 33837 INFO

Content-Type: application/csta+xml

Content-Length: 216

01/25/2022 3:46:29 PM - Currently active calls [none]

01/25/2022 3:46:27 PM - Call(C:737): Incoming call has been deflected to sip:+158******04@det**********ape.sip.twilio.com:5060

01/25/2022 3:46:27 PM - [CM503008]: Call(C:737): Call is terminated

01/25/2022 3:46:27 PM - Blocking refers for the Call(C:737)

01/25/2022 3:46:27 PM - Call(C:737) is terminated

01/25/2022 3:46:27 PM - Leg L:737.1[Line:10002<<+184******29] is terminated: Cause: BYE from PBX

01/25/2022 3:46:27 PM - Terminated from "TOLL FREE CALL" sip:+184******29@det**********ape.pstn.twilio.com;tag=30617298_c3356d0b_a0746c6e-4718-4c7d-81e5-c20d77f8a6b0 to sip:+131******69@det*****now.my3cx.us;tag=80db3b78; reason: Referred

01/25/2022 3:46:27 PM - L:737.1[Line:10002<<+184******29] Sending: OnSendResp Send 302/INVITE from 0.0.0.0:0 tid=7174.10c4abb5e8ccf90913dc84cc9d47d322.0 [email protected]:

SIP/2.0 302 Moved Temporarily

Via: SIP/2.0/UDP 54.***.**.3:5060;branch=z9hG4bK7174.10c4abb5e8ccf90913dc84cc9d47d322.0

Via: SIP/2.0/UDP 172.**.**.239:5060;rport=5060;branch=z9hG4bKa0746c6e-4718-4c7d-81e5-c20d77f8a6b0_c3356d0b_46-14187181139406092035

Contact: sip:+158******04@det**********ape.sip.twilio.com:5060

To: sip:+131******69@det*****now.my3cx.us;tag=80db3b78

From: "TOLL FREE CALL" sip:+184******29@det**********ape.pstn.twilio.com;tag=30617298_c3356d0b_a0746c6e-4718-4c7d-81e5-c20d77f8a6b0

Call-ID: [email protected]

CSeq: 1 INVITE

Diversion: sip:+131******69@det*****now.my3cx.us

Content-Length: 0[/ICODE]
 
Last edited by a moderator:
-- 3CX inbound rules configured to immediately forward the call to an external number --

From Twilio:
Warning - 32021 Carrier TIMESTAMP 2022-01-25 17:02:40 UTC MESSAGE Identity signature failed to be verified SHAKEN/STIR call verification failed: Identity signature failed to be verified

From 3CX:
Code:
[ICODE]01/25/2022 3:02:38 PM - [CM500002]: Call(C:721): Info on incoming INVITE from Line:10002<<+184******29:

Invite-IN Recv Req INVITE from 54.***.**.3:5060 tid=0ba5.7e79d13599c37a973c513ab4a4885b49.0 [email protected]:

INVITE sip:+131******69@det*****now.my3cx.us SIP/2.0

Via: SIP/2.0/UDP 54.***.**.3:5060;branch=z9hG4bK0ba5.7e79d13599c37a973c513ab4a4885b49.0

Via: SIP/2.0/UDP 172.**.**.127:5060;rport=5060;branch=z9hG4bKd40aad01-165c-4d49-af84-62d5c8a0d632_c3356d0b_87-189378194611092096

Max-Forwards: 63

Record-Route: sip:54.***.**.3;lr

Contact: "TOLL FREE CALL" sip:+184******29@172.**.**.127:5060;transport=udp

To: sip:+131******69@det*****now.my3cx.us

From: "TOLL FREE CALL" sip:+184******29@det**********ape.pstn.twilio.com;tag=78190731_c3356d0b_d40aad01-165c-4d49-af84-62d5c8a0d632

Call-ID: [email protected]

CSeq: 1 INVITE

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY

Content-Type: application/sdp

User-Agent: Twilio Gateway

P-Asserted-Identity: "TOLL FREE CALL" sip:+184******29@nom***ech.sip.twilio.com:5060

Diversion: sip:+131******[email protected];reason=unconditional

X-Twilio-VerStat: TN-Validation-Passed-A

X-Twilio-AccountSid: AC*******************************fb3a

X-Twilio-CallSid: CA3efe863ec5f7a69bb97c0818a4257455

Content-Length: 275[/ICODE]
 
Last edited by a moderator:
-- 3CX configured to forward the call to a mobile number assigned to an extension from which is unregistered ---

From Twilio:
(could not find entry in error log)

From 3CX:
Code:
[ICODE]01/25/2022 3:29:16 PM - Set log verbosity to MaxLevel = 2, Severity mask = 7

01/25/2022 3:29:15 PM - Dev(377183904):[sip:2002@68.**.**.129:5067 / 2002]: PBX contact is public IP: sip:2002@104.***.**.212:5060/UDP

01/25/2022 3:29:15 PM - Updating device Dev(377183904):[sip:2002@68.**.**.129:5067 / 2002] by message: DevUpd Recv Req REGISTER from 68.**.**.129:5067 tid=4254417950 [email protected]:

REGISTER sip:det*****now.my3cx.us:5060 SIP/2.0

Via: SIP/2.0/UDP 68.**.**.129:5067;branch=z9hG4bK4254417950

Max-Forwards: 70

Contact: sip:2002@68.**.**.129:5067

To: "Pr**********ape" sip:2002@det*****now.my3cx.us:5060

From: "Pr**********ape"sip:2002@det*****now.my3cx.us:5060;tag=1067881236

Call-ID: [email protected]

CSeq: 56370 REGISTER

Expires: 120

Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE

Proxy-Authorization: Digest username="b2dma73NF4",realm="3CXPhoneSystem",nonce="414d535961f05d9b87:40a866763f732373a207e65cbe71b50e",uri="sip:det*****now.my3cx.us:5060",response="51ac9db1345c32f9b232d623bc4e4ea7",algorithm=MD5

User-Agent: Yealink W60B 77.83.0.85 805ec0d8f6e4

Allow-Events: talk, hold, conference, refer, check-sync

Content-Length: 0

01/25/2022 3:29:12 PM - CSTA: on info success: CSTA Recv 200/INFO from 68.**.**.129:5060 tid=a1d63219b27d0721 Call-ID=V0kzWZhCNAwym3cK3XQUOQ..:

SIP/2.0 200 OK

Via: SIP/2.0/UDP 104.***.**.212:5060;branch=z9hG4bK-524287-1---a1d63219b27d0721;rport=5060

Contact: sip:2002@68.**.**.129:5060

To: sip:2002@68.**.**.129:5060;tag=2839261220

From: sip:2002@det*****now.my3cx.us;tag=25e39032

Call-ID: V0kzWZhCNAwym3cK3XQUOQ..

CSeq: 33817 INFO

Content-Type: application/csta+xml

User-Agent: Yealink SIP-T46S 66.84.0.125 805ec0cc144d

Content-Length: 235

01/25/2022 3:29:12 PM - CSTA: on info success: CSTA Recv 200/INFO from 68.**.**.129:5066 tid=35edc94b365f191d Call-ID=9GLbPRLZ3yZLFVbXN4K_GQ..:

SIP/2.0 200 OK

Via: SIP/2.0/UDP 104.***.**.212:5060;branch=z9hG4bK-524287-1---35edc94b365f191d;rport=5060

Contact: sip:2000@68.**.**.129:5066

To: sip:2000@68.**.**.129:5066;tag=2277290676

From: sip:2000@det*****now.my3cx.us;tag=15f93773

Call-ID: 9GLbPRLZ3yZLFVbXN4K_GQ..

CSeq: 33817 INFO

Content-Type: application/csta+xml

User-Agent: Yealink SIP-T46S 66.84.0.125 805ec0cb8a32

Content-Length: 235

01/25/2022 3:29:12 PM - CSTA: onReadyToSend: CSTA Send Req INFO from 0.0.0.0:0 tid=0260ce27a2d87505 Call-ID=9GLbPRLZ3yZLFVbXN4K_GQ..:

INFO sip:2000@68.**.**.129:5066 SIP/2.0

Via: SIP/2.0/ ;branch=z9hG4bK-524287-1---0260ce27a2d87505;rport

Max-Forwards: 70

Contact: sip:2000@104.***.**.212:5060

To: sip:2000@68.**.**.129:5066;tag=2277290676

From: sip:2000@det*****now.my3cx.us;tag=15f93773

Call-ID: 9GLbPRLZ3yZLFVbXN4K_GQ..

CSeq: 33817 INFO

Content-Type: application/csta+xml

Content-Length: 216

01/25/2022 3:29:12 PM - CSTA: onReadyToSend: CSTA Send Req INFO from 0.0.0.0:0 tid=71146632809de023 Call-ID=V0kzWZhCNAwym3cK3XQUOQ..:

INFO sip:2002@68.**.**.129:5060 SIP/2.0

Via: SIP/2.0/ ;branch=z9hG4bK-524287-1---71146632809de023;rport

Max-Forwards: 70

Contact: sip:2002@104.***.**.212:5060

To: sip:2002@68.**.**.129:5060;tag=2839261220

From: sip:2002@det*****now.my3cx.us;tag=25e39032

Call-ID: V0kzWZhCNAwym3cK3XQUOQ..

CSeq: 33817 INFO

Content-Type: application/csta+xml

Content-Length: 216

01/25/2022 3:29:12 PM - Default best-route IP is determined as 104.131.53.212

01/25/2022 3:29:08 PM - ~Target=Unknown:+158******04@(Ln.10002@Det******************ply)

01/25/2022 3:29:08 PM - Leg L:729.1[Line:10002<<+184******29] is terminated: Cause: BYE from PBX

01/25/2022 3:29:08 PM - Terminated from "TOLL FREE CALL" sip:+184******29@det**********ape.pstn.twilio.com;tag=93281822_c3356d0b_f8330996-1a5e-42d4-888c-0ec2d0a2929d to sip:+131******69@det*****now.my3cx.us;tag=0002436c; reason: Rejected

01/25/2022 3:29:08 PM - L:729.1[Line:10002<<+184******29] Sending: OnSendResp Send 403/INVITE from 0.0.0.0:0 tid=242b.b073beed63db7feda974ba954bb9d9a7.0 [email protected]:

SIP/2.0 403 Forbidden

Via: SIP/2.0/UDP 54.***.**.0:5060;branch=z9hG4bK242b.b073beed63db7feda974ba954bb9d9a7.0

Via: SIP/2.0/UDP 172.**.**.89:5060;rport=5060;branch=z9hG4bKf8330996-1a5e-42d4-888c-0ec2d0a2929d_c3356d0b_53-10503659749058265828

To: sip:+131******69@det*****now.my3cx.us;tag=0002436c

From: "TOLL FREE CALL" sip:+184******29@det**********ape.pstn.twilio.com;tag=93281822_c3356d0b_f8330996-1a5e-42d4-888c-0ec2d0a2929d

Call-ID: [email protected]

CSeq: 1 INVITE

Warning: 499 JXMWZ-LD3R4-NMBCO-BZVYH-3ASPX.localdomain "Forbidden"

Content-Length: 0

01/25/2022 3:29:08 PM - SendMsg from sip:+131******69@det*****now.my3cx.us;tag=0002436c to "TOLL FREE CALL" sip:+184******29@det**********ape.pstn.twilio.com;tag=93281822_c3356d0b_f8330996-1a5e-42d4-888c-0ec2d0a2929d

01/25/2022 3:29:08 PM - Call(C:729) is terminated

01/25/2022 3:29:08 PM - [CM503020]: Call(C:729): Normal call termination. Call originator: Line:10002<<+184******29. Reason: Forbidden

01/25/2022 3:29:08 PM - [CM503016]: Call(C:729): Attempt to reach sip:7669@104.***.**.212:5060 from Line:10002<<+184******29 has failed. Reason: Forbidden

01/25/2022 3:29:08 PM - [Flow] Current call diversion path:[]

01/25/2022 3:29:08 PM - L:729.1[Line:10002<<+184******29] failed to reach Line:10002>>+158******04, reason Forbidden

01/25/2022 3:29:08 PM - RerouteReq

01/25/2022 3:29:08 PM - Leg L:729.2[Line:10002>>+158******04] is terminated: Cause: 403 Forbidden/INVITE from 54.***.**.3:5060

01/25/2022 3:29:08 PM - L:729.2[Line:10002>>+158******04] got Terminated Recv 403/INVITE from 54.***.**.3:5060 tid=237a7875044feb28 Call-ID=QoDXAZzAPTpSt27So0xZfA..:

SIP/2.0 403 Forbidden

Via: SIP/2.0/UDP 104.***.**.212:5060;received=104.131.53.212;branch=z9hG4bK-524287-1---237a7875044feb28;rport=5060

Contact: sip:172.**.**.250:5060

To: sip:+158******04@det**********ape.sip.twilio.com:5060;tag=72763472_c3356d0b_275732f1-fdb1-4ae1-8bb1-cf9fc3c66c3d

From: "Det***********ape" sip:+184******29@det**********ape.sip.twilio.com:5060;tag=18132c1e

Call-ID: QoDXAZzAPTpSt27So0xZfA..

CSeq: 1 INVITE

Server: Twilio

Content-Length: 0

01/25/2022 3:29:08 PM - Terminated from sip:+158******04@det**********ape.sip.twilio.com:5060;tag=72763472_c3356d0b_275732f1-fdb1-4ae1-8bb1-cf9fc3c66c3d to "Det***********ape" sip:+184******29@det**********ape.sip.twilio.com:5060;tag=18132c1e; reason: Error

01/25/2022 3:29:08 PM - Call to T:Line:10002>>+158******04@[Dev:sip:10002@det**********ape.sip.twilio.com:5060] from L:729.1[Line:10002<<+184******29] failed, cause: Cause: 403 Forbidden/INVITE from 54.***.**.3:5060

01/25/2022 3:29:08 PM - L:729.2[Line:10002>>+158******04] got Failure: Failure Recv 403/INVITE from 54.***.**.3:5060 tid=237a7875044feb28 Call-ID=QoDXAZzAPTpSt27So0xZfA..:

SIP/2.0 403 Forbidden

Via: SIP/2.0/UDP 104.***.**.212:5060;received=104.131.53.212;branch=z9hG4bK-524287-1---237a7875044feb28;rport=5060

Contact: sip:172.**.**.250:5060

To: sip:+158******04@det**********ape.sip.twilio.com:5060;tag=72763472_c3356d0b_275732f1-fdb1-4ae1-8bb1-cf9fc3c66c3d

From: "Det***********ape" sip:+184******29@det**********ape.sip.twilio.com:5060;tag=18132c1e

Call-ID: QoDXAZzAPTpSt27So0xZfA..

CSeq: 1 INVITE

Server: Twilio

Content-Length: 0

01/25/2022 3:29:08 PM - [CM503003]: Call(C:729): Call to sip:+158******04@det**********ape.sip.twilio.com:5060 has failed; Cause: 403 Forbidden/INVITE from 54.***.**.3:5060

01/25/2022 3:29:08 PM - Session 1537933 has failed in leg L:729.2[Line:10002>>+158******04] ; Cause: 403 Forbidden/INVITE from 54.***.**.3:5060

01/25/2022 3:29:08 PM - Failure from sip:+158******04@det**********ape.sip.twilio.com:5060;tag=72763472_c3356d0b_275732f1-fdb1-4ae1-8bb1-cf9fc3c66c3d to "Det***********ape" sip:+184******29@det**********ape.sip.twilio.com:5060;tag=18132c1e

01/25/2022 3:29:08 PM - [CM503025]: Call(C:729): Calling T:Line:10002>>+158******04@[Dev:sip:10002@det**********ape.sip.twilio.com:5060] for L:729.1[Line:10002<<+184******29]

01/25/2022 3:29:08 PM - Route to L:729.2[Line:10002>>+158******04] sends Invite-OUT Send Req INVITE from 54.***.**.3:5060 tid=237a7875044feb28 Call-ID=QoDXAZzAPTpSt27So0xZfA..:

INVITE sip:+158******04@det**********ape.pstn.twilio.com SIP/2.0

Via: SIP/2.0/ ;branch=z9hG4bK-524287-1---237a7875044feb28;rport

Max-Forwards: 70

Contact: sip:det**********cape@104.***.**.212:5060

To: sip:+158******04@det**********ape.sip.twilio.com:5060

From: "Det***********ape"sip:+184******29@det**********ape.sip.twilio.com:5060;tag=18132c1e

Call-ID: QoDXAZzAPTpSt27So0xZfA..

CSeq: 1 INVITE

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE, UPDATE

Content-Type: application/sdp

Supported: replaces, timer

User-Agent: 3CXPhoneSystem 18.0.2.314 (314)

P-Asserted-Identity: sip:+184******29@det**********ape.sip.twilio.com:5060

Remote-Party-ID: sip:+184******29@det**********ape.sip.twilio.com:5060;party=calling

Content-Length: 222[/ICODE]
 
Last edited by a moderator:
Which settings are you using that work? I'll post exact configuration and logs here in a moment.
My settings are exactly the same with the ones applied when you use the default template to set up your trunk.
Also 302 diversion is not supported for Twilio trunks so I would not waste any more time testing that.

Have a look at this reply and test it with these settings. It won't keep the originator caller ID when forwarding a call but it will help us pin point the issue. Let us know if that works for you.
 
Hi @YiannisH_3CX

Good news -- it works now. I contacted Twilio support, explained the issue I was having, and gave them the same information which I posted here. The Twilio support agent explained that by default, Twilio will not allow outbound calls ("forwarding") from a phone number that has not been verified with them. They understood my situation and because the calls I would need to forward could come from any number, they activated a special flag on my account which allows unverified numbers to be forwarded through their service.

Thank you for your help as well. Is there a way to mark this thread as "solved" so that it may help others at a later time?
 
Glad to see the issue has been resolved and thank you for the update. We will make the necessary adjustments on our side as well.
Marking this as Solved.
 
  • Like
Reactions: DavidM84
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,325
Messages
591,898
Members
165,477
Latest member
Mueller