[Asterisk-Users] How to make * don't strip the leading 0

Shaun Ewing sewing at gmail.com
Mon Jul 12 07:22:43 MST 2004


On Mon, 12 Jul 2004 14:57:42 +0200, Kai Militzer <km at westend.com> wrote:
> Hi folks!
> 
> Is it possible to tell asterisk not to strip the leading 0 of *incoming*
> MSNs? I use asterisk with i4l and whenever I get a call from an
> long-distance party, the leading 0, which should be there according the
> german numbering, is not. So if I get a call from a mobile phone
> 0177-1234567 should be displayed, but 177-1234567 is displayed. I double
> checked if I've forgotten to remove an option to strip the first digit
> of incoming calls and found nothing.
> 
> The wiki and the mailinglist archives can't enlight me either, why
> asterisk behaves like this, or how I can turn it off. So if someone
> could give me a hint, I would be very delighted!

You could try adding the leading zero.

For example, I have:
[incoming-isdn]

[incoming-isdn]

exten => msn,1,NoOp
exten => msn,2,SetCallerID(0${CALLERIDNAME} <00${CALLERIDNUM}>)
exten => msn,3,GotoIf,$[${CALLERIDNUM} = 000]?200:4
exten => msn,4,NoOp
exten => msn,5,Goto(local-extensions,7000,1)
exten => msn,200,SetCallerID(Private <>)
exten => msn,201,Goto(4)

(my number has been replaced with msn)

This adds the leading 0 to calleridname, and 00 to calleridnum (so it
included the '0' needed to dial externally). It has an unfortunate
side effect of setting the caller ID number to '000' if the telco
doesn't send any caller ID (which also happens to be the emergency
number here in Australia), so I have the GotoIf to catch that
condition and replace it with Private.

I don't know how that works for incoming International calls (never
tested), but it works just fine for national calls.

-Shaun



More information about the asterisk-users mailing list