Setting channel variables using event socket
Hi, I am struggling with the task of setting a channel variable through an event socket. It seems no matter what I do, FS will not overwrite the existing variable. What I have tried so far: *API* *Send:* api uuid_setvar ZWVlZDUwMTUyNjdjNWU4ZTBmZWY4NTQ1ZDA2NmJiYWI privacy_hide_number=true<cr><cr> *Reply:* Content-Type: api/response Content-Length: 4 +OK As You see, FS replies with +OK. But the variable is unchanged. SET, part one *Send:* sendmsg YjJjNzJlOTQ0YWE1N2I2MGVlYTAwMzI2NWFjMmY4ZjM execute-app-name: set execute-app-arg: Caller-Privacy-Hide-Number=true call-command: execute *Part of received headers (JSON output):* ... { name: 'Caller-Privacy-Hide-Number', value: 'false' }, ... { name: 'variable_Caller-Privacy-Hide-Number', value: 'true' } ... Variable is not overwritten. Instead a new "variable_" is created. SET, part two *Send:* sendmsg NmJmZWU5YzMwYTlkMTk2MDg0ZmIzZmQwMTFiMTFkMmM execute-app-name: set execute-app-arg: privacy_hide_number=true call-command: execute *Part of received headers (JSON output):* ... { name: 'Caller-Privacy-Hide-Number', value: 'false' }, ... { name: 'variable_privacy_hide_number', value: 'true' } ... Again, variable is not overwritten. Instead a new "variable_" is created. Can it really be true this is not possible? FreeSWITCH Version 1.2.16+git~20131218T195141Z~6968ef88fa~64bit (git 6968ef8 2013-12-18 19:51:41Z 64bit). Best regards, *Kenn Leth Hansen* *M.Sc. Engineering, Telecommunications SIP Service Developer*
Caller profile fields are set when the channel is created and can't be changed by the set application. It also wouldn't make any sense to change as this profile field is used to let you know whether or not the calling party is requesting from you to hide the caller ID. If your intention is to hider caller id on outbound calls you should set the origination_caller_id_number variable. see http://wiki.freeswitch.org/wiki/Cid On Tue, Jan 28, 2014 at 5:30 AM, Kenn Leth Hansen <klh@justfone.dk> wrote:
Hi,
I am struggling with the task of setting a channel variable through an event socket. It seems no matter what I do, FS will not overwrite the existing variable.
What I have tried so far:
*API* *Send:* api uuid_setvar ZWVlZDUwMTUyNjdjNWU4ZTBmZWY4NTQ1ZDA2NmJiYWI privacy_hide_number=true<cr><cr>
*Reply:* Content-Type: api/response Content-Length: 4 +OK
As You see, FS replies with +OK. But the variable is unchanged.
SET, part one
*Send:*
sendmsg YjJjNzJlOTQ0YWE1N2I2MGVlYTAwMzI2NWFjMmY4ZjM execute-app-name: set execute-app-arg: Caller-Privacy-Hide-Number=true call-command: execute
*Part of received headers (JSON output):*
...
{ name: 'Caller-Privacy-Hide-Number', value: 'false' },
...
{ name: 'variable_Caller-Privacy-Hide-Number', value: 'true' }
...
Variable is not overwritten. Instead a new "variable_" is created.
SET, part two
*Send:*
sendmsg NmJmZWU5YzMwYTlkMTk2MDg0ZmIzZmQwMTFiMTFkMmM execute-app-name: set execute-app-arg: privacy_hide_number=true call-command: execute
*Part of received headers (JSON output):*
...
{ name: 'Caller-Privacy-Hide-Number', value: 'false' },
...
{ name: 'variable_privacy_hide_number', value: 'true' }
...
Again, variable is not overwritten. Instead a new "variable_" is created.
Can it really be true this is not possible?
FreeSWITCH Version 1.2.16+git~20131218T195141Z~6968ef88fa~64bit (git 6968ef8 2013-12-18 19:51:41Z 64bit).
Best regards,
*Kenn Leth Hansen* *M.Sc. Engineering, Telecommunications SIP Service Developer*
_________________________________________________________________________ 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
That is because uuid_setvar is for setting variable_XX, The Caller-Privacy-Hide-Number is part of the caller profile. -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED) On Jan 28, 2014, at 9:07 AM, Duvid Rottenberg <adrottenberg@gmail.com> wrote:
... { name: 'Caller-Privacy-Hide-Number', value: 'false' }, ... { name: 'variable_Caller-Privacy-Hide-Number', value: 'true' }
That explains a lot :) It seems to be working as expected now. Thank you. On Tue, Jan 28, 2014 at 4:39 PM, Brian West <brian@freeswitch.org> wrote:
That is because uuid_setvar is for setting variable_XX, The Caller-Privacy-Hide-Number is part of the caller profile. -- Brian West brian@freeswitch.org FreeSWITCH Solutions, LLC PO BOX 2531 Brookfield, WI 53008-2531 Twitter: @FreeSWITCH , @briankwest http://www.freeswitchbook.com http://www.freeswitchcookbook.com
T: +1.918.420.9001 | F: +1.918.420.9002 | M: +1.918.424.WEST iNUM: +883 5100 1420 9001 ISN: 410*543 Skype:briankwest PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED)
On Jan 28, 2014, at 9:07 AM, Duvid Rottenberg <adrottenberg@gmail.com> wrote:
... { name: 'Caller-Privacy-Hide-Number', value: 'false' }, ... { name: 'variable_Caller-Privacy-Hide-Number', value: 'true' }
_________________________________________________________________________ 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
participants (3)
-
Brian West
-
Duvid Rottenberg
-
Kenn Leth Hansen