[Freeswitch-users] Strange xml_curl behavior. Can't see more than 7 variables on POST

Muhammad Naseer Bhatti nbhatti at gmail.com
Tue Dec 16 19:31:03 MSK 2014


Since I am using nginx to serve the requests, it turns out to be ngx.req.get_post_args() takes a limited number of arguments in the body by default. 100 to be exact by default. If I change the value to a larger number, I am able to see all the variables in POST.

ngx.req.read_body()
local XML_REQUEST = ngx.req.get_post_args(1000)

for k, v in pairs (XML_REQUEST) do
  if (k:match('variable')) then
    log.debug ('['..k .. '] : [' .. v..']')
  end
end

Solved.. 

-- 
Muhammad Naseer Bhatti

From: Muhammad Naseer Bhatti <nbhatti at gmail.com>
Reply: Muhammad Naseer Bhatti <nbhatti at gmail.com>>
Date: December 16, 2014 at 6:26:21 PM
To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>>, Brian West <brian at freeswitch.org>>
Subject:  Re: [Freeswitch-users] Strange xml_curl behavior. Can't see more than 7 variables on POST  


No, it’s the same with or without cacheable set to 0 or anything else. Here is the list of all variables I can see, https://pastebin.freeswitch.org/23740
 
-- 
Muhammad Naseer Bhatti
Sent with Airmail

From: Brian West <brian at freeswitch.org>
Reply: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>>
Date: December 16, 2014 at 6:20:48 PM
To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>>
Subject:  Re: [Freeswitch-users] Strange xml_curl behavior. Can't see more than 7 variables on POST

Does it behave differently without the cacheable tag?

On Tue, Dec 16, 2014 at 9:01 AM, Muhammad Naseer Bhatti <nbhatti at gmail.com> wrote:

Forgot to mention that I am also pulling up dialplan configuration from xml_curl. I am seeing all the variables when request for a dialplan.


Sent with Unibox

On Dec 16, 2014, at 5:57 PM, Muhammad Naseer Bhatti <nbhatti at gmail.com> wrote:

I am using xml_curl to generate all config dynamically and this is getting very strange, my directory looks like this, 

<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<document type='freeswitch/xml'>
 <section name='directory'>
  <domain name='10.211.55.26'>
  <user id='9401404' cacheable='2000'>
  <params>
  <param name='a1-hash' value='3c66e98d4b174b42d3e17669b59165c9'/>
  <param name='max-registrations-per-extension' value='1'/>
  <param name='allow-empty-password' value='false'/>
  <param name='sip-force-expires' value='180'/>
  </params>
  <variables>
  <variable name='customer_id' value='98765'/>
  <variable name='effective_caller_id_name' value='Mr Bhatti'/>
  <variable name='effective_caller_id_number' value='9401404'/>
  <variable name='debug_call' value='0'/>
  <variable name='debug_sql' value='0'/>
  <variable name='user_context' value='vbilling'/>
  <variable name='hangup_after_bridge' value='true'/>
  <variable name='xbypass' value='google'/>
  <variable name='account_type_02' value='pre'/>
  <variable name='account_type_03' value='pre'/>
  <variable name='account_type' value='pre'/>
  </variables>
  </user>
  </domain>
 </section>
</document>

The directory is working fine and user is able to login. I have a bunch of variables defined here. When I look at the POST on the web server, I am only able to see first 7 variable no matter what their names are. If I change order for example account_typewhich is last variable, and make it on top, it shows there in the XML_REQUEST but then hangup_after_bridgegoes away. I see only first 7. Are there any limitation on what channel variables can be POSTed to the web server or am I missing something here. 

-- 
Muhammad Naseer Bhatti

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


--
Brian West
brian at freeswitch.org



Twitter: @FreeSWITCH , @briankwest
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

T:+19184209001 | F:+19184209002 | M:+1918424WEST (9378)
iNUM:+883 5100 1420 9001 | ISN:410*543 | Skype:briankwest

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20141216/0864f7c0/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list