Freeswitch wrong caller id number after bridge - sip

I have a configured gateway and one dialplan for bridging an inbound call through the gateway to another number. This part works.
Now I want that the number of the inbound call is displayed in the phone after the bridge. This part doesn't work. I've tried many combinations, but every time the number from the provider is shown up.
/etc/freeswitch/sip_profiles/external/MyGateway.xml
<gateway name="MyGateway">
<param name="username" value="SIP_USERNAME"/>
<param name="password" value="SIP_PASSWORD"/>
<param name="proxy" value="sip.provider.com"/>
<param name="register" value="true"/>
</gateway>
/etc/freeswitch/dialplan/public/MyExtension.xml
<extension name="bridge">
<condition field="destination_number" expression="^SIP_USERNAME$">
<action application="set" data="bypass_media=true"/>
<action application="bridge" data="sofia/gateway/MyProvider/+49123456789"/>
</condition>
</extension>
This is what i've tested in the dialplan before the line with "bypass_media=true"
some of the commands changed the INVITE and/or RINGING request, but nothing changed the number on the phone after the bridge. I've also tried "export" instead of "set".
(I know that I can get the caller number with ${caller_id_number} - I just used 'ImCallingYou' for easy debugging)
<action application="set" data="initial_callee_id_name='ImCallingYou'"/>
<action application="set" data="initial_callee_id_number=999999999"/>
------------------------------------------------------------------------------------------
--> Remote-Party-ID: "ImCallingYou" <sip:999999999#GATEWAY_IP>;party=calling;privacy=off;screen=no
<action application="set" data="origination_caller_id_name='ImCallingYou'"/>
<action application="set" data="origination_caller_id_number=999999999"/>
------------------------------------------------------------------------------------------
--> nothing changed
<action application="set" data="sip_callee_id_name=ImCallingYou"/>
<action application="set" data="sip_callee_id_number=999999999" />
------------------------------------------------------------------------------------------
--> Remote-Party-ID: "ImCallingYou" <sip:999999999#GATEWAY_IP>;party=calling;privacy=off;screen=no
<action application="set" data="effective_caller_id_name=ImCallingYou"/>
<action application="set" data="effective_caller_id_number=999999999"/>
------------------------------------------------------------------------------------------
--> From: "ImCallingYou" <sip:SIP_USERNAME#sip.provider.com>;tag=1010101010101
<action application="set" data="sip_from_display=ImCallingYou"/>
------------------------------------------------------------------------------------------
--> nothing changed
<action application="set" data="sip_cid_type=pid"/>
<action application="set" data="origination_caller_id_name=ImCallingYou"/>
<action application="set" data="origination_caller_id_number=999999999"/>
------------------------------------------------------------------------------------------
--> nothing changed
<action application="set" data="sip_cid_type=rpid"/>
<action application="set" data="origination_caller_id_name=ImCallingYou"/>
<action application="set" data="origination_caller_id_number=999999999"/>
------------------------------------------------------------------------------------------
--> nothing changed
<action application="bridge" data="{sip_cid_type=rpid,origination_caller_id_name=ImCallingYou,origination_caller_id_number=999999999}sofia/gateway/MyProvider/+49123456789"/>
------------------------------------------------------------------------------------------
--> From: "ImCallingYou" <sip:SIP_USERNAME#sip.provider.com>;tag=10101010101
--> Remote-Party-ID: "ImCallingYou" <sip:999999999#GATEWAY_IP>;party=calling;privacy=off;screen=no

Have you tried this in Gateway config:
<param name="caller-id-in-from" value="true"/>
https://freeswitch.org/confluence/display/FREESWITCH/Gateways+Configuration#GatewaysConfiguration-CallerID

Related

Plotly.js IIS deployment - WebGL setup failed

