Freeswitch call intercerpt configuration - regex

I am trying to configure call intercept groups and I am having a hard time finding what is wrong with my config. When I dial the feature code to intercept *110(interceptgroup no) (in this case *110101) the dialplan doesn't match and fails. The hash is inserted successfully, I can see it in the cli via hash select/intercept_2/101. What am I missing here?
Here is my user config from directory/default.xml:
<user bluebox_id="3" id="1001">
<variables>
<variable name="internal_caller_id_number" value="1001"/>
<variable name="user_context" value="context_4"/>
<variable name="force_transfer_context" value="context_4"/>
<variable name="user_originated" value="true"/>
<variable name="toll_allow" value="domestic"/>
<variable name="accountcode" value="1001"/>
<variable name="callrecord_inbound" value="1"/>
<variable name="callrecord_outbound" value="1"/>
<variable name="interceptgroup" value="101"/>
</variables>
<params>
<param name="password" value="removed"/>
<param name="dial-string" value="{presence_id=${dialed_user}#${dialed_domain}}${sofia_contact(${dialed_user}#${dialed_domain})}"/>
</params>
</user>
<user bluebox_id="5" id="1238">
<variables>
<variable name="internal_caller_id_number" value="1238"/>
<variable name="user_context" value="context_4"/>
<variable name="force_transfer_context" value="context_4"/>
<variable name="user_originated" value="true"/>
<variable name="toll_allow" value="domestic"/>
<variable name="accountcode" value="1238"/>
<variable name="callrecord_inbound" value="1"/>
<variable name="callrecord_outbound" value="1"/>
<variable name="interceptgroup" value="101"/>
</variables>
<params>
<param name="password" value="removed"/>
<param name="dial-string" value="{presence_id=${dialed_user}#${dialed_domain}}${sofia_contact(${dialed_user}#${dialed_domain})}"/>
</params>
</user>
Here is my dialplan config from dialplan.xml:
<extension name="main_number_43" continue="true">
<condition field="destination_number" expression="^1238$">
<action application="hash" data="insert/intercept_2/101/${uuid}"/>
<action application="set" bluebox="settingTimeout" data="call_timeout=30"/>
<action application="set" bluebox="settingRing" data="ringback=${us-ring}"/>
<action application="set" bluebox="settingRingXfer" data="transfer_ringback=${us-ring}"/>
<action application="export" bluebox="sipCalleeIdName" data="sip_callee_id_name=linksys"/>
<action application="export" bluebox="sipCalleeIdNumber" data="sip_callee_id_number=1238"/>
<action application="bridge" data="user/1238#$${location_4}"/>
<action application="hangup"/>
</condition>
</extension>
<extension name="main_number_45" continue="true">
<condition field="${regex(m:/${destination_number}/^\*110([0-9]+)$/$1)}" expression="^${interceptgroup}$"/>
<condition field="destination_number" expression="^\*110([0-9]+)$">
<action application="answer"/>
<action application="set" data="intercept_unanswered_only=true"/>
<action application="intercept" data="${hash(select/intercept_2/$1)}"/>
<action application="sleep" data="2000"/>
<action application="hangup"/>
</condition>
</extension>

After some headache I discovered that you cannot prepend this particular feature code with a *, it causes freeswitch to parse the digits differently by separating the feature code itself (*110 in this case) from the digits you enter as an argument, which in this case is the intercept group number. Removing the * fixed it.
<extension name="main_number_45" continue="true">
<condition field="${regex(m:/${destination_number}/^\110([0-9]+)$/$1)}" expression="^${interceptgroup}$"/>
<condition field="destination_number" expression="^\110([0-9]+)$">
<action application="answer"/>
<action application="set" data="intercept_unanswered_only=true"/>
<action application="intercept" data="${hash(select/intercept_2/$1)}"/>
<action application="sleep" data="2000"/>
<action application="hangup"/>
</condition>
</extension>

Related

Unix domain Socket not working on Android 9 (API level 28)

I have two android apllication ( client and a server ) that are connected by Unix domain socket on the native level (C++/JNI). Both were built using target API level 27 and were working fine for years. Recently I have upgraded them to API level 28 and now I the client can't connect to the server the connect() function return -1 . If I just change all build dependencies to use lower API levels (<=27) it connects correctly. From what i've read on the behavior changes for Android 9 I don't really know what could cause such a thing. Here is the log that i get from logcat.
com.company.client I/TSOCKET: TSocket::open()
com.company.client I/TSOCKET: TSocket::unix_open()
com.company.client I/TSOCKET: TSocket::openConnection()
com.company.client I/TSOCKET: TSocket::setLinger()
com.company.client I/TSOCKET: TSocket::setNoDelay()
com.company.client I/TSOCKET: TSocket::structlen = static_cast<socklen_t>(sizeof(address)) 110
com.company.client I/TSOCKET: TSocket::openConnection() connect() return -1
I know that API 28 requests run time permissions, and both the service and the app request and get write, read, and internet runtime permissions.
My client manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.company.client"
android:versionCode="2"
android:versionName="5.1.0">
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_label"
tools:replace="android:label"
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"
android:networkSecurityConfig="#xml/network_security_config"
android:theme="#style/AppTheme" >
<activity
android:name="com.company.client.clientActivity"
android:label="#string/app_label"
android:configChanges="orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.google.zxing.client.android.CaptureActivity"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="landscape"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="com.google.zxing.client.android.SCAN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="ar.com.daidalos.afiledialog.FileChooserActivity" />
</application>
</manifest>
my server manifest
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.company.server"
android:versionCode="2"
android:versionName="5.1.0">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
<uses-permission android:name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.PERSISTENT_ACTIVITY" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.FILTER_EVENTS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<permission android:name="android.hardware.usb.host" />
<uses-feature
android:name="android.hardware.usb.host"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_label"
android:requestLegacyExternalStorage="true"
android:theme="#style/AppTheme">
<receiver android:name="com.company.server.autostart">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<activity
android:name="com.company.server.MainActivity"
android:label="#string/app_label"
android:launchMode="singleInstance"
android:theme="#android:style/Theme.Translucent.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".Service"
android:enabled="true"
android:exported="true"
android:isolatedProcess="false">
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
<action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" />
</intent-filter>
<meta-data
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="#xml/devices_filter" />
<meta-data
android:name="android.hardware.usb.action.USB_DEVICE_DETACHED"
android:resource="#xml/devices_filter" />
</service>
</application> </manifest>
how can I make the local socket connection to work?

