any *attempt* of a top-up request should be
logged.
+create top-up log records for api
in order to record failed top-up requests as well,
the somewhat tricky thing is to have two
separate transactions here
+propery casting of topup request json field
values to numbers etc., so the transaction for
creating the log entry cannot fail and e.g.
requests with subscriber_id='blah' are recorded
correctly
+new "request_token" parameter for /api/topupvoucher
and /api/topupcash, to identify and filter for
particular requests.
+topup log api resource
+topup log api tests
+fix to correctly reject used vouchers
+topup log panel UI
+fix for balanceintervals.t threaded tests
Change-Id: I86eb845f6173803705b12cc7e5cdbac9a3153a0a
Cli can be edited through subscriberpreferences.
In such case it's value should be preserved on primary_number change.
Change-Id: I6b9d4a8d70e6e85dd9e2bf063cf4c047296deea1
in short: whenever the contract_balances "cash_balance" is
about to decrease, it might drop below thresholds defined
by a contract's profile package. in that case, subscribers
are to be locked and/or underrun billing profile sets are
to be applied. this commit also contains some minor fixes:
+when creating/editing profile packages, all billing
profiles of initial, topup, underrun sets must show the
same interval_free_cash and interval_free_time values.
there was also a problem with adding profile sets to
packages that use profile with prepaid = 1 (see ticket
14301)
+when editing packages using the panel UI, the validation
was not properly invoked (!) +the frequency of topups has
to be limited to 1 per second.
+updating the "lock" subscriber prior to editing or viewing
it in the panel UI was added.
+topup cash and topup voucher panel UI added
+when aquiring multiple contract row locks at once, no
joined tables are used any mure. the number of row locks
is therefore minimal now (see ticket 14903)
+rework of updating prepaid subscriber preference
Change-Id: Ideb0fec2404ca10b3ac5d8735f53620d0c3a24ed
previously all primary numbers have been filtered out.
This is wrong, if the number has been the primary number
of a previous (terminated) subscriber.
Change-Id: Iebbd96898715d86bfd10ac6d2d084c46de08def6
get it directly without accessing provisioning.voip_subscriber
and notify about terminated subscribers
Change-Id: Ife6d936c052b3dcda0f03013ee53bafa34b9f19b
If no primary number is given but a number range is provided, use
the first of the range as primary number.
Change-Id: I9b3a7bf1d4b1523f9cd0af3a3a7a70c95bb8d3ab
This makes it backwards-compatible to ossbss. At some point, the
timezone should be taken from the customer or domain, but that would
need to affect also CDRs etc.
Load the AVPs from the same subscriber as for caller, as we should
not intermix them anyways.
Treat non-existent vars as empty vars like kamailio does.
- Migrate from custom subscriber struct to normal resultset.
- Properly handle boolean input in form processing (convert to
int, otherwise formhandler fails while cloning when doing the
processing).
- Properly handle profile set editing in API
- Cleanup of log messages
Printing a hash with Data::Printer causes at least the API to not
return the hash, and back-porting libclone-perl to wheezy to fix it
caused the whole panel to get stuck.
A subadmin can use the field alias_select to select any number of alias
numbers, which he is allowed to manage. If he selects one, it moves
to this subscribers alias_numbers. If he unselects one, it moves to his
own alias numbers.
Don't try to insert a number into billing.voip_numbers directly,
rather than using the update_subscriber_numbers helper, which
handles the re-using of free numbers.
Now also handle alias numbers with the outsourced subroutine
update_subscriber_numbers.
Plus remove some leftovers which are already handled by
this sub.
Actually use update_subscriber_numbers when updating a subscriber
and not only when creating one. Also handle all neccessary side effects.
Now we can switch our primary number to a number which has been
inactive (that is: did not belong to a subscriber) without an update error.
Outsource the handling of the primary number from
the subscriber controller to a util sub called
update_subscriber_numbers.
It also takes care to reuse a number that has
subscriber_id set to NULL which caused the original
problem in the ticket.