i tried to deploy my plotly application to an IIS (running under windows server 2012). Unfortunately, the graph is not shown and an error is logged out:
WARN: webgl setup failed possibly due to enabling
preserveDrawingBuffer config. The device may not be supported by
is-mobile module! Inverting preserveDrawingBuffer option in second
attempt to create webgl scene.
as I figured out using the error page, I have to add some rewrites/mime types to my web.config. But it still doesn’t work after.
My web.config looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".mem" />
<mimeMap fileExtension=".mem" mimeType="application/octet-stream" />
<remove fileExtension=".data" />
<mimeMap fileExtension=".data" mimeType="application/octet-stream" />
<remove fileExtension=".memgz" />
<mimeMap fileExtension=".memgz" mimeType="application/octet-stream" />
<remove fileExtension=".datagz" />
<mimeMap fileExtension=".datagz" mimeType="application/octet-stream" />
<remove fileExtension=".unity3dgz" />
<mimeMap fileExtension=".unity3dgz" mimeType="application/octet-stream" />
<remove fileExtension=".jsgz" />
<mimeMap fileExtension=".jsgz" mimeType="application/x-javascript; charset=UTF-8" />
</staticContent>
<rewrite>
<outboundRules>
<rule name="Append gzip Content-Encoding header">
<match serverVariable="RESPONSE_Content-Encoding" pattern=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" pattern="\.unityweb$" />
</conditions>
<action type="Rewrite" value="gzip" />
</rule>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>
Dou you have an idea, how to cope with this error?
problem was not caused by IIS (as the error misleadingly states). Error is caused by the current version of plotly, downgrading to version 1.43 fixed the issue.
Somehow the minified version of the new plotly version is not valid.

Ionic2 and 3 Geolocation Error: Only secure origins are allowed, Error getting location and not working on device

