Solved call between 3CX and Asterisk : 3CX add a 0 on caller id

Status
Not open for further replies.

amart

Free User
Joined
Jul 4, 2019
Messages
9
Reaction score
1
Sorry for my English.

I have a Asterisk server and a 3CX server.
Phones on asterisk can call phones on 3CX but 3CX phones can't call Asterisk extensions...

On Asterisk i see :
SIP/15792792-000215b9' sent to invalid extension but no invalid handler: context,exten,priority=ext-did,0140,1

I have this message because 3CX or my Asterisk add a 0 on destination extension, for example when i call 140, Asterisk receive 0140 and don't find this extension.

It's just for call extension with a length of 3 number, with 4 number extension it's work
 
Last edited:
Can you run a trace from both sides to see what is being sent, I suspect 3CX is sending the correct extension unless it is set to prepend a 0 in the outbound rules. A trace will prove this.
 
On 3CX i have this :
Code:
07/15/2019 3:30:32 PM - Leg L:96.1[Extn:502] is terminated: Cause: BYE from PBX
07/15/2019 3:30:32 PM - Leg L:96.2[Line:15792792>>140] is terminated: Cause: 603 Declined/INVITE from IP_ASTERISK:5060
07/15/2019 3:30:32 PM - [CM503020]: Call(C:96): Normal call termination. Call originator: Extn:502. Reason: Forbidden
07/15/2019 3:30:32 PM - L:96.1[Extn:502] failed to reach Line:15792792>>140, reason Forbidden
07/15/2019 3:30:32 PM - Call to T:Line:15792792>>140@[Dev:sip:15792792@IP_ASTERISK:5060] from L:96.1[Extn:502] failed, cause: Cause: 603 Declined/INVITE from IP_ASTERISK:5060
07/15/2019 3:30:32 PM - [CM503003]: Call(C:96): Call to <sip:140@IP_ASTERISK:5060> has failed; Cause: 603 Declined/INVITE from IP_ASTERISK:5060
07/15/2019 3:30:32 PM - [CM503025]: Call(C:96): Calling T:Line:15792792>>140@[Dev:sip:15792792@IP_ASTERISK:5060] for L:96.1[Extn:502]
07/15/2019 3:30:32 PM - [CM503027]: Call(C:96): From: Extn:502 ("alexis alexis" <sip:[email protected]:5060>)  to  T:Line:15792792>>140@[Dev:sip:15792792@IP_ASTERISK:5060]
07/15/2019 3:30:32 PM - [CM503004]: Call(C:96): Route 1: from L:96.1[Extn:502] to T:Line:15792792>>140@[Dev:sip:15792792@IP_ASTERISK:5060]
07/15/2019 3:30:32 PM - Line limit check: Current # of calls for line Lc:15792792(@15792792[<sip:15792792@IP_ASTERISK:5060>]) is 0; limit is 10
07/15/2019 3:30:32 PM - Call(C:96): Call from Extn:502 to 140 matches outbound rule 'FR_call'
07/15/2019 3:30:32 PM - [Flow] Call(C:96): has built target endpoint: Out#:>>Rule{FR_call}>>140 for call from L:96.1[Extn:502]
07/15/2019 3:30:32 PM - [Flow] Target endpoint for 140 is Out#:>>Rule{FR_call}>>140
07/15/2019 3:30:32 PM - [CM503010]: Call(C:96): Making route(s) from Extn:502 to <sip:[email protected]:5060>
07/15/2019 3:30:32 PM - [CM505001]: Endpoint Extn:502: Device info: Device Not Identified: User Agent not matched; Capabilities:[reinvite, replaces, able-no-sdp, recvonly] UserAgent: [3CXPhone for Android 16.0.0.35] PBX contact: [sip:[email protected]:5060]
07/15/2019 3:30:32 PM - [CM500002]: Call(C:96): Info on incoming INVITE from Extn:502:
Invite-IN Recv Req INVITE from 10.0.0.152:42679 tid=Pja0c75ca8-42ce-45a8-bd6f-e832ba85e2e8 Call-ID=a0f1e6f0-cda9-4a7b-b9f2-f6ed2db74ac2:
INVITE sip:[email protected];tag3cx=a15b3549-8ac7-4ec5-af0d-ed67f613176f SIP/2.0
Via: SIP/2.0/UDP 10.0.0.152:42679;rport=42679;branch=z9hG4bKPja0c75ca8-42ce-45a8-bd6f-e832ba85e2e8
Max-Forwards: 70
Contact: "alexis alexis" <sip:[email protected]:42679;inst="1b9448fc";rinstance=0-32f0a28c-d52a-4a65-8214-5ad4947aaade;ob>
To: <sip:[email protected];tag3cx=a15b3549-8ac7-4ec5-af0d-ed67f613176f>
From: "alexis alexis"<sip:[email protected]>;tag=06e5b180-2845-4150-b2e9-e8ef6181c2a2
Call-ID: a0f1e6f0-cda9-4a7b-b9f2-f6ed2db74ac2
CSeq: 7897 INVITE
Session-Expires: 1800
Min-SE: 90
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Type: application/sdp
Proxy-Authorization: Digest username="30U6Hre4tz",realm="3CXPhoneSystem",nonce="414d53595d2c7ff876:3c6c9f7aaa45e44de1b509cead058e09",uri="sip:[email protected];tag3cx=a15b3549-8ac7-4ec5-af0d-ed67f613176f",response="900d0a4e22fd35a59590a14f175074da",algorithm=MD5
Supported: replaces, 100rel, timer, norefersub
User-Agent: 3CXPhone for Android 16.0.0.35
Content-Length: 403

