Inbound call does not display 0

Status
Not open for further replies.

daniel.821

Joined
Jun 8, 2011
Messages
21
Reaction score
0
Hi all!!

We have a Elastix 1.6 server, when inbound calls come in, it does not display " 0 " in the caller ID.

For example, if I use my mobile 04xxxxxxxx call in, it only displays as "4xxxxxxxx"

Has any one experienced that before? can you please let me know how to fix it?


Thank you very very much in advance.
 
Does your mobile phone carrier normally send CID info with the leading 0?

Andrey
 
Dear Andrey,

Thank you very much for your reply!!

However, it does not only happen to one mobile carrier, but it happens to all of them. We are guess may be it our dahdi is not configured properly?

Once again, thank you very much for helping us out!! :)

Dan
 
I might think, that your provider is not sending all digits...
If that would be the case, I would do a context to check the phone number lenght, and if it has less than N digits, I would add the 0 as a prefix
 
Dear jgutierrez,

Thank you for your prompt reply!!

Can you please instruct us how to check number context? and how do we add a 0 as prefix?

Thank you so much for your help!!

Dan
 
I would write the following context on my extension_custom.conf file:
Code:
[custom-inbound]
exten => _XXXX.,1,Answer
exten => _XXXX.,n,ExecIf($[ "${LEN(${CALLERID(num)})}" = "9" ]?Set(CALLERID(num)=0${CALLERID(num)}))
exten => _XXXX.,n,Goto(from-pstn,${EXTEN},1)

Then change the context of your sip trunk, to custom-inbound
 
Dear jgutierrez,

Thank you very much for your reply.

Sorry to be a pain,

but we cannot find extension_custom.conf file, did you mean "/etc/asterisk/extensions_custom.conf" file with a "s" after "extension"? Sorry bit I'd just really want to make sure.

And we are actually using Zap/g0 trunk for inbound, can you please let us know how to select "custom-inbound" as well?

Thank you very much again for your help!!

Best regards,
Dan
 
:woohoo:
yes, /etc/asterisk/extensions_custom.conf
If you are using analog lines, paste the following input:
asterisk -rx "dahdi show channels"
asterisk -r (when a call comes into your elastix server)
 
Dear jgutierrez,

here is the output for asterisk -rx "dahdi show channels"

Chan Extension Context Language MOH Interpret
pseudo default default
1 82204560 from-pstn default
2 82204560 from-pstn default
3 from-pstn default
4 from-pstn default
5 from-pstn default
6 from-pstn default
7 from-pstn default
8 from-pstn default
9 from-pstn default
10 from-pstn default
11 from-pstn default
12 from-pstn default
13 from-pstn default
14 from-pstn default
15 from-pstn default
17 from-pstn default
18 from-pstn default
19 from-pstn default
20 from-pstn default
21 from-pstn default
22 from-pstn default
23 from-pstn default
24 from-pstn default
25 from-pstn default
26 from-pstn default
27 from-pstn default
28 from-pstn default
29 from-pstn default
30 from-pstn default
31 from-pstn default


and out put for incoming verbose:

