[Spce-user] Problem (Bug?) in Billing Fee uploads
Andreas Granig
agranig at sipwise.com
Thu Mar 14 15:19:48 EDT 2013
Hi,
On 03/14/2013 03:38 PM, Gavin Sweet wrote:
> My table of tests got a bit mangled.
> Basically, this problem is when trying to upload fees from file.
> For example, for *exactly* 44118555, the destination should be: ^44118555$
> But the ^ and $ get stripped for some reason during the upload from file.
> Same with ^44118555.*$
> But NOT with ^4411855[5]$ or ^44118555.$
It's actually a bit of a consistency problem for historical reasons,
mixed with an issue when displaying it, and it will be changed in the
near future.
Currently it works like this:
If you put in a plain number like "441234", it internally gets extended
to "^441234.*$". This is what people expected us to do in the past, as
they only wanted to do prefix-based destination matching. When the value
is displayed again on the admin panel, it is displayed as "441234"
again. Although, if you check the billing.billing_fees table in the DB,
you'll the the full regex there.
The same applies to IP addresses, where "1.2.3.4" gets
"^.*@1\.2\.3\.4$", but are displayed in the admin panel as "1.2.3.4"
again, and the same for SIP URIs like "user at example.org", which gets
"^user at example\.org$".
Everything else will be passed to the DB as is. However, something like
"^441234$" will be saved as is, but displayed as "441234", which is an
inconsistency and is confusing, as I admit (I'd consider it as a bug).
Now since regex are already used quite heavily in rewrite rules, we have
already decided to entirely drop this implicit and confusing "magic" in
the next release, so people will be required to enter exactly the regex
they want to match. It will break the logic of people who rely on this
prefix-based thing, but properly documented (also on the admin panel
itself) it should be manageable. For everyone else, it will be more obvious.
Andreas
More information about the Spce-user
mailing list