v=0
o=- 3772186231 3772186231 IN IP4 10.0.0.152
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 42008 RTP/AVP 0 8 104 3 18 9 96
c=IN IP4 10.0.0.152
b=TIAS:64000
b=AS:84
a=rtcp:42009
a=sendrecv
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:104 iLBC/8000
a=fmtp:104 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:18 G729/8000
a=rtpmap:9 G722/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-15
07/15/2019 3:30:32 PM - [CM503001]: Call(C:96): Incoming call from Extn:502 to <sip:[email protected]:5060>


And on Asterisk :
Code:
    -- Executing [140@from-trunk:1] Set("SIP/15792792-000216ff", "CALLERID(num)=0502") in new stack
    -- Executing [140@from-trunk:2] Set("SIP/15792792-000216ff", "CALLERID(name)=0alexis alexis") in new stack
    -- Executing [140@from-trunk:3] Goto("SIP/15792792-000216ff", "ext-did,0140,1") in new stack
    -- Goto (ext-did,0140,1)
[2019-07-15 15:33:53] WARNING[10097][C-000262f8]: pbx.c:6492 __ast_pbx_run: Channel 'SIP/15792792-000216ff' sent to invalid extension but no invalid handler: context,exten,priority=ext-did,0140,1
[2019-07-15 15:33:53] WARNING[10097][C-000262f8]: pbx.c:6492 __ast_pbx_run: Channel 'SIP/15792792-000216ff' sent to invalid extension but no invalid handler: context,exten,priority=ext-did,0140,1


On router i have this (asterisk is an external server) :
Code:
13:38:10.689631 IP IP_3CX.sip > IP_Asterisk.sip: SIP: INVITE sip:140@IP_Asterisk:5060 SIP/2.0
13:38:10.700575 IP IP_Asterisk.sip > IP_3CX.sip: SIP: SIP/2.0 100 Trying
13:38:10.701888 IP IP_Asterisk.sip > IP_3CX.sip: SIP: SIP/2.0 603 Declined
13:38:10.702426 IP IP_3CX.sip > IP_Asterisk.sip: SIP: ACK sip:140@IP_Asterisk:5060 SIP/2.0


IP_Asterisk and IP_3CX are publics address.
I just see the additional 0 on Asterisk log...
 
This would suggest that Asterisk is reformatting this not 3CX. On your inbound route on Asterisk do you have it to prepend a 0?
 
I don't prepend a 0 on inbound route, it's why i don't understand this 0.

I use the software FreePBX to manage my Asterisk.
I check on the web interface and on the file extensions.conf (real name on FreePBX : extensions_additional.conf)

To test I create an extensions 0140, and when i call 0140 the phone is ringing ... Also i think 0 is prepend just for call number with a length of 3 number
 
And logically if Asterisk prepend a 0, when i call the 140, my phone with 0140 extensions would ring ...
But no, it's when i call 0140 ...
 
If you just call 10 for example does it reformat it to 010 or 0010? The Asterisk server may have some sort of minimum length for external calls.
 
When i call 10, it remate to 010 :
-- Executing [10@from-trunk:1] Set("SIP/15792792-000217e8", "CALLERID(num)=0502") in new stack -- Executing [10@from-trunk:2] Set("SIP/15792792-000217e8", "CALLERID(name)=0alexis alexis") in new stack -- Executing [10@from-trunk:3] Goto("SIP/15792792-000217e8", "ext-did,010,1") in new stack -- Goto (ext-did,010,1) [2019-07-15 16:32:26] WARNING[17604][C-000263a6]: pbx.c:6492 __ast_pbx_run: Channel 'SIP/15792792-000217e8' sent to invalid extension but no invalid handler: context,exten,priority=ext-did,010,1 [2019-07-15 16:32:26] WARNING[17604][C-000263a6]: pbx.c:6492 __ast_pbx_run: Channel 'SIP/15792792-000217e8' sent to invalid extension but no invalid handler: context,exten,priority=ext-did,010,1

With this result we can conclude than external number isn't reformate with 4 number, no ?
 
Now it's work, it's an inbound route we prepend a 0.
Thank you !!!
Now, I just need to find how to call to external number from 3CX and everything is working
 
Hi JohnS,

I begin my configuration with this guide, but don't work, but i try many configuration, and now my configuration is like this guide (with much parameters for my asterisk). So I think it's my fault, maybe a syntax error.

But currently, i just can call external number registered in my asterisk, maybe a parameters to add in my Asterisk i think.
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
111,932
Messages
589,805
Members
164,804
Latest member
fcentral