[asterisk-users] [1.4] Reading phone number the French way?

Danny Nicholas danny at debsinc.com
Thu Mar 10 08:34:51 CST 2011



-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Gilles
Sent: Thursday, March 10, 2011 8:32 AM
To: asterisk-users at lists.digium.com
Subject: Re: [asterisk-users] [1.4] Reading phone number the French way?

On Thu, 10 Mar 2011 14:37:45 +0100, Gilles <codecomplete at free.fr>
wrote:
>I figured out how extensions.conf and say.conf work and posted my
>results in the reply to Dave.

Noticed something strange, though: 0800123456 is played OK (ie.
0.800.12.34.56) , but 092123456 is played digit by digit (0.8.9.2,
etc.):

========== say.conf

;1-9
_[n]um:X => digits/${SAY}

;10-99
_[n]um:1X => digits/${SAY}
_[n]um:[2-9]0 =>  digits/${SAY}
_[n]um:[2-6]1 => digits/${SAY:0:1}0, vm-and, digits/${SAY:1}
_[n]um:71 => digits/60, vm-and, num:1${SAY:1}
_[n]um:7X => digits/60, num:1${SAY:1}
_[n]um:9X => digits/80, num:1${SAY:1}
_[n]um:[2-9][1-9] =>  digits/${SAY:0:1}0, num:${SAY:1}

;100-999
_[n]um:100 => digits/hundred
_[n]um:1XX => digits/hundred, num:${SAY:1}
_[n]um:[2-9]00 => num:${SAY:0:1}, digits/hundred
_[n]um:[2-9]XX => num:${SAY:0:1}, digits/hundred, num:${SAY:1}

;0800XXXXXX -> 0899XXXXXX
;_pho[n]e:08XXXXXXXX => num:${SAY:0:1}, num:${SAY:1:3},
num:${SAY:4:2}, num:${SAY:6:2}, num:${SAY:8:2}

========== CLI

-- Executing [2222 at internal:4] Playback("SIP/xlite-02a56004",
"phone:0810009032|say") in new stack
-- <SIP/xlite-02a56004> Playing 'digits/0' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/8' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/hundred' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/10' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/0' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/0' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/90' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/30' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/2' (language 'fr')

-- Executing [2222 at internal:6] Playback("SIP/xlite-02a56004",
"phone:0892123456}|say") in new stack
-- <SIP/xlite-02a56004> Playing 'digits/0' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/8' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/9' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/2' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/1' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/2' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/3' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/4' (language 'fr')
-- <SIP/xlite-02a56004> Playing 'digits/5' (language 'fr')
-- Executing [2222 at internal:7] Hangup("SIP/xlite-02a56004", "") in new
stack
========== 

Can't figure out why it doesn't use the same pattern to play 0800 and
092 numbers. Any idea?

Thank you.

This one is easy.  You have a specific pattern to match 0800.  092 has no
pattern and therefore defaults back to an "Asterisk Standard Playback".




More information about the asterisk-users mailing list