Table lookups in a dialplan - is using mod_blacklist appropriate or too much of a hack?
I was thinking of using mod_blacklist as a way to define a table of short extension numbers to be able to "look up" an entry in a dialplan condition. i.e. defining a blacklist "local_ext_but_not_freeswitch" - or for distinguishing easily between sip and skinny phones (is_sip_ext, is_skinny_ext). Does this seem like a useful use of the (somewhat misnamed) mod_blacklist, or a bad approach? Reason for this is that I'll have approximately 1600 extensions, discontiguous - some of which will be on freeswitch, others which won't. For the ones that are on freeswitch, some of them will be on skinny phones, and others will be on SIP phones. I was leaning toward something like: <extension name="Local Ext Check"> <condition field="${blacklist(check is_local_ext $1)}" expression="^true$"> <condition field="destination_number" expression="^(\d\d\d\d)$"> </condition> </condition> </extension> The alternative was to build a new module very similar to mod_blacklist - i.e. 'mod_lookup', with the additional capability of having a value lookup and not just existence check. I realize I could rig something up with mod_hash, but I like the 'load straight from a file' capability. Thoughts? -- Nathan ------------------------------------------------------------ Nathan Neulinger nneul@mst.edu Missouri S&T Information Technology (573) 612-1412 System Administrator - Architect
I use: mod_odbc_query <http://wiki.freeswitch.org/wiki/Mod_odbc_query> to query SQL directly in the dialplan -- it's from the contrib repository. Then you could store a bunch of information about each number and you get each one as a channel variable. -Avi On Mon, Mar 18, 2013 at 10:49 PM, Nathan Neulinger <nneul@mst.edu> wrote:
I was thinking of using mod_blacklist as a way to define a table of short extension numbers to be able to "look up" an entry in a dialplan condition. i.e. defining a blacklist "local_ext_but_not_freeswitch" - or for distinguishing easily between sip and skinny phones (is_sip_ext, is_skinny_ext).
Does this seem like a useful use of the (somewhat misnamed) mod_blacklist, or a bad approach?
Reason for this is that I'll have approximately 1600 extensions, discontiguous - some of which will be on freeswitch, others which won't. For the ones that are on freeswitch, some of them will be on skinny phones, and others will be on SIP phones.
I was leaning toward something like:
<extension name="Local Ext Check"> <condition field="${blacklist(check is_local_ext $1)}" expression="^true$"> <condition field="destination_number" expression="^(\d\d\d\d)$">
</condition> </condition> </extension>
The alternative was to build a new module very similar to mod_blacklist - i.e. 'mod_lookup', with the additional capability of having a value lookup and not just existence check.
I realize I could rig something up with mod_hash, but I like the 'load straight from a file' capability.
Thoughts?
-- Nathan
------------------------------------------------------------ Nathan Neulinger nneul@mst.edu Missouri S&T Information Technology (573) 612-1412 System Administrator - Architect
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: 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 http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Yeah, considered that... trying to have the core of my dialplan be as 'static' as possible to avoid runtime dependencies on other services. Moving from a very stable CCM implementation and looking at freeswitch as an alternative to full outsourcing - so wanting to avoid as many possible points of failure as I can. -- Nathan On 03/18/2013 03:58 PM, Avi Marcus wrote:
I use: mod_odbc_query <http://wiki.freeswitch.org/wiki/Mod_odbc_query> to query SQL directly in the dialplan -- it's from the contrib repository. Then you could store a bunch of information about each number and you get each one as a channel variable.
-Avi
On Mon, Mar 18, 2013 at 10:49 PM, Nathan Neulinger <nneul@mst.edu <mailto:nneul@mst.edu>> wrote:
I was thinking of using mod_blacklist as a way to define a table of short extension numbers to be able to "look up" an entry in a dialplan condition. i.e. defining a blacklist "local_ext_but_not_freeswitch" - or for distinguishing easily between sip and skinny phones (is_sip_ext, is_skinny_ext).
Does this seem like a useful use of the (somewhat misnamed) mod_blacklist, or a bad approach?
Reason for this is that I'll have approximately 1600 extensions, discontiguous - some of which will be on freeswitch, others which won't. For the ones that are on freeswitch, some of them will be on skinny phones, and others will be on SIP phones.
I was leaning toward something like:
<extension name="Local Ext Check"> <condition field="${blacklist(check is_local_ext $1)}" expression="^true$"> <condition field="destination_number" expression="^(\d\d\d\d)$">
</condition> </condition> </extension>
The alternative was to build a new module very similar to mod_blacklist - i.e. 'mod_lookup', with the additional capability of having a value lookup and not just existence check.
I realize I could rig something up with mod_hash, but I like the 'load straight from a file' capability.
Thoughts?
-- Nathan
------------------------------------------------------------ Nathan Neulinger nneul@mst.edu <mailto:nneul@mst.edu> Missouri S&T Information Technology (573) 612-1412 <tel:%28573%29%20612-1412> System Administrator - Architect
_________________________________________________________________________ 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
-- ------------------------------------------------------------ Nathan Neulinger nneul@mst.edu Missouri S&T Information Technology (573) 612-1412 System Administrator - Architect
participants (2)
-
Avi Marcus
-
Nathan Neulinger