Re: [Freeswitch-users] destination_number cleanup
Some custom softphone a call center we use has; they auto dial with it and I was able to make brea, x-lite and polycom phone (using uri dialing) send some messed up strings too. I was trying to see if breaks the sip specification so I could push back but I couldn't find anything what a uri couldn't use. It looks to me it can be almost anything - personally they are being lazy and not scrubbing the list first Thanks for the regex string and I will look into writing a script however I would prefer not too... From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Avi Marcus Sent: Monday, December 19, 2011 1:08 AM To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] destination_number cleanup Yes, this is really broken input! I thought it was bad some do +1 or 001 1 or no prefix to dial America! To modify Ryan's code to make it more flexible... ^(?:\+1|001|1)?\D*(\d{3})\D*(\d{3})\D*(\d{4})$ $1, $2 and $3 should give you the full number, so bridge to 1$1$2$3. it will match anything that has xxx-xxx-xxxx with whatever separating non-digits is in between. But it can only handle (by discarding) a prefix of +1, 1, or 001. I'd suggest using xml_curl or a lua script and doing a regex replace of any non-digit characters, if you really need. But how in the world is this your input? What devices are sending this?? -Avi On Mon, Dec 19, 2011 at 4:12 AM, Brian West <brian@freeswitch.org<mailto:brian@freeswitch.org>> wrote: Why do you have broken devices sending you numbers in that screwed up format in the request URI in the first place? At this point you should be using XML_CURL then cleaning that up if this is what you're hitting. Or you tell your clients to fix their badly broken behavior. /b On Dec 18, 2011, at 8:08 PM, Ryan V wrote: On Mon, Dec 19, 2011 at 2:56 AM, Elliott Vogel <elliott@zoogmedia.com<mailto:elliott@zoogmedia.com>>wrote: I was wondering if anyone has a regex expression that works to return just digest? I have some clients sending requests formatted to +1 (555) 555-5555, 555-555-5555, 555.555.5555 which aren't be processed by our dial plan because we are expecting all numbers (5555555555) **** How about this? ^\+1\s+\((\d{3})\)\s(\d{3})-(\d{4})$|^(\d{3})-(\d{3})-(\d{4})$|^(\d{3})\.(\d{3})\.(\d{4})$ $1, $2 and $3 should give you the full number. Regards, Ryan -- Brian West FreeSWITCH Solutions, LLC Phone: +1 (918) 420-9266<tel:%2B1%20%28918%29%20420-9266> Fax: +1 (918) 420-9267<tel:%2B1%20%28918%29%20420-9267> brian@freeswitch.org<mailto:brian@freeswitch.org> http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (1)
-
Elliott Vogel