RapidXML - Code creates unexpected result

I have the following XML
<ActionMaps version="1" optionsVersion="2" rebindVersion="2" profileName="full_export">
<CustomisationUIHeader label="full_export" description="" image="">
<devices>
<keyboard instance="1"/>
<mouse instance="1"/>
</devices>
<categories>
<category label="#ui_CCSpaceFlight"/>
<category label="#ui_CGLightControllerDesc"/>
<category label="#ui_CCFPS"/>
<category label="#ui_CCEVA"/>
<category label="#ui_CGOpticalTracking"/>
<category label="#ui_CGInteraction"/>
</categories>
</CustomisationUIHeader>
<options type="keyboard" instance="1" Product="Tastatur {6F1D2B61-D5A0-11CF-BFC7-444553540000}">
<flight_move_yaw exponent="1.5"/>
</options>
<modifiers />
<actionmap name="spaceship_general">
<action name="v_close_all_doors">
<rebind input="kb1_0"/>
</action>
<action name="v_cooler_throttle_down">
<rebind input="kb1_6"/>
</action>
<action name="v_cooler_throttle_up">
<rebind input="kb1_5"/>
</action>
<action name="v_eject">
<rebind input="kb1_1"/>
</action>
<action name="v_emergency_exit">
<rebind input="kb1_4"/>
</action>
<action name="v_exit">
<rebind input="kb1_2"/>
</action>
<action name="v_flightready">
<rebind input="kb1_7"/>
</action>
<action name="v_lock_all_doors">
<rebind input="kb1_equals"/>
</action>
<action name="v_open_all_doors">
<rebind input="kb1_9"/>
</action>
<action name="v_self_destruct">
<rebind input="kb1_3"/>
</action>
<action name="v_toggle_all_doorlocks">
<rebind input="kb1_minus"/>
</action>
<action name="v_toggle_all_doors">
<rebind input="kb1_8"/>
</action>
<action name="v_unlock_all_doors">
<rebind input="kb1_q"/>
</action>
</actionmap>
<actionmap name="spaceship_view">
<action name="v_view_cycle_fwd">
<rebind input="kb1_u"/>
</action>
<action name="v_view_dynamic_focus_in">
<rebind input="kb1_rbracket"/>
</action>
<action name="v_view_dynamic_focus_out">
<rebind input="kb1_a"/>
</action>
<action name="v_view_freelook_mode">
<rebind input="kb1_lbracket"/>
</action>
<action name="v_view_look_behind">
<rebind input="kb1_s"/>
</action>
<action name="v_view_mode">
<rebind input="kb1_i"/>
</action>
<action name="v_view_pitch_down">
<rebind input="kb1_t"/>
</action>
<action name="v_view_pitch_mouse">
<rebind input="mo1_ "/>
</action>
<action name="v_view_pitch_up">
<rebind input="kb1_r"/>
</action>
<action name="v_view_yaw_left">
<rebind input="kb1_w"/>
</action>
<action name="v_view_yaw_mouse">
<rebind input="mo1_ "/>
</action>
<action name="v_view_yaw_right">
<rebind input="kb1_e"/>
</action>
<action name="v_view_zoom_in">
<rebind defaultInput="mwheel_up" input="kb1_o"/>
</action>
<action name="v_view_zoom_out">
<rebind defaultInput="mwheel_down" input="kb1_p"/>
</action>
</actionmap>
<actionmap name="spaceship_movement">
<action name="v_accel_range_down">
<rebind input="kb1_v"/>
</action>
<action name="v_accel_range_up">
<rebind input="kb1_c"/>
</action>
<action name="v_afterburner">
<rebind input="kb1_down"/>
</action>
<action name="v_autoland">
<rebind input="kb1_pgup"/>
</action>
<action name="v_brake">
<rebind input="kb1_backslash"/>
</action>
<action name="v_ifcs_toggle_cruise_control">
<rebind input="kb1_left"/>
</action>
<action name="v_ifcs_toggle_esp">
<rebind input="kb1_rctrl"/>
</action>
<action name="v_ifcs_toggle_gforce_safety">
<rebind input="kb1_ralt"/>
</action>
<action name="v_ifcs_toggle_speed_limiter">
<rebind input="kb1_lalt"/>
</action>
<action name="v_ifcs_toggle_vector_decoupling">
<rebind input="kb1_b"/>
</action>
<action name="v_pitch_down">
<rebind input="kb1_f"/>
</action>
<action name="v_pitch_up">
<rebind input="kb1_d"/>
</action>
<action name="v_roll_left">
<rebind input="kb1_k"/>
</action>
<action name="v_roll_right">
<rebind input="kb1_l"/>
</action>
<action name="v_speed_range_down">
<rebind input="kb1_x"/>
</action>
<action name="v_speed_range_up">
<rebind input="kb1_z"/>
</action>
<action name="v_strafe_back">
<rebind input="kb1_rshift"/>
</action>
<action name="v_strafe_down">
<rebind input="kb1_m"/>
</action>
<action name="v_strafe_forward">
<rebind input="kb1_slash"/>
</action>
<action name="v_strafe_left">
<rebind input="kb1_comma"/>
</action>
<action name="v_strafe_longitudinal_invert">
<rebind input="kb1_lctrl"/>
</action>
<action name="v_strafe_right">
<rebind input="kb1_period"/>
</action>
<action name="v_strafe_up">
<rebind input="kb1_n"/>
</action>
<action name="v_target_match_vel">
<rebind input="kb1_apostrophe"/>
</action>
<action name="v_toggle_landing_system">
<rebind input="kb1_up"/>
</action>
<action name="v_toggle_qdrive_engagement">
<rebind input="kb1_insert"/>
</action>
<action name="v_toggle_qdrive_spooling">
<rebind input="kb1_pgdn"/>
</action>
<action name="v_toggle_relative_mouse_mode">
<rebind input="kb1_j"/>
</action>
<action name="v_toggle_vtol">
<rebind input="kb1_right"/>
</action>
<action name="v_toggle_yaw_roll_swap">
<rebind input="kb1_semicolon"/>
</action>
<action name="v_yaw_left">
<rebind input="kb1_g"/>
</action>
<action name="v_yaw_right">
<rebind input="kb1_h"/>
</action>
</actionmap>
<actionmap name="spaceship_targeting">
<action name="v_aim_pitch_down">
<rebind input="kb1_print"/>
</action>
<action name="v_aim_pitch_up">
<rebind input="kb1_home"/>
</action>
<action name="v_aim_yaw_left">
<rebind input="kb1_delete"/>
</action>
<action name="v_aim_yaw_right">
<rebind input="kb1_end"/>
</action>
<action name="v_enter_remote_turret_1">
<rebind input="kb1_lshift+1"/>
</action>
<action name="v_enter_remote_turret_2">
<rebind input="kb1_lshift+2"/>
</action>
<action name="v_enter_remote_turret_3">
<rebind input="kb1_lshift+3"/>
</action>
<action name="v_invoke_ping">
<rebind defaultInput="mouse2" input="kb1_np_enter"/>
</action>
<action name="v_look_ahead_enable">
<rebind input="kb1_scrolllock"/>
</action>
<action name="v_look_ahead_start_target_tracking">
<rebind input="kb1_pause"/>
</action>
<action name="v_target_cycle_all_back">
<rebind input="kb1_np_7"/>
</action>
<action name="v_target_cycle_all_fwd">
<rebind input="kb1_np_subtract"/>
</action>
<action name="v_target_cycle_friendly_fwd">
<rebind input="kb1_np_8"/>
</action>
<action name="v_target_cycle_hostile_back">
<rebind input="kb1_np_6"/>
</action>
<action name="v_target_cycle_hostile_fwd">
<rebind input="kb1_np_5"/>
</action>
<action name="v_target_cycle_pinned_back">
<rebind input="kb1_np_4"/>
</action>
<action name="v_target_cycle_pinned_fwd">
<rebind input="kb1_np_add"/>
</action>
<action name="v_target_cycle_reticle_mode">
<rebind input="kb1_np_period"/>
</action>
<action name="v_target_cycle_subitem_back">
<rebind input="kb1_np_3"/>
</action>
<action name="v_target_cycle_subitem_fwd">
<rebind input="kb1_np_2"/>
</action>
<action name="v_target_deselect_entity">
<rebind input="kb1_np_multiply"/>
</action>
<action name="v_target_focus_root_entity">
<rebind input="kb1_np_0"/>
</action>
<action name="v_target_nearest_hostile">
<rebind input="kb1_np_1"/>
</action>
<action name="v_target_reticle_focus">
<rebind input="kb1_np_divide"/>
</action>
<action name="v_target_toggle_pinned_focused">
<rebind input="kb1_np_9"/>
</action>
<action name="v_toggle_mouse_aim_only">
<rebind input="kb1_numlock"/>
</action>
</actionmap>
<actionmap name="spaceship_target_hailing">
<action name="v_target_hail">
<rebind input="kb1_lshift+8"/>
</action>
</actionmap>
<actionmap name="spaceship_scanning">
<action name="v_scanning_trigger_scan">
<rebind defaultInput="mouse1" input="kb1_lshift+5"/>
</action>
<action name="v_toggle_scan_mode">
<rebind input="kb1_lshift+4"/>
</action>
</actionmap>
<actionmap name="spaceship_ping">
<action name="v_dec_ping_focus_angle">
<rebind defaultInput="mwheel_down" input="kb1_lshift+7"/>
</action>
<action name="v_inc_ping_focus_angle">
<rebind defaultInput="mwheel_up" input="kb1_lshift+6"/>
</action>
</actionmap>
<actionmap name="spaceship_mining">
<action name="v_decrease_mining_throttle">
<rebind defaultInput="mwheel_down" input="kb1_lshift+q"/>
</action>
<action name="v_increase_mining_throttle">
<rebind defaultInput="mwheel_up" input="kb1_lshift+backspace"/>
</action>
<action name="v_toggle_mining_laser_fire">
<rebind defaultInput="mouse1" input="kb1_lshift+0"/>
</action>
<action name="v_toggle_mining_laser_type">
<rebind defaultInput="mouse2" input="kb1_lshift+equals"/>
</action>
<action name="v_toggle_mining_mode">
<rebind input="kb1_lshift+9"/>
</action>
</actionmap>
<actionmap name="spaceship_turret">
<action name="v_aim_pitch_down">
<rebind input="kb1_lshift+t"/>
</action>
<action name="v_aim_pitch_up">
<rebind input="kb1_lshift+r"/>
</action>
<action name="v_aim_yaw_left">
<rebind input="kb1_lshift+w"/>
</action>
<action name="v_aim_yaw_right">
<rebind input="kb1_lshift+e"/>
</action>
<action name="v_target_cycle_all_back">
<rebind input="kb1_lshift+i"/>
</action>
<action name="v_target_cycle_all_fwd">
<rebind input="kb1_lshift+u"/>
</action>
<action name="v_target_cycle_friendly_back">
<rebind input="kb1_lshift+p"/>
</action>
<action name="v_target_cycle_friendly_fwd">
<rebind input="kb1_lshift+o"/>
</action>
<action name="v_target_cycle_hostile_back">
<rebind input="kb1_lshift+a"/>
</action>
<action name="v_target_cycle_hostile_fwd">
<rebind input="kb1_lshift+rbracket"/>
</action>
<action name="v_target_cycle_subitem_back">
<rebind input="kb1_lshift+g"/>
</action>
<action name="v_target_cycle_subitem_fwd">
<rebind input="kb1_lshift+f"/>
</action>
<action name="v_target_focus_root_entity">
<rebind input="kb1_lshift+d"/>
</action>
<action name="v_target_nearest_hostile">
<rebind input="kb1_lshift+s"/>
</action>
<action name="v_target_reticle_focus">
<rebind input="kb1_y"/>
</action>
<action name="v_target_toggle_pinned_focused">
<rebind input="kb1_lshift+lbracket"/>
</action>
</actionmap>
<actionmap name="spaceship_weapons">
<action name="v_attack1_group1">
<rebind defaultInput="mouse1" input="kb1_lshift+h"/>
</action>
<action name="v_attack1_group2">
<rebind defaultInput="mouse2" input="kb1_lshift+j"/>
</action>
<action name="v_turret_gyromode">
<rebind input="kb1_lshift+apostrophe"/>
</action>
<action name="v_weapon_cycle_aimmode">
<rebind input="kb1_lshift+semicolon"/>
</action>
<action name="v_weapon_cycle_ammo_back">
<rebind input="kb1_lshift+l"/>
</action>
<action name="v_weapon_cycle_ammo_fwd">
<rebind input="kb1_lshift+k"/>
</action>
</actionmap>
<actionmap name="spaceship_missiles">
<action name="v_weapon_arm_missile">
<rebind defaultInput="mouse3" input="kb1_lshift+backslash"/>
</action>
<action name="v_weapon_launch_missile">
<rebind defaultInput="mouse3" input="kb1_lshift+oem_102"/>
</action>
</actionmap>
<actionmap name="spaceship_defensive">
<action name="v_shield_raise_level_back">
<rebind input="kb1_lshift+b"/>
</action>
<action name="v_shield_raise_level_down">
<rebind input="kb1_lshift+slash"/>
</action>
<action name="v_shield_raise_level_forward">
<rebind input="kb1_lshift+v"/>
</action>
<action name="v_shield_raise_level_left">
<rebind input="kb1_lshift+m"/>
</action>
<action name="v_shield_raise_level_right">
<rebind input="kb1_lshift+comma"/>
</action>
<action name="v_shield_raise_level_up">
<rebind input="kb1_lshift+period"/>
</action>
<action name="v_shield_reset_level">
<rebind input="kb1_lshift+print"/>
</action>
<action name="v_weapon_cycle_countermeasure_back">
<rebind input="kb1_lshift+c"/>
</action>
<action name="v_weapon_cycle_countermeasure_fwd">
<rebind input="kb1_lshift+x"/>
</action>
<action name="v_weapon_launch_countermeasure">
<rebind input="kb1_lshift+z"/>
</action>
</actionmap>
<actionmap name="spaceship_power">
<action name="v_power_focus_group_1">
<rebind input="kb1_lshift+scrolllock"/>
</action>
<action name="v_power_focus_group_2">
<rebind input="kb1_lshift+pause"/>
</action>
<action name="v_power_focus_group_3">
<rebind input="kb1_lshift+insert"/>
</action>
<action name="v_power_reset_focus">
<rebind input="kb1_lshift+home"/>
</action>
<action name="v_power_throttle_down">
<rebind input="kb1_lshift+delete"/>
</action>
<action name="v_power_throttle_max">
<rebind input="kb1_lshift+pgdn"/>
</action>
<action name="v_power_throttle_min">
<rebind input="kb1_lshift+up"/>
</action>
<action name="v_power_throttle_up">
<rebind input="kb1_lshift+pgup"/>
</action>
<action name="v_power_toggle">
<rebind input="kb1_lshift+numlock"/>
</action>
<action name="v_power_toggle_group_1">
<rebind input="kb1_lshift+left"/>
</action>
<action name="v_power_toggle_group_2">
<rebind input="kb1_lshift+down"/>
</action>
<action name="v_power_toggle_group_3">
<rebind input="kb1_lshift+right"/>
</action>
</actionmap>
<actionmap name="spaceship_radar">
<action name="v_radar_cycle_zoom_fwd">
<rebind input="kb1_lshift+np_multiply"/>
</action>
<action name="v_radar_toggle_active_or_passive">
<rebind input="kb1_lshift+np_divide"/>
</action>
</actionmap>
<actionmap name="spaceship_hud">
<action name="mobiglas">
<rebind input="kb1_lshift+np_subtract"/>
</action>
<action name="v_hud_open_scoreboard">
<rebind input="kb1_lshift+np_7"/>
</action>
<action name="v_starmap">
<rebind input="kb1_lshift+np_8"/>
</action>
</actionmap>
<actionmap name="lights_controller">
<action name="v_lights">
<rebind input="kb1_lshift+np_9"/>
</action>
</actionmap>
<actionmap name="player">
<action name="attack1">
<rebind defaultInput="mouse1" input="kb1_rshift+2"/>
</action>
<action name="combatheal">
<rebind input="kb1_rshift+x"/>
</action>
<action name="crouch">
<rebind input="kb1_lshift+np_2"/>
</action>
<action name="drop">
<rebind input="kb1_rshift+j"/>
</action>
<action name="fixed_speed_decrement">
<rebind defaultInput="mwheel_down" input="kb1_rshift+oem_102"/>
</action>
<action name="fixed_speed_increment">
<rebind defaultInput="mwheel_up" input="kb1_rshift+backslash"/>
</action>
<action name="force_respawn">
<rebind input="kb1_rshift+slash"/>
</action>
<action name="free_thirdperson_camera">
<rebind input="kb1_rshift+b"/>
</action>
<action name="grenade">
<rebind input="kb1_rshift+equals"/>
</action>
<action name="holster">
<rebind input="kb1_rshift+h"/>
</action>
<action name="inspect">
<rebind input="kb1_rshift+k"/>
</action>
<action name="jump">
<rebind input="kb1_lshift+np_1"/>
</action>
<action name="leanleft">
<rebind input="kb1_lshift+np_period"/>
</action>
<action name="leanright">
<rebind input="kb1_rshift+1"/>
</action>
<action name="melee_AttackHeavyLeft">
<rebind defaultInput="mouse1" input="kb1_rshift+5"/>
</action>
<action name="melee_AttackHeavyRight">
<rebind defaultInput="mouse2" input="kb1_rshift+6"/>
</action>
<action name="melee_AttackLightLeft">
<rebind defaultInput="mouse1" input="kb1_rshift+3"/>
</action>
<action name="melee_AttackLightRight">
<rebind defaultInput="mouse2" input="kb1_rshift+4"/>
</action>
<action name="melee_block">
<rebind defaultInput="mouse1_2" input="kb1_rshift+7"/>
</action>
<action name="melee_dodgeBack">
<rebind input="kb1_rshift+0"/>
</action>
<action name="melee_dodgeLeft">
<rebind input="kb1_rshift+8"/>
</action>
<action name="melee_dodgeRight">
<rebind input="kb1_rshift+9"/>
</action>
<action name="mobiglas">
<rebind input="kb1_rshift+n"/>
</action>
<action name="moveback">
<rebind input="kb1_lshift+np_6"/>
</action>
<action name="moveforward">
<rebind input="kb1_lshift+np_5"/>
</action>
<action name="moveleft">
<rebind input="kb1_lshift+np_add"/>
</action>
<action name="moveright">
<rebind input="kb1_lshift+np_4"/>
</action>
<action name="nextweapon">
<rebind input="kb1_rshift+d"/>
</action>
<action name="pl_hud_open_scoreboard">
<rebind input="kb1_rshift+m"/>
</action>
<action name="port_modification_select">
<rebind defaultInput="mouse1" input="kb1_rshift+comma"/>
</action>
<action name="prevweapon">
<rebind input="kb1_rshift+f"/>
</action>
<action name="prone">
<rebind input="kb1_lshift+np_3"/>
</action>
<action name="refillgastank">
<rebind input="kb1_rshift+c"/>
</action>
<action name="reload">
<rebind input="kb1_rshift+g"/>
</action>
<action name="selectMeleeWeapon">
<rebind input="kb1_rshift+rbracket"/>
</action>
<action name="selectUnarmedCombat">
<rebind input="kb1_rshift+s"/>
</action>
<action name="selectUtilityItem">
<rebind input="kb1_rshift+a"/>
</action>
<action name="selectgadget">
<rebind input="kb1_rshift+lbracket"/>
</action>
SOME DELETED FOR DISPLAY PURPOSES
</action>
<action name="eva_view_yaw_left">
<rebind input="kb1_rshift+pause"/>
</action>
<action name="eva_view_yaw_right">
<rebind input="kb1_rshift+insert"/>
</action>
<action name="eva_yaw_left">
<rebind input="kb1_rshift+pgdn"/>
</action>
<action name="eva_yaw_right">
<rebind input="kb1_rshift+up"/>
</action>
</actionmap>
<actionmap name="player_input_optical_tracking">
<action name="foip_cyclechannel">
<rebind input="kb1_rshift+np_0"/>
</action>
<action name="foip_pushtotalk">
<rebind input="kb1_rshift+np_1"/>
</action>
<action name="foip_pushtotalk_proximity">
<rebind input="kb1_rshift+np_2"/>
</action>
<action name="foip_recalibrate">
<rebind input="kb1_rshift+np_enter"/>
</action>
<action name="foip_viewownplayer">
<rebind input="kb1_rshift+np_3"/>
</action>
<action name="headtrack_enabled">
<rebind input="kb1_rshift+np_4"/>
</action>
<action name="headtrack_hold">
<rebind input="kb1_rshift+np_5"/>
</action>
<action name="headtrack_recalibrate">
<rebind input="kb1_rshift+np_6"/>
</action>
</actionmap>
<actionmap name="player_choice">
<action name="pc_interaction_mode">
<rebind input="kb1_rshift+np_period"/>
</action>
</actionmap>
</ActionMaps>
I am trying to get the names for action and the input for rebind with the following code:
// Create XML document
xml_document<> doc;
xml_node<> * root_node;
// Read the xml file into a vector
ifstream theFile (fqn_file);
vector<char> buffer((istreambuf_iterator<char>(theFile)), istreambuf_iterator<char>());
buffer.push_back('\0');
// Parse the buffer using the xml file parsing library into doc
doc.parse<0>(&buffer[0]);
// Find root node
root_node = doc.first_node("ActionMaps");
// Iterate over 'ActionMaps' subtree
for (xml_node<> * actionmap_node = root_node->first_node("actionmap"); actionmap_node; actionmap_node = actionmap_node->next_sibling())
{
wxLogMessage("I found name subsection %s ",
actionmap_node->first_attribute("name")->value());
// Iterate over 'action' subtree
for(xml_node<> * action_node = actionmap_node->first_node("action"); action_node; action_node = action_node->next_sibling())
{
wxLogMessage("I found action name %s ",
action_node->first_attribute("name")->value());
// Iterate over 'rebind' subtree
for(xml_node<> * rebind_node = action_node->first_node("rebind"); rebind_node; rebind_node = rebind_node->next_sibling())
{
wxLogMessage("I found key %s ",
rebind_node->first_attribute("input")->value());
}
}
}
The code basically works and create the following output:
20:19:17: I found name subsection spaceship_general
20:19:17: I found action name v_toggle_all_doorlocks
20:19:17: I found key kb1_lshift+l
20:19:17: I found name subsection spaceship_view
20:19:17: I found action name v_view_dynamic_focus
20:19:17: I found key js1_slider1
20:19:17: I found action name v_view_look_behind
20:19:17: I found key js1_button8
20:19:17: I found name subsection spaceship_movement
20:19:17: I found action name v_accel_range_rel
20:19:17: I found key js1_rotx
20:19:17: I found action name v_afterburner
20:19:17: I found key js1_button30
20:19:17: I found action name v_autoland
20:19:17: I found key js1_button14
20:19:17: I found action name v_brake
20:19:17: I found key js1_button7
20:19:17: I found action name v_ifcs_toggle_cruise_control
20:19:17: I found key js1_button12
20:19:17: I found action name v_ifcs_toggle_esp
20:19:17: I found key js1_button11
20:19:17: I found action name v_ifcs_toggle_gforce_safety
20:19:17: I found key js1_button10
20:19:17: I found action name v_ifcs_toggle_speed_limiter
20:19:17: I found key js1_button9
20:19:17: I found action name v_ifcs_toggle_vector_decoupling
20:19:17: I found key js1_button6
20:19:17: I found action name v_roll
20:19:17: I found key js1_x
20:19:17: I found action name v_speed_range_rel
20:19:17: I found key js1_roty
20:19:17: I found action name v_strafe_back
20:19:17: I found key js1_
20:19:17: I found action name v_strafe_down
20:19:17: I found key js1_button22
20:19:17: I found action name v_strafe_forward
20:19:17: I found key js1_
20:19:17: I found action name v_strafe_left
20:19:17: I found key js1_button23
20:19:17: I found action name v_strafe_longitudinal
20:19:17: I found key js1_z
20:19:17: I found action name v_strafe_right
20:19:17: I found key js1_button21
20:19:17: I found action name v_strafe_up
20:19:17: I found key js1_button20
20:19:17: I found action name v_target_match_vel
20:19:17: I found key js1_button28
20:19:17: I found action name v_toggle_landing_system
20:19:17: I found key js1_button13
20:19:17: I found action name v_toggle_vtol
20:19:17: I found key js1_button14
20:19:17: I found action name v_yaw
20:19:17: I found key js1_rotz
20:19:17: I found name subsection spaceship_targeting
20:19:17: I found action name v_target_cycle_all_back
20:19:17: I found key js1_hat1_down
20:19:17: I found action name v_target_cycle_all_fwd
20:19:17: I found key js1_hat1_up
20:19:17: I found action name v_target_cycle_friendly_back
20:19:17: I found key js1_button19
20:19:17: I found action name v_target_cycle_friendly_fwd
20:19:17: I found key js1_button17
20:19:17: I found action name v_target_cycle_hostile_back
20:19:17: I found key js1_hat1_left
20:19:17: I found action name v_target_cycle_hostile_fwd
20:19:17: I found key js1_hat1_right
20:19:17: I found action name v_target_cycle_subitem_back
20:19:17: I found key js1_button18
20:19:17: I found action name v_target_cycle_subitem_fwd
20:19:17: I found key js1_button16
20:19:17: I found name subsection spaceship_weapons
20:19:17: I found action name v_attack1_group2
20:19:17: I found key js1_button5
20:19:17: I found name subsection spaceship_missiles
20:19:17: I found action name v_weapon_arm_missile
20:19:17: I found key js1_button2
20:19:17: I found action name v_weapon_launch_missile
20:19:17: I found key js1_button2
20:19:17: I found name subsection spaceship_defensive
20:19:17: I found action name v_weapon_cycle_countermeasure_fwd
20:19:17: I found key js1_button3
20:19:17: I found action name v_weapon_launch_countermeasure
20:19:17: I found key js1_button4
But the result is not as expected:
Random action names in the tree are selected
The keys does not fit to the previous selected action name but are chosen from somewhere
I do not understand the reason behind it. This is from my perspective a simple recursion.
Anyone who can bring me back onto the right path?
The above code is not the problem and runs flawless when compiling it without wxWidgets. So I am closing this and dig further into wxWidgets direction.