VIP*CLI>
-- Executing [*97@from-internal:1] Answer("SIP/513-b6602a10", "") in new sta
-- Executing [*97@from-internal:2] Wait("SIP/513-b6602a10", "1") in new stac
-- Executing [*97@from-internal:3] Macro("SIP/513-b6602a10", "user-callerid|
-- Executing [s@macro-user-callerid:1] Set("SIP/513-b6602a10", "AMPUSER=513"
-- Executing [s@macro-user-callerid:2] GotoIf("SIP/513-b6602a10", "0?report"
-- Executing [s@macro-user-callerid:3] ExecIf("SIP/513-b6602a10", "1|Set|REA
-- Executing [s@macro-user-callerid:4] Set("SIP/513-b6602a10", "AMPUSER=513"
-- Executing [s@macro-user-callerid:5] Set("SIP/513-b6602a10", "AMPUSERCIDNA
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/513-b6602a10", "0?report"
-- Executing [s@macro-user-callerid:7] Set("SIP/513-b6602a10", "AMPUSERCID=5
-- Executing [s@macro-user-callerid:8] Set("SIP/513-b6602a10", "CALLERID(all
-- Executing [s@macro-user-callerid:9] ExecIf("SIP/513-b6602a10", "0|Set|CHA
-- Executing [s@macro-user-callerid:10] GotoIf("SIP/513-b6602a10", "0?contin
-- Executing [s@macro-user-callerid:11] Set("SIP/513-b6602a10", "__TTL=64")
-- Executing [s@macro-user-callerid:12] GotoIf("SIP/513-b6602a10", "1?contin
-- Goto (macro-user-callerid,s,19)
-- Executing [s@macro-user-callerid:19] NoOp("SIP/513-b6602a10", "Using Call
-- Executing [*97@from-internal:4] Macro("SIP/513-b6602a10", "get-vmcontext|
-- Executing [s@macro-get-vmcontext:1] Set("SIP/513-b6602a10", "VMCONTEXT=de
-- Executing [s@macro-get-vmcontext:2] GotoIf("SIP/513-b6602a10", "0?200:300
-- Goto (macro-get-vmcontext,s,300)
-- Executing [s@macro-get-vmcontext:300] NoOp("SIP/513-b6602a10", "") in new
-- Executing [*97@from-internal:5] MailboxExists("SIP/513-b6602a10", "513@de
-- Executing [*97@from-internal:6] GotoIf("SIP/513-b6602a10", "1?mbexist") i
-- Goto (from-internal,*97,106)
-- Executing [*97@from-internal:106] VoiceMailMain("SIP/513-b6602a10", "513@
-- <SIP/513-b6602a10> Playing 'vm-youhave' (language 'en')
-- Accepting call from '881219311' to '82204514' on channel 0/6, span 1
-- Executing [82204514@from-pstn:1] Set("DAHDI/6-1", "__FROM_DID=82204514")
-- Executing [82204514@from-pstn:2] Gosub("DAHDI/6-1", "app-blacklist-check|
-- Executing [s@app-blacklist-check:1] LookupBlacklist("DAHDI/6-1", "") in n
-- Executing [s@app-blacklist-check:2] GotoIf("DAHDI/6-1", "0?blacklisted")
-- Executing [s@app-blacklist-check:3] Return("DAHDI/6-1", "") in new stack
-- Executing [82204514@from-pstn:3] ExecIf("DAHDI/6-1", "1 |Set|CALLERID(nam
-- Executing [82204514@from-pstn:4] Set("DAHDI/6-1", "__CALLINGPRES_SV=allow
-- Executing [82204514@from-pstn:5] SetCallerPres("DAHDI/6-1", "allowed_not_
-- Executing [82204514@from-pstn:6] Goto("DAHDI/6-1", "from-did-direct|514|1
-- Goto (from-did-direct,514,1)
-- Executing [514@from-did-direct:1] Set("DAHDI/6-1", "__RINGTIMER=20") in n
-- Executing [514@from-did-direct:2] Macro("DAHDI/6-1", "exten-vm|514|514")
-- Executing [s@macro-exten-vm:1] Macro("DAHDI/6-1", "user-callerid") in new
-- Executing [s@macro-user-callerid:1] Set("DAHDI/6-1", "AMPUSER=881219311")
-- Executing [s@macro-user-callerid:2] GotoIf("DAHDI/6-1", "0?report") in ne
-- Executing [s@macro-user-callerid:3] ExecIf("DAHDI/6-1", "1|Set|REALCALLER
-- Executing [s@macro-user-callerid:4] Set("DAHDI/6-1", "AMPUSER=") in new s
-- Executing [s@macro-user-callerid:5] Set("DAHDI/6-1", "AMPUSERCIDNAME=") i
-- Executing [s@macro-user-callerid:6] GotoIf("DAHDI/6-1", "1?report") in ne
-- Goto (macro-user-callerid,s,10)
-- Executing [s@macro-user-callerid:10] GotoIf("DAHDI/6-1", "0?continue") in
-- Executing [s@macro-user-callerid:11] Set("DAHDI/6-1", "__TTL=64") in new
-- Executing [s@macro-user-callerid:12] GotoIf("DAHDI/6-1", "1?continue") in
-- Goto (macro-user-callerid,s,19)
-- Executing [s@macro-user-callerid:19] NoOp("DAHDI/6-1", "Using CallerID "8
-- Executing [s@macro-exten-vm:2] Set("DAHDI/6-1", "RingGroupMethod=none") i
-- Executing [s@macro-exten-vm:3] Set("DAHDI/6-1", "VMBOX=514") in new stack
-- Executing [s@macro-exten-vm:4] Set("DAHDI/6-1", "EXTTOCALL=514") in new s
-- Executing [s@macro-exten-vm:5] Set("DAHDI/6-1", "CFUEXT=") in new stack
-- Executing [s@macro-exten-vm:6] Set("DAHDI/6-1", "CFBEXT=") in new stack
-- Executing [s@macro-exten-vm:7] Set("DAHDI/6-1", "RT=20") in new stack
-- Executing [s@macro-exten-vm:8] Macro("DAHDI/6-1", "record-enable|514|IN")
-- Executing [s@macro-record-enable:1] GotoIf("DAHDI/6-1", "1?check") in new
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] AGI("DAHDI/6-1", "recordingcheck|2011
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20110915-122540|1316049940.473530: Inbound recording not enable
-- AGI Script recordingcheck completed, returning 0
-- Executing [s@macro-record-enable:5] MacroExit("DAHDI/6-1", "") in new sta
-- Executing [s@macro-exten-vm:9] Macro("DAHDI/6-1", "dial|20|tr|514") in ne
-- Executing [s@macro-dial:1] GotoIf("DAHDI/6-1", "1?dial") in new stack
-- Goto (macro-dial,s,3)
-- Executing [s@macro-dial:3] AGI("DAHDI/6-1", "dialparties.agi") in new sta
-- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
== Parsing '/etc/asterisk/manager.conf': Found
== Parsing '/etc/asterisk/manager_additional.conf': Found
== Parsing '/etc/asterisk/manager_custom.conf': Found
== Manager 'admin' logged on from 127.0.0.1
dialparties.agi: Caller ID name is '881219311' number is '881219311'
dialparties.agi: USE_CONFIRMATION: 'FALSE'
dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is 'none'
-- dialparties.agi: Added extension 514 to extension map
> dialparties.agi: Extension 514 has call screening off
-- dialparties.agi: Extension 514 cf is disabled
-- dialparties.agi: Extension 514 do not disturb is disabled
> dialparties.agi: extnum 514 has: cw: 1; hascfb: 0 [] hascfu: 0 []
dialparties.agi: ExtensionState: 0
-- dialparties.agi: dbset CALLTRACE/514 to 881219311
-- dialparties.agi: Filtered ARG3: 514
== Manager 'admin' logged off from 127.0.0.1
-- AGI Script dialparties.agi completed, returning 0
-- Executing [s@macro-dial:7] Dial("DAHDI/6-1", "SIP/514|20|tr") in new stac
-- Called 514
-- SIP/514-08e01390 is ringing
-- <SIP/513-b6602a10> Playing 'digits/1' (language 'en')
-- <SIP/513-b6602a10> Playing 'vm-INBOX' (language 'en')
-- <SIP/513-b6602a10> Playing 'vm-and' (language 'en')
-- <SIP/513-b6602a10> Playing 'digits/1' (language 'en')
-- <SIP/513-b6602a10> Playing 'vm-Old' (language 'en')
-- SIP/514-08e01390 answered DAHDI/6-1
-- <SIP/513-b6602a10> Playing 'vm-message' (language 'en')

Once again, thank you so much for your help.

Dan
 
You will need to do the same, change the context name on dahdi-channels.conf from from-pstn to custom-inbound
Then execute the following:
asterisk -rx "module reload"
 
Dear jgutierrez,

In dahdi-channels.conf, I changed

group=0,11
context=from-pstn <==== here to context=custom-inbound
switchtype = euroisdn
signalling = pri_cpe
channel => 1-15,17-31
context = default
group = 63

But then it is not able to receive phone calls anymore, here is the verbose:

-- Accepting call from '433902186' to '82204514' on channel 0/19, span 1
-- Executing [82204514@from-pstn:1] Set("DAHDI/19-1", "__FROM_DID=82204514") in new stack
-- Executing [82204514@from-pstn:2] Gosub("DAHDI/19-1", "app-blacklist-check|s|1") in new stack
-- Executing [s@app-blacklist-check:1] LookupBlacklist("DAHDI/19-1", "") in new stack
-- Executing [s@app-blacklist-check:2] GotoIf("DAHDI/19-1", "0?blacklisted") in new stack
-- Executing [s@app-blacklist-check:3] Return("DAHDI/19-1", "") in new stack
-- Executing [82204514@from-pstn:3] ExecIf("DAHDI/19-1", "1 |Set|CALLERID(name)=433902186") in new stack
-- Executing [82204514@from-pstn:4] Set("DAHDI/19-1", "__CALLINGPRES_SV=allowed_passed_screen") in new stack
-- Executing [82204514@from-pstn:5] SetCallerPres("DAHDI/19-1", "allowed_not_screened") in new stack
-- Executing [82204514@from-pstn:6] Goto("DAHDI/19-1", "from-did-direct|514|1") in new stack
-- Goto (from-did-direct,514,1)
-- Executing [514@from-did-direct:1] Set("DAHDI/19-1", "__RINGTIMER=20") in new stack
-- Executing [514@from-did-direct:2] Macro("DAHDI/19-1", "exten-vm|514|514") in new stack
-- Executing [s@macro-exten-vm:1] Macro("DAHDI/19-1", "user-callerid") in new stack
-- Executing [s@macro-user-callerid:1] Set("DAHDI/19-1", "AMPUSER=433902186") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("DAHDI/19-1", "0?report") in new stack
-- Executing [s@macro-user-callerid:3] ExecIf("DAHDI/19-1", "1|Set|REALCALLERIDNUM=433902186") in new stack
-- Executing [s@macro-user-callerid:4] Set("DAHDI/19-1", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:5] Set("DAHDI/19-1", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("DAHDI/19-1", "1?report") in new stack
-- Goto (macro-user-callerid,s,10)
-- Executing [s@macro-user-callerid:10] GotoIf("DAHDI/19-1", "0?continue") in new stack
-- Executing [s@macro-user-callerid:11] Set("DAHDI/19-1", "__TTL=64") in new stack
-- Executing [s@macro-user-callerid:12] GotoIf("DAHDI/19-1", "1?continue") in new stack
-- Goto (macro-user-callerid,s,19)
-- Executing [s@macro-user-callerid:19] NoOp("DAHDI/19-1", "Using CallerID "433902186" <433902186>") in new stack
-- Executing [s@macro-exten-vm:2] Set("DAHDI/19-1", "RingGroupMethod=none") in new stack
-- Executing [s@macro-exten-vm:3] Set("DAHDI/19-1", "VMBOX=514") in new stack
-- Executing [s@macro-exten-vm:4] Set("DAHDI/19-1", "EXTTOCALL=514") in new stack
-- Executing [s@macro-exten-vm:5] Set("DAHDI/19-1", "CFUEXT=") in new stack
-- Executing [s@macro-exten-vm:6] Set("DAHDI/19-1", "CFBEXT=") in new stack
-- Executing [s@macro-exten-vm:7] Set("DAHDI/19-1", "RT=20") in new stack
-- Executing [s@macro-exten-vm:8] Macro("DAHDI/19-1", "record-enable|514|IN") in new stack
-- Executing [s@macro-record-enable:1] GotoIf("DAHDI/19-1", "1?check") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] AGI("DAHDI/19-1", "recordingcheck|20110915-140144|1316055704.475628") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20110915-140144|1316055704.475628: Inbound recording not enabled
-- AGI Script recordingcheck completed, returning 0
-- Executing [s@macro-record-enable:5] MacroExit("DAHDI/19-1", "") in new stack
-- Executing [s@macro-exten-vm:9] Macro("DAHDI/19-1", "dial|20|tr|514") in new stack
-- Executing [s@macro-dial:1] GotoIf("DAHDI/19-1", "1?dial") in new stack
-- Goto (macro-dial,s,3)
-- Executing [s@macro-dial:3] AGI("DAHDI/19-1", "dialparties.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
== Parsing '/etc/asterisk/manager.conf': Found
== Parsing '/etc/asterisk/manager_additional.conf': Found
== Parsing '/etc/asterisk/manager_custom.conf': Found
== Manager 'admin' logged on from 127.0.0.1
dialparties.agi: Caller ID name is '433902186' number is '433902186'
dialparties.agi: USE_CONFIRMATION: 'FALSE'
dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is 'none'
-- dialparties.agi: Added extension 514 to extension map
> dialparties.agi: Extension 514 has call screening off
-- dialparties.agi: Extension 514 cf is disabled
-- dialparties.agi: Extension 514 do not disturb is disabled
> dialparties.agi: extnum 514 has: cw: 1; hascfb: 0 [] hascfu: 0 []
dialparties.agi: ExtensionState: 0
-- dialparties.agi: dbset CALLTRACE/514 to 433902186
-- dialparties.agi: Filtered ARG3: 514
== Manager 'admin' logged off from 127.0.0.1
-- AGI Script dialparties.agi completed, returning 0
-- Executing [s@macro-dial:7] Dial("DAHDI/19-1", "SIP/514|20|tr") in new stack
-- Called 514
-- SIP/514-08da5418 is ringing
-- Channel 0/19, span 1 got hangup request, cause 16
== Spawn extension (macro-dial, s, 7) exited non-zero on 'DAHDI/19-1' in macro 'dial'
== Spawn extension (macro-exten-vm, s, 9) exited non-zero on 'DAHDI/19-1' in macro 'exten-vm'
== Spawn extension (from-did-direct, 514, 2) exited non-zero on 'DAHDI/19-1'
-- Executing [h@macro-dial:1] Macro("DAHDI/19-1", "hangupcall") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("DAHDI/19-1", "1?skiprg") in new stack
-- Goto (macro-hangupcall,s,4)
-- Executing [s@macro-hangupcall:4] GotoIf("DAHDI/19-1", "1?skipblkvm") in new stack
-- Goto (macro-hangupcall,s,7)
-- Executing [s@macro-hangupcall:7] GotoIf("DAHDI/19-1", "1?theend") in new stack
-- Goto (macro-hangupcall,s,9)
-- Executing [s@macro-hangupcall:9] Hangup("DAHDI/19-1", "") in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'DAHDI/19-1' in macro 'hangupcall'
== Spawn extension (macro-dial, h, 1) exited non-zero on 'DAHDI/19-1'
-- Hungup 'DAHDI/19-1'

Am I doing this wrong?

Thanks :cheer:

Dan
 
Yes, you are not following correctly the provided steps... :ohmy:

I can see that you are still getting your inbound calls...
You haven't executed:
asterisk -rx "module reload"
 
Sorry jgutierrez,

I gave you the wrong log. Should be this one..


VIP*CLI>
-- Accepting call from '433902186' to '82204514' on channel 0/1, span 1
-- Executing [82204514@custom-inbound:1] Answer("DAHDI/1-1", "") in new stack
-- Executing [82204514@custom-inbound:2] ExecIf("DAHDI/1-1", "1?Set(CALLERID(num)=0433902186)") in new stack
== Spawn extension (custom-inbound, 82204514, 2) exited non-zero on 'DAHDI/1-1'

:blush:

Dan
 
You forgot to put the third line of the context...
 
In my extensions_custom.conf

I have..

[custom-inbound]
exten => _XXXX.,1,Answer
exten => _XXXX.,n,ExecIf($[ "${LEN(${CALLERID(num)})}" = "9" ]?Set(CALLERID(num)=0${CALLERID(num)}))
exten => _XXXX.,n,Goto(from-pstn,${EXTEN},1)

:S
 
That context is wrong, copy and paste it correctly...
Make use of the "code" function to paste the dial pattern, also paste the following output:
asterisk -rx "core show application ExecIf"
 
[root@VIP ~]# asterisk -rx "core show application ExecIf"

-= Info about application 'ExecIf' =-

[Synopsis]
Executes dialplan application, conditionally

[Description]
Usage: ExecIF (<expr>|<app>|<data>)
If <expr> is true, execute and return the result of <app>(<data>).
If <expr> is true, but <app> is not found, then the application
will return a non-zero value.



:huh: I really cannot see there is any difference to your context though, can you please give me more information?

Thanks heaps!!!
 
Yes...
You are using asterisk 1.4 I though you where using asterisk 1.6
Anyways, modify the context and use the following line instead of the previous one:
Code:
exten => _XXXX.,n,ExecIf($[ "${LEN(${CALLERID(num)})}" = "9" ]|Set|CALLERID(num)=0${CALLERID(num)})
 
Dear jgutierrez,

I changed extensions_custom.conf file to:

[custom-inbound]
exten => _XXXX.,n,ExecIf($[ "${LEN(${CALLERID(num)})}" = "9" ]|Set|CALLERID(num)=0${CALLERID(num)})

But then I still cannot receive phone calls, I get only..


-- Extension '82204514' in context 'custom-inbound' from '433902186' does not exist. Rejecting call on channel 0/6, span 1

What should I do :blink:
 
lol...
I think, that you need to follow up the instructions step by step...
You need to have the three line context and replace the second line (ExecIF) with the new one that I wrote...
 
Status
Not open for further replies.

Members Online Now

Forum statistics

Threads
111,864
Messages
589,446
Members
164,702
Latest member
iamatlas