Retrieve Callee User Variables in Dialplan
Dear all, I have been looking through the documentation and the forum but could not find what I was looking for. Basically, I was wondering if it is possible, that when somebody calls an internal number, in the dialplan I retrieve a variable associated with the user of the called number and then evaluate conditions according to the contents of that variable. Just as an example, let's assume I have a user in the directory with the following entry: <include> <user id="1000" mailbox="1000"> <params> .... </params> <variables> <variable name="some_name" value="some_value"/> .... </variables> </user> </include> Now, if somebody calls extension 1000, when evaluating the extension in the dialplan, I would like to be able to retrieve the variable "some_name" of the user with extension 1000 (i.e., the callee) and then take some action depending on the value "some_value" of that variable. Is there a mechanism to do that, or am I trying to do something the wrong way? Basically what I would like to do is be able to add a variable to a user and then, when that user is called, take different action depending on the value of that user. Thanks a lot. Regards, Roman -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Retrieve-Callee-User-Variables... Sent from the freeswitch-users mailing list archive at Nabble.com.
http://wiki.freeswitch.org/wiki/Mod_commands#user_data On Fri, Jul 16, 2010 at 7:50 AM, Roman_ <lists@ione.ch> wrote:
Dear all,
I have been looking through the documentation and the forum but could not find what I was looking for.
Basically, I was wondering if it is possible, that when somebody calls an internal number, in the dialplan I retrieve a variable associated with the user of the called number and then evaluate conditions according to the contents of that variable.
Just as an example, let's assume I have a user in the directory with the following entry:
<include> <user id="1000" mailbox="1000"> <params> .... </params> <variables> <variable name="some_name" value="some_value"/> .... </variables> </user> </include>
Now, if somebody calls extension 1000, when evaluating the extension in the dialplan, I would like to be able to retrieve the variable "some_name" of the user with extension 1000 (i.e., the callee) and then take some action depending on the value "some_value" of that variable.
Is there a mechanism to do that, or am I trying to do something the wrong way? Basically what I would like to do is be able to add a variable to a user and then, when that user is called, take different action depending on the value of that user.
Thanks a lot.
Regards,
Roman
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/Retrieve-Callee-User-Variables... Sent from the freeswitch-users mailing list archive at Nabble.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
-- -Rupa
<action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/> /b On Jul 16, 2010, at 9:53 AM, Rupa Schomaker wrote:
Hi, sorry for riding on to this thread for my query, I am trying something similar: in case the ${dialed_extension} is bridging to two endpoints, how do i retrieve a var depending upon which user answered the call? Retrieve the var or in fact take *any* action such as make a db insert depending upon who answered. Do I use exec_on_answer and export/set a variable that identifies the user who answered? If yes, what variable? thanks gsin On Fri, Jul 16, 2010 at 8:37 PM, Brian West <brian@freeswitch.org> wrote:
<action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/>
/b
On Jul 16, 2010, at 9:53 AM, Rupa Schomaker wrote:
_______________________________________________ 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
how about you state what you're trying to accomplish instead of trying to tell us how you think you should be doing it... then we can tell you a better way of doing it. /b On Jul 16, 2010, at 1:43 PM, guru singh wrote:
Hi,
sorry for riding on to this thread for my query,
I am trying something similar: in case the ${dialed_extension} is bridging to two endpoints, how do i retrieve a var depending upon which user answered the call? Retrieve the var or in fact take *any* action such as make a db insert depending upon who answered. Do I use exec_on_answer and export/set a variable that identifies the user who answered? If yes, what variable?
thanks gsin
My bad, Here's what I'm trying. An extension bridges a call to two endpoints, depending upon who answers I wanna make a db entry like insert/some_realm/${caller_id_number}/${answered_by}. So that the next time I receive a call from the same number, I can select/some_realm/${caller_id_number} and bridge the call just to the endpoint that had answered the first call made by this number. thanks gsin On Sat, Jul 17, 2010 at 12:20 AM, Brian West <brian@freeswitch.org> wrote:
how about you state what you're trying to accomplish instead of trying to tell us how you think you should be doing it... then we can tell you a better way of doing it.
/b
On Jul 16, 2010, at 1:43 PM, guru singh wrote:
Hi,
sorry for riding on to this thread for my query,
I am trying something similar: in case the ${dialed_extension} is bridging to two endpoints, how do i retrieve a var depending upon which user answered the call? Retrieve the var or in fact take *any* action such as make a db insert depending upon who answered. Do I use exec_on_answer and export/set a variable that identifies the user who answered? If yes, what variable?
thanks gsin
_______________________________________________ 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
participants (4)
-
Brian West
-
guru singh
-
Roman_
-
Rupa Schomaker