Failure calling API with CFHTTP

I'm trying to pass some XML with cfhttp as follows to an API :
<cfxml variable="elementvalue">
<entry name='DENY_TEST'>
<to>
<member>Public</member>
</to>
<from>
<member>VPN_CLIENTS</member>
</from>
<source>
<member>any</member>
</source>
<destination>
<member>any</member>
</destination>
<source-user>
<member>any</member>
</source-user>
<category>
<member>any</member>
</category>
<application>
<member>bittorrent</member>
<member>skype</member>
</application>
<service>
<member>application-default</member>
</service>
<hip-profiles>
<member>any</member>
</hip-profiles>
<action>deny</action>
<rule-type>universal</rule-type>
<disabled>no</disabled>
</entry>
</cfxml>
This is the cfhttp call that I attempted:
<cfhttp method="post" url="https://domain.com/api" result="objGet" throwonerror="Yes">
<cfhttpparam name="type" type="formfield" value="config" />
<cfhttpparam name="action" type="formfield" value="set" />
<cfhttpparam name="key" type="formfield" value="LUZReHB3TVlyYrODNENGVpRmYvVmEvWW5uVjBzZHo4cz0=" />
<cfhttpparam name="xpath" type="formfield" value="/config/devices/entry[#name='localhost.localdomain']/vsys/entry[#name='vsys1']/rulebase/security/rules" />
<cfhttpparam name="element" type="formfield" value="#elementvalue#" />
</cfhttp>
If I use this in a browser everything works fine and I get success.
https://domain.com/api/?type=config&action=set&key=LUZReHB3TVlyYrODNENGVpRmYvVmEvWW5uVjBzZHo4cz0=&xpath==/config/devices/entry[#name='localhost.localdomain']/vsys/entry[#name='vsys1']/rulebase/security/rules&element=<entry name="DENY_TEST"><to><member>Public</member></to><from><member>VPN_CLIENTS</member></from><source><member>any</member></source><destination><member>any</member></destination><source-user><member>any</member></source-user><category><member>any</member></category><application><member>bittorrent</member><member>skype</member></application><service><member>application-default</member></service><hip-profiles><member>any</member></hip-profiles><action>deny</action><rule-type>universal</rule-type><disabled>no</disabled></entry>
Any idea why this could be failing? It is stopping at element. Am I right in using cfxml for this or should I try using a variable with backslashes?
The problem was with the ssl certificate on the device. It didn't occur to me to test it with http first. To use ssl I had to import the device's certificate in CF's keystore. I also used the following to store xml in a variable:
<cfsavecontent variable="elementvalue"><entry name='DENY_TEST'>
<to>
<member>Public</member>
</to>
<from>
<member>VPN_CLIENTS</member>
</from>
<source>
<member>any</member>
</source>
<destination>
<member>any</member>
</destination>
<source-user>
<member>any</member>
</source-user>
<category>
<member>any</member>
</category>
<application>
<member>bittorrent</member>
<member>skype</member>
</application>
<service>
<member>application-default</member>
</service>
<hip-profiles>
<member>any</member>
</hip-profiles>
<action>deny</action>
<rule-type>universal</rule-type>
<disabled>no</disabled>
</entry>
</cfsavecontent>

