Check user state in dialplan
Hi, I need to perform different actions in response to the following conditions: * The called number is not exists in the directory (check id and number-alias) * The called number is known, but not registered * The called number is busy * The called number is not answered due timeout * The called number is answered In the first case I need to send the call through a particular gateway, in the next two cases I need to play a file, in two remaining cases I need to call user and play a file only on timeout. What is the right to do it in the dialplan? -- Regards, Eugene Prokopiev
Are you planning on using mod_xml_curl for this? Just curious. In any event, the example configuration has conf/dialplan/default.xml with "Local_Extension" entry that handles all of these except for the first case. However, I have to ask - what is wrong with the default way that FS handles unknown numbers? -MC On Sat, Nov 10, 2012 at 11:02 AM, Eugene Prokopiev < eugene.prokopiev@gmail.com> wrote:
Hi,
I need to perform different actions in response to the following conditions:
* The called number is not exists in the directory (check id and number-alias) * The called number is known, but not registered * The called number is busy * The called number is not answered due timeout * The called number is answered
In the first case I need to send the call through a particular gateway, in the next two cases I need to play a file, in two remaining cases I need to call user and play a file only on timeout.
What is the right to do it in the dialplan?
-- Regards, Eugene Prokopiev
_________________________________________________________________________ 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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
Hi, With "Local_Extension" I can't distinguish all cases, I can distinguish only successful or failed answer. About first case: I have no sequential numbers for local users and can't describe range as regex. So, the best way to identify if local user exists is to search id (and number-alias) in directory. I know about mod_xml_curl which can be used for filling dialplan and directory from some database, but I tried to find more simple way. -- Regards, Eugene Prokopiev
Which case(s) are not handled by Local_Extension, other than user not in the directory? Also, if you use the "user/xxxx" dialstring format you'll get different errors depending on whether or not the user exists in the database: freeswitch@default> originate user/1000 9664 -ERR USER_NOT_REGISTERED freeswitch@default> originate user/1900 9664 -ERR SUBSCRIBER_ABSENT User 1000 exists in the database but is not registered. User 1900 does not exist at all. In the case of a bridge app you can use chan var continue_on_fail=true and then check bridge_hangup_cause to determine what happened on the bridge attempt. I'm pretty sure you can then handle all of your scenarios. -MC On Mon, Nov 12, 2012 at 8:09 PM, Eugene Prokopiev <enp@itx.ru> wrote:
Hi,
With "Local_Extension" I can't distinguish all cases, I can distinguish only successful or failed answer.
About first case: I have no sequential numbers for local users and can't describe range as regex. So, the best way to identify if local user exists is to search id (and number-alias) in directory. I know about mod_xml_curl which can be used for filling dialplan and directory from some database, but I tried to find more simple way.
-- Regards, Eugene Prokopiev
_________________________________________________________________________ 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
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
participants (3)
-
Eugene Prokopiev
-
Eugene Prokopiev
-
Michael Collins