Okay, Here is what happened, i have tried so many times to get geolocation working on an android device but nothing is happening instead it shows a white screen. I decided to test with an emulator by running ionic cordova run android -l -c then i discovered that it throws an exception Only secure origins are allowed. Then i tried using a solution i got from someone (platform.ready().then(() => { ) before calling geolocation getcurrentPosition, I built the app for android and tested, it still shows a white screen. I ran with emulator and the exception changed to console log: Error getting location , I really need help, please anyone.
I run ionic 3.4.0 with npm 5.0.3 on Node.js 7.8.0
Home.ts
getMapLocation() {
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 5000
};
/* Ensure the platform is ready */
this.platform.ready().then(() => {
console.log("platfrom is ready");
/* Perform initial geolocation */
this.geolocation.getCurrentPosition(options).then((position) => {
console.log(position.coords.latitude)
this.Latitude = position.coords.latitude;
this.Longitude = position.coords.longitude;
var pos = {
lat: this.Latitude,
lng: this.Longitude
};
this.location = pos;
this.getMap(this.Latitude, this.Longitude);
}).catch((err) => {
console.log('Error getting location', err);
});
})
}
Config.Xml
<universal-links>
<host name="tgp38.app.goo.gl" scheme="https" />
<host name="taxi-59a68.firebaseapp.com" scheme="https">
<path url="/__/auth/callback" />
</host>
</universal-links>
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<allow-navigation href="http://192.168.8.101:8100" />
<allow-navigation href="http://192.168.8.103:8100" />
<allow-navigation href="http://192.168.8.102:8100" />
<engine name="android" spec="^6.2.3" />
<plugin name="cordova-plugin-browsertab" spec="^0.2.0" />
<plugin name="cordova-plugin-buildinfo" spec="^1.1.0" />
<plugin name="cordova-plugin-compat" spec="^1.0.0" />
<plugin name="cordova-plugin-device" spec="^1.1.6" />
<plugin name="cordova-plugin-geolocation" spec="^2.4.3" />
<plugin name="cordova-plugin-inappbrowser" spec="^1.7.1" />
<plugin name="cordova-plugin-network-information" spec="^1.3.3" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.3" />
<plugin name="cordova-plugin-stripe" spec="^1.4.1" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="cordova-universal-links-plugin" spec="^1.2.1" />
<plugin name="cordova.plugins.diagnostic" spec="^3.6.5" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
AndroidManifest.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="com.playheavens.taxihub" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application android:hardwareAccelerated="true" android:icon="#mipmap/icon" android:label="#string/app_name" android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="#string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="#android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
<intent-filter android:label="#string/launcher_name">
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="tgp38.app.goo.gl" android:scheme="https"/>
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="taxi-59a68.firebaseapp.com" android:scheme="https" android:path="/__/auth/callback"/>
</intent-filter>
</activity>
<receiver android:name="cordova.plugins.Diagnostic$LocationProviderChangedReceiver">
<intent-filter>
<action android:name="android.location.PROVIDERS_CHANGED"/>
</intent-filter>
</receiver>
<receiver android:name="cordova.plugins.Diagnostic$NFCStateChangedReceiver">
<intent-filter>
<action android:name="android.nfc.action.ADAPTER_STATE_CHANGED"/>
</intent-filter>
</receiver>
</application>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25"/>
<uses-feature android:name="android.hardware.location.gps"/>
</manifest>
There is problem with 'livereload'. Google's new security rules are now only allowing https ports.
So, if you are running in the browser try using https://localhost:8100. and if you are running in device run it without livereload option.
Try again using this plugin in your browser.
It allows to you request any site with ajax from any source, no matter http/https discrepancies and the like. Practically adds the Allow-Control-Allow-Origin: * header in the response.
Please keep in mind that this is a band-aid solution for development only. It is your server actually that has to be configured to respond with the 'Access-Control-Allow-Origin': '*' header, preferably with a more specific value than *.
To expand on Shreenil's answer, this can be caused by running on an Android emulator with the --livereload option as well as the -lc option.
tl;dr
Remove --livereload and -lc options

IIS Express Url Rewrite with 2 params don't work

Simply I have this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="index/page/method to index.php?page=page&method=method">
<match url="^index/([^/]+)/([^/]+)$" />
<action type="Rewrite" url="index.php?page={R:1}&method={R:2}" />
</rule>
<rule name="index/page to index.php?page=page">
<match url="^index/([^/]+)$" />
<action type="Rewrite" url="index.php?page={R:1}" />
</rule>
<rule name="index to index.php">
<match url="^index" />
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
When I call localhost I get the following:
HTTP-Fehler 500.19 - Internal Server Error
My problem is the first rule doesn't work :(
The rules work fine as I delete the first rule...
Can someone help me?
Edit by myself:
IIS doesn't like the &...so I changed it to & and it works fine^^
It is clear that you shoud use &, as Microsoft says so in its article,
http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

JBoss ESB XML MEP Behviour

I am using JBoss AS 5.1.0 and Jboss ESB 4.10
I am trying to Invoke a Service which has a single action. I have Set MEP = oneWay for the Service.
When I Invoke the Service Using the Below Method I do not get a reply but an Exception.
new ServiceInvoker("Chapter3Sample", "Chapter3Service").deliverSync(esbMessage, 10000);
WHen I change mep=RequestResponse : I am able to get the Reply
As per my understanding ESB Message has a ReplyTo field (Since I am invkoing a Sync Request) the Message should be returned back by the last Action which is not happening in my case. Please find below the ESB XML:
<?xml version="1.0"?>
<jbossesb parameterReloadSecs="5"
xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
<providers>
<jms-provider connection-factory="ConnectionFactory" name="JBossMQ">
<jms-bus busid="chapter3GwChannel">
<jms-message-filter dest-name="queue/chapter3_Request_gw" dest-type="QUEUE"/>
</jms-bus>
<jms-bus busid="chapter3EsbChannel">
<jms-message-filter dest-name="queue/chapter3_Request_esb" dest-type="QUEUE"/>
</jms-bus>
</jms-provider>
</providers>
<services>
<service category="Chapter3Sample"
description="A template for Chapter3" name="Chapter3Service">
<listeners>
<jms-listener busidref="chapter3GwChannel" is-gateway="true" name="Chapter3GwListener"/>
<jms-listener busidref="chapter3EsbChannel" name="Chapter3Listener"/>
</listeners>
<actions mep="OneWay">
<action class="org.jboss.soa.esb.samples.chapter3.MyAction"
name="BodyPrinter">
<property name="process" value="displayMessage"/>
<property name="symbol" value="*"/>
<property name="count" value="50"/>
<property name="propertyName">
<hierarchicalProperty attr="value">
<inner name="myName" random="randomValue"/>
</hierarchicalProperty>
</property>
<property name="exceptionMethod" value="processException"/>
<property name="okMethod" value="processSuccess"/>
</action>
</actions>
</service>
</services>
</jbossesb>
When your are invoking call as synchronus.
new ServiceInvoker("Chapter3Sample", "Chapter3Service").deliverSync(esbMessage, 10000).
set mep=RequestResponse.
when your are invoking call asynchronus.
new ServiceInvoker("Chapter3Sample", "Chapter3Service").deliverASync(esbMessage, 10000).
set mep=oneWay .

JBoss ESB Message is received by the wrong Service

I have several services configured in jboss-esb.xml, when I send message to one of the service, my message will be received by one of the configured services (even though the message is not meant for that service)!
If I send the same message again, another service will process that message (in round-robin maner), it is not random, it is like each service takes turn to intercept the message.
Example, if I have 3 services configured. First time I send a message, Service 1 will receive it, second time I send a message, Service 2 will receive it, third time I send the message, Service 3 will receive it. Fourth time I send it, Service 1 will receive it and the cycle repeat..
I suspect there is something wrong with the way I configured my jboss-esb.xml, but I am clueless.
Here is how I invoke the service,
ServiceInvoker invoker = new ServiceInvoker("NTIAdaptor", "SearchAccountByParentInternalId");
Message replyMessage = invoker.deliverSync(requestMessage, TIMEOUT);
And here is the jboss-esb.xml,
<?xml version="1.0"?>
<jbossesb parameterReloadSecs="5"
xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
<providers>
<jms-provider connection-factory="ConnectionFactory" name="JMS Provider">
<jms-bus busid="NTI">
<jms-message-filter dest-name="queue/NTIAdaptor" dest-type="QUEUE"/>
</jms-bus>
</jms-provider>
</providers>
<services>
<service category="NTIAdaptor"
description="SearchAccountByExternalId" name="SearchAccountByExternalId">
<listeners>
<jms-listener busidref="NTI" name="JMS"/>
</listeners>
<actions mep="RequestResponse" webservice="true">
<action class="com.krona.esb.action.AuthenticateAction" name="authenticate"/>
<action class="com.krona.esb.action.LogAction" name="logStart"/>
<action
class="com.krona.esb.account.action.SearchAccountByExternalIdAction"
name="process" process="process"/>
<action class="com.krona.esb.action.LogAction" name="logEnd"/>
</actions>
</service>
<service category="NTIAdaptor"
description="SearchAccountByInternalId" name="SearchAccountByInternalId">
<listeners>
<jms-listener busidref="NTI" name="JMS"/>
</listeners>
<actions mep="RequestResponse" webservice="true">
<action class="com.krona.esb.action.AuthenticateAction" name="authenticate"/>
<action class="com.krona.esb.action.LogAction" name="logStart"/>
<action
class="com.krona.esb.account.action.SearchAccountByInternalIdAction"
name="process" process="process"/>
<action class="com.krona.esb.action.LogAction" name="logEnd"/>
</actions>
</service>
<service category="NTIAdaptor"
description="SearchAccountByParentInternalId" name="SearchAccountByParentInternalId">
<listeners>
<jms-listener busidref="NTI" name="JMS"/>
</listeners>
<actions mep="RequestResponse" webservice="true">
<action class="com.krona.esb.action.AuthenticateAction" name="authenticate"/>
<action class="com.krona.esb.action.LogAction" name="logStart"/>
<action
class="com.krona.esb.account.action.SearchAccountByParentInternalIdAction"
name="process" process="process"/>
<action class="com.krona.esb.action.LogAction" name="logEnd"/>
</actions>
</service>
<service category="NTIAdaptor"
description="SearchAccountByServiceExternalId" name="SearchAccountByServiceExternalId">
<listeners>
<jms-listener busidref="NTI" name="JMS"/>
</listeners>
<actions mep="RequestResponse" webservice="true">
<action class="com.krona.esb.action.AuthenticateAction" name="authenticate"/>
<action class="com.krona.esb.action.LogAction" name="logStart"/>
<action
class="com.krona.esb.account.action.SearchAccountByServiceExternalIdAction"
name="process" process="process"/>
<action class="com.krona.esb.action.LogAction" name="logEnd"/>
</actions>
</service>
</services>
</jbossesb>
You are experiencing that problem because you're using the same jms-bus across services. Try using a different jms-bus for each service jms listener.
If is not what Manuel says, we had a similar problem to yours, messages were getting to the wrong services.
In our case it was that the juddi register wasn't altered when we changed a listener from one services to another. So we ended with 2 services listening to the same queue.