Selectively setting voice input constraints on submenu items

As I found on a Glass Developers page, it is possible to set voice constraints to disable your voice trigger if certain features are unavailable. I thought this would work for the disambiguation submenu as well, so I tried putting a constraint on one Activity in the submenu but not the others. Instead of just disabling that one submenu item ("Choose from list"), however, this disabled the entire menu ("Make a request"). Here's my manifest and voice trigger xml resources:
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.twintitanium.glassapps.decisionmaker"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<service
android:name="com.twintitanium.glassapps.decisionmaker.DecisionMakerService"
android:enabled="true"
android:exported="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
</service>
<activity
android:name="com.twintitanium.glassapps.decisionmaker.MenuActivity"
android:enabled="true"
android:theme="#style/MenuTheme" >
</activity>
<activity
android:name="com.twintitanium.glassapps.decisionmaker.ChooseFromListActivity"
android:label="#string/choice_from_list"
android:icon="#drawable/ic_choose_from_list" >
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/make_a_request_with_network_constraint_trigger" />
</activity>
<activity
android:name="com.twintitanium.glassapps.decisionmaker.RollDieActivity"
android:label="#string/die_roll"
android:icon="#drawable/ic_roll_die" >
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/make_a_request_trigger" />
</activity>
<activity
android:name="com.twintitanium.glassapps.decisionmaker.FlipCoinActivity"
android:label="#string/coin_flip"
android:icon="#drawable/ic_flip_coin" >
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/make_a_request_trigger" />
</activity>
<activity
android:name="com.twintitanium.glassapps.decisionmaker.YesNoActivity"
android:label="#string/yes_or_no"
android:icon="#drawable/ic_yes_no" >
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/make_a_request_trigger" />
</activity>
</application>
</manifest>
As you can see, I use make_a_request_with_network_constraint_trigger for ChooseFromListActivity but make_a_request_trigger for the other Activities.
make_a_request_with_network_constraint_trigger.xml:
<?xml version="1.0" encoding="utf-8"?>
<trigger keyword="#string/glass_voice_trigger">
<constraints
network="true" />
</trigger>
make_a_request_trigger.xml:
<?xml version="1.0" encoding="utf-8"?>
<trigger keyword="#string/glass_voice_trigger" />
(Just to clarify, "#string/glass_voice_trigger" is "Make a request".)
Is there a reason that the network constraint given to one Activity disables the entire menu, even though the other Activities don't have the same constraint? Is there another way to selectively constrain one Activity and not the others?
This doesn't sound like the desired behavior. Can you please file a bug on our issue tracker so we can investigate further?

