← Back to team overview

wikipbx-dev team mailing list archive

Re: [RFC] Add ability to filter dialing extensions by caller id number

 

Il 22/10/2010 09:56, Stas Shtin ha scritto:
On 21.10.2010 11:59, Riccardo Magliocchetti wrote:
Hello,

Hi,

i think it would be handy to be able to have extensions that can be
dialed only by some caller id number. What do you think?

You need to add a callerid_num to wikipbxweb_extension:

alter table "wikipbxweb_extension" add column "callerid_num" varchar(75);
This feature looks good, but the implementation can be improved. Instead
of generating conditions in IVR file and sending it to freeswitch, we
can eliminate extensions for caller IDs that won't be matched when
building dialplan.

I've added caller ID number filtering, but didn't do much testing
besides checking GUI yet, so please make sure that it works.

It doesn't work here:

Error generating dialplan: list index out of range
Traceback (most recent call last):
  File "./wikipbx/wikipbxweb/views.py", line 1500, in xml_dialplan
    raw_xml = xmlconfig.dialplan_entry(request)
  File "./wikipbx/xmlconfig.py", line 126, in dialplan_entry
    account, dest_num, caller_id)
  File "./wikipbx/dialplanbuilder.py", line 104, in find_extension
    match_data[0].append(dest_num)
IndexError: list index out of range

match_data = [] * 2

does not look to work like you want to, instead

match_data = [[], []]

works fine though.


BTW, when we are adding south as dependency? :)

That would probably happen once we'll decide that we don't need to
change anything in DB before 0.9 release. Of course it's possible to add
it earlier, but I'm interested in using it in first place for migrating
between releases.

It looks like you want to distribute the migration file with updates, i think instead you should let the user do the schema migration when upgrading. This way they won't have issues if they have customized models. And you can use south everytime you need to change models.
At work I usually put migrations directory under stuff ignored by dvcs.

thanks,
riccardo



Follow ups

References