execute function of openERP in jmeter - jmeter

I would like to do load testing in openerp using jmeter, i tried the login function by the below code:
<?xml version="1.0"?>
<methodCall>
<methodName>login</methodName>
<params>
<param>
<value>db</value>
</param>
<param>
<value>admin</value>
</param>
<param>
<value>admin</value>
</param>
</params>
but i couldn't be able to run the execute function to read res.partner:
<?xml version="1.0"?>
<methodCall>
<methodName>execute</methodName>
<params>
<param>
<value><string>db</string></value>
</param>
<param>
<value>admin</value>
</param>
<param>
<value><string>res.partner</string></value>
</param>
<param>
<value><string>read</string></value>
</param>
<param>
<array>
<data> <int>1</int> </data>
<data> <int>2</int></data>
</array>
</param>
<param>
<array>
<data> <string>name</string> </data>
<data> <string>title</string> </data>
</array>
</param>
</params>
</methodCall>
Anyone could direct me in this.
Thanks

You're missing the user's password in the call to read res.partner. If you add it after the user id, it should work.
You might find this client class helpful as a reference for all the parameters that the different OpenERP RPC calls require.

Related

How to enable AppleScript between Parent and Child applications within sandbox for Mac App Store?

I have a parent app that contains a child app in the bundle. The child app uses applescript to trigger some events in the parent app.
Now that I'm preparing for App Store I have sandboxed the apps and I am missing something with either the entitlements or property lists that I don't understand.
In the parent app I have defined the .sdef and I can dump it with sdef /Applications/Parent.app once installed from TestFlight and I see:
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd">
<dictionary title="Parent">
<suite name="Parent Suite" code="prnt" description="Parent Scripts">
<command name="is_first_run" code="prntisfr" description="Is this the first time running the app?">
<cocoa class="MyScriptInterface"/>
</command>
<command name="activation_complete" code="prntWRac" description="Activation is complete">
<cocoa class="MyScriptInterface"/>
</command>
<command name="sign_out" code="prntWRso" description="Sign out and delete local credentials">
<cocoa class="MyScriptInterface"/>
</command>
<command name="get_version" code="prntgetv">
<cocoa class="MyScriptInterface"/>
<direct-parameter type="text" description="None"/>
<result type="text"/>
</command>
</suite>
In the parent app I have the following included in the .plist:
<key>NSAppleEventsUsageDescription</key>
<string>AppleEvents needed to communicate between components</string>
<key>NSAppleScriptEnabled</key>
<true/>
<key>OSAScriptingDefinition</key>
<string>Parent.sdef</string>
In the Parent entitlements I include the following key parts:
<key>com.apple.security.automation.apple-events</key>
<true/>
<key>com.apple.security.scripting-targets</key>
<dict>
<key>com.foo.parent</key>
<array>
<string>com.foo.parent.is_first_run</string>
<string>com.foo.parent.activation_complete</string>
<string>com.foo.parent.sign_out</string>
<string>com.foo.parent.get_version</string>
</array>
<key>com.foo.parent.child</key>
<array>
<string>com.foo.parent.is_first_run</string>
<string>com.foo.parent.activation_complete</string>
<string>com.foo.parent.sign_out</string>
<string>com.foo.parent.get_version</string>
</array>
</dict>
In the Child app I have only this key:
<key>NSAppleScriptEnabled</key>
<true/>
And in the Child entitlements I have only this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.inherit</key>
<true/>
I am not understanding something. When I install the app and watch Console output I see a combination of errors:
For the Parent app:
AppleEvents/sandbox: Returning errAEPrivilegeError/-10004 and denying dispatch of event prnt/isfr from process '<private>'/0x0-0x7dccdc5, pid=95806, because it is not entitled to send an AppleEvent to this process.
I feel it's telling me that my Child app needs to be whitelisted somehow? I thought I was explicitly already doing that.
For the Child app from sandboxd:
Violation: deny(1) appleevent-send com.apple.systemevents
MetaData: {"platform-binary":false,"build":"macOS 12.3.1 (21E258)","sandbox_checker":"appleeventsd","process-path":"\/Applications\/Parent.app\/Contents\/MacOS\/Child.app\/Contents\/MacOS\/Child","profile-in-collection":false,"platform_binary":"no","primary-filter-value":"com.apple.systemevents","primary-filter":"appleevent-destination","checker":"appleeventsd","platform-policy":false,"policy-description":"Sandbox","summary":"deny(1) appleevent-send com.apple.systemevents","binary-in-trust-cache":false,"responsible-process-team-id":"367******2","target":"com.apple.systemevents","hardware":"Mac","pid":95806,"appleevent-destination":"com.apple.systemevents","flags":5,"responsible-process-signing-id":"com.foo.parent","apple-internal":false,"normalized_target":["com.apple.systemevents"],"checker-pid":359,"profile-flags":0,"operation":"appleevent-send","errno":1,"action":"deny","uid":501,"responsible-process-path":"\/Applications\/Parent.app\/Contents\/MacOS\/Parent","signing-id":"com.foo.parent.child","team-id":"367******2","container":"\/Users\/spartygw\/Library\/Containers\/com.foo.parent\/Data","process":"Child","release-type":"User"}
For completeness, I am attempting to execute applescript from Child.app like this:
NSDictionary* errorDict;
NSAppleScript* scriptObject = [[NSAppleScript alloc] initWithSource: #"tell application id \"com.foo.parent\" to sign_out"];
NSAppleEventDescriptor* returnDescriptor = [scriptObject executeAndReturnError: &errorDict];
References:
Apple: Enabling Scripting of Other Apps
Related stack question

Play an ivr based on hangup cause

Is there anyway to play an ivr based on Hangupcause ?
Right now i have tried below dialplan but seems like its not working.
So please suggest if there is any other way i can achieve it.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="dialplan" description="Custom_dialplan">
<context name="default">
<extension name="123456">
<condition field="destination_number" expression="123456">
<action application="set" data="effective_destination_number=123456"/>
<action application="set" data="transfer_on_fail=RECOVERY_ON_TIMER_EXPIRE auto_cause xml error"/>
<action application="bridge" data="sofia/gateway/Dummy_Gateway/123456"/>
<action application="log" data="AFTER BRIDGE"/>
</condition>
</extension>
</context>
<context name=error">
<action application="log" data="AFTER BRIDGE2"/>
<extension name="RECOVERY_ON_TIMER_EXPIRE" continue="true">
<action application="log" data="AFTER BRIDGE3"/>
<condition field="${originate_disposition}" expression="RECOVERY_ON_TIMER_EXPIRE" continue="false" break="on-true">
<action application="log" data="AFTER BRIDGE4"/>
<action application="playback" data="/usr/local/freeswitch/sounds/en/us/callie/notinservice.wav"/>
</condition>
</extension>
</context>
</section>
</document>
Definitely, you have done few mistakes in your dialplan while it is significant:
Before use transfer_on_fail you should set up another obligatory options follows:
<action application="set" data="continue_on_fail=true"/>
<action application="set" data="failure_causes=RECOVERY_ON_TIMER_EXPIRE"/>
To remove that logging option BRIDGE due to it's useless and it will never be handled.
I would like to draw your attention the dialplan has strict structure, so you can't insert options/actions wherever you want. First of all, you should remove all logging from the context ERROR
-- The sequence is going to be: context -> extension --> condition --> action (s). Thus you have setup the condition follows with the action playing announcement.
--!-- You have taken call handling in your hands, so please manage the process. After your platform had played to leg A you have to instruct FreeSWITCH terminating the call (it must follow "playback"):
<action application="hangup" data="NORMAL_CLEARING"/>
However, I assume your dialplan won't work ever because RECOVERY_ON_TIMER_EXPIRE is the status of Freeswitch State Machine which appear when SIP 408. You should use Q.850 hangup cause in dialplan instead, so try replacing it with NO_USER_RESPONSE.
You may find Q.850 hangup cause table here

Access gateway/profile params/variables in Freeswitch

To get variables from a user we call user_data(user var variable_name).
<include>
<user id="1000">
<variables>
<variable name="custom_variable" value="test"/>
</variables>
</user>
</include>
We call in a way like that:
<action application="set" data="variable_name=${user_data(${caller_id_number}#${domain_name} var custom_variable)}"/>
But how to do the same with a gateway?
<include>
<gateway name="custom_gateway">
<param name="custom_param" value="test"/>
</gateway>
</include>
I think it is not possible.
FS application set is 'Set a channel variable for the channel calling the application' while gateway data is somewhere in the sofia module. However, there is a way to list gateway data from console. Have a look at sofia_gateway_data_function in the source code, hope it sheds some light on what you need to do. Good luck!

Outbound calls using freeswitch

This is my external sip_profile:
<gateway name="outbound">
<param name="realm" value="10.0.1.5:5062"/>
<param name="username" value="1001"/>
<param name="password" value="1234"/>
<param name="dtmf-type" value="rfc2833"/>
<param name="expire-seconds" value="600"/>
<param name="register" value="false"/>
<param name="caller-id-in-from" value="false"/>
</gateway>
and my dialplan is as such:
<extension name="outbound_pstn">
<condition field="destination_number" expression="^(.*)$">
<action application="set" data="effective_caller_id_number=${outbound_caller_id_number}"/>
<action application="bridge" data="sofia/gateway/outbound/$1"/>
</condition>
</extension>
I am using the HT503 as my ATA. Freeswitch is running on the IP 10.0.1.5 and ATA is at 10.0.1.9
I can't seem to be able to make an outbound call. What am I doing wrong?
realm should be the address of the remote side, and in your example it's set to freeswitch'es local address
If you want to connect Freeswitch to another PBX/switch you should set:
<param name="register" value="true"/>
for PSTN registration is not required. Use something like this:
<include>
<gateway name="sipmarket">
<param name="username" value="user1"/>
<param name="realm" value="sipmarket.net"/>
<param name="from-user" value="user1"/>
<param name="from-domain" value="sipmarket.net"/>
<param name="password" value="strong_password"/>
<param name="expire-seconds" value="300"/>
<param name="register" value="true"/>
<param name="register-transport" value="udp"/>
</gateway>
</include>
You should check out http://wiki.freeswitch.org/wiki/Main_Page and look for the outbound gateway pages. You don't have to define realm, unless you want to.
You need to have the gateway actually register to a SIP provider to make calls as well.
If you digit
sofia status gateways
can you see your gateway "outbound"? Otherwise you have to digit:
sofia profile external rescan
if you put your gateways under external sip profile.

Why wont my log4net log entries show up in Chainsaw on Windows 7

I'm trying to get log4net to log via udp to chainsaw but its not working on windows 7. My config files are as follows:
<log4net debug="true">
<appender name="trace" type="log4net.Appender.TraceAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
</layout>
</appender>
<appender name="UdpAppender" type="log4net.Appender.UdpAppender">
<remoteAddress value="127.0.0.1" />
<remotePort value="8085" />
<layout type="log4net.Layout.XmlLayoutSchemaLog4j">
<locationInfo value="true" />
</layout>
</appender>
<root>
<level value="TRACE" />
<appender-ref ref="trace" />
<appender-ref ref="UdpAppender" />
</root>
my chainsaw config file looks like this:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
<plugin name="UDPReceiver" class="org.apache.log4j.net.UDPReceiver">
<param name="Port" value="8085" />
</plugin>
</log4j:configuration>
All of this is per the documentation found in: http://logging.apache.org/log4net/release/howto/chainsaw.html
Yet none of the logs show up.
Figured it out. Looks like log4net has issues with ipv6 and windows 7. To get around these issues you need to add an entry into your host file that looks like this:
127.0.0.2 localhosttwo
then your UpdAppender needs to reference that DNS entry as so:
<remoteAddress value="localhosttwo" />
127.0.0.2 is the ipv6 address for your localmachine and you need an explcit dns entry or else log4net will throw an error if you try and use the numerical address in the config file.
Make sure to flush your dns after you change the hostfile

Resources