NANT modify assembly version for C++ project

Below is a snippet of my NANT scripts that read the Assemblyversion from one of my C# project and increase it automatically.
<target name="CheckAssembly">
<echo message="Check Assembly File version..." />
<property name="file.contents" value="" />
<loadfile property="file.contents" file="${properties.path}\AssemblyInfo.cs" />
<regex pattern="(AssemblyVersionAttribute|AssemblyVersion)\(\x22(?'major'\d+).(?'minor'\d+).(?'build'\d+).(?'revision'\d+)\x22\)" input="${file.contents}" />
<property name="application.AssemblyInfo.dir" value="${properties.path}" />
<property name="AssemblyVersion" value="${major}.${minor}.${build}.${int::parse(revision)}" />
<if test="${int::parse(updates.count)>1}">
<property name="AssemblyVersion" value="${major}.${minor}.${build}.${int::parse(revision) +1}" />
<call target="UpdateAssembly" />
</if>
</target>
<target name="UpdateAssembly" description="generates the version number">
<echo message="Setting the build version to ${AssemblyVersion}..." />
<attrib file="${application.AssemblyInfo.dir}\AssemblyInfo.cs" readonly="false" />
<asminfo output="${application.AssemblyInfo.dir}\AssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System.Runtime.CompilerServices" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<attributes>
<attribute type="AssemblyTitleAttribute" value="${appName}" />
<attribute type="AssemblyDescriptionAttribute" value="" />
<attribute type="AssemblyConfigurationAttribute" value="" />
<attribute type="AssemblyCompanyAttribute" value="Company Name" />
<attribute type="AssemblyProductAttribute" value="" />
<attribute type="AssemblyCopyrightAttribute" value="Copyright © 2010-2013" />
<attribute type="AssemblyTrademarkAttribute" value="" />
<attribute type="AssemblyCultureAttribute" value="" />
<attribute type="AssemblyVersionAttribute" value="${AssemblyVersion}" />
<attribute type="AssemblyFileVersionAttribute" value="${AssemblyVersion}" />
</attributes>
</asminfo>
<attrib file="${application.AssemblyInfo.dir}\AssemblyInfo.cs" readonly="true" />
</target>
Now i am facing my next challenge. I have a C++ project that compiles fine using NANT but I want to update the assembly version similar to what you see above. In this C++ project I have my ProductVersion saved in the resource file (.rc).
Do you know if NANT has any functions/tag that assist in changing this? If not do you have any idea of how I should approach this? I already thought about read file content and use regex to do this.
I know this is a really old question but I have been working on the same problem today. I solved it like this using ANT (please excuse my regex :/ ). I am assuming that Nant will function in a very similar manner to plain ANT.
<echo message="Modifying VersionResource.rc" />
<replaceregexp byline="true" flags="g" encoding="UTF-16LE" >
<regexp pattern="[0-9]+,[0-9]+,[0-9]+,[0-9]+" />
<substitution expression="${adapter_resource}" />
<fileset dir="${my.dir}">
<include name="VersionResource.rc" />
</fileset>
</replaceregexp>
<echo message="Modifying VersionResource.rc again..." />
<replaceregexp byline="true" flags="g" encoding="UTF-16LE" >
<regexp pattern=""(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}"" />
<substitution expression=""${adapter_versions}"" />
<fileset dir="${my.dir}">
<include name="VersionResource.rc" />
</fileset>
</replaceregexp>
${adapter_versions} is set on the command line when calling the build process.