Hi, I'm working on my dial plan and I'd like to parse all dialed numbers to convert them to the format I want. For example if someone dials 0112345678 or 0033112345678 I would like to convert it to +33112345678 and then match the number to my exten => +33XXXXXXXX statements. Is this possible with asterisk? I tried different ways (using _., s, ...) but I can't seem to get that working right... Thanks for your help, Remi
Yes, it is possible. Zeeshan A Zakaria -- Sent from my Android phone with K-9 Mail. On 2010-05-28 5:12 PM, "R?mi Philippe" <ml at remiphilippe.fr> wrote: Hi, I'm working on my dial plan and I'd like to parse all dialed numbers to convert them to the format I want. For example if someone dials 0112345678 or 0033112345678 I would like to convert it to +33112345678 and then match the number to my exten => +33XXXXXXXX statements. Is this possible with asterisk? I tried different ways (using _., s, ...) but I can't seem to get that working right... Thanks for your help, Remi -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100528/d7d9e882/attachment.htm
The REGEX function should be useable to "fix" the number as you need. -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of R?mi Philippe Sent: Friday, May 28, 2010 4:05 PM To: asterisk-users at lists.digium.com Subject: [asterisk-users] Normalizing called numbers Hi, I'm working on my dial plan and I'd like to parse all dialed numbers to convert them to the format I want. For example if someone dials 0112345678 or 0033112345678 I would like to convert it to +33112345678 and then match the number to my exten => +33XXXXXXXX statements. Is this possible with asterisk? I tried different ways (using _., s, ...) but I can't seem to get that working right... Thanks for your help, Remi -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
> I'm working on my dial plan and I'd like to parse all dialed numbers > to convert them to the format I want. > For example if someone dials 0112345678 or 0033112345678 I would like > to convert it to +33112345678 and then match the number to my exten => > +33XXXXXXXX statements.If I understand what transformations you want, it's: exten => _00X.,1,Goto(+${EXTEN:2},1) exten => _0[1-9]X.,1,Goto(+33${EXTEN:1},1) (You really don't need the '[1-9]' since Asterisk will match the most specific, but it's cleaner to have it.)
R?mi Philippe wrote:> Hi, > I'm working on my dial plan and I'd like to parse all dialed numbers > to convert them to the format I want. > For example if someone dials 0112345678 or 0033112345678 I would like > to convert it to +33112345678 and then match the number to my exten => > +33XXXXXXXX statements. > > Is this possible with asterisk? I tried different ways (using _., s, > ...) but I can't seem to get that working right... > > Thanks for your help, > > Remi > >Assuming you are using a version with AEL, this can be done in a cleaner way with the pattern part of a switch statement: switch(${CALLERID(num)}) { pattern 011XXXXXXX: CALLERID(num)="+3311XXXXXXX"; break; pattern 003311XXXXXXX: CALLERID(num)="+3311XXXXXXX"; break; default: LOG(NOTICE, Callerid ${CALLERID(num)} not normalized); break; } You will likely want to put this into a macro and tweak it further based other patterns that you encounter. --johann
Guys, ? I would like to connect my blackberry or any other cell phone to asterisk so that I can send calls through the sim card. I would also like to send SMS through this as well. Could someone point me in the right direction? ? Thanks, Nivin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100529/4b8dc25d/attachment.htm
Hi, In the past I had a sony ericsson connected via usb cable, and used gnokii to interact with it. Then I would use System() in asterisk to call up gnokii. I never tried it but I think asterisk-addons has got a module to use Bluetooth mobile phones. On 29 May 2010 07:01, Nivin Kumar <nivinkumar24 at yahoo.in> wrote:> Guys, > > I would like to connect my blackberry or any other cell phone to asterisk > so that I can send calls through the sim card. I would also like to send SMS > through this as well. Could someone point me in the right direction? > > Thanks, > Nivin > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100529/93806375/attachment.htm