Freeswitch 1.8 and playback of tone_stream - voip

I have an example dialplan in a form of:
<include>
<context name="application">
<extension name="play tone">
<condition>
<action application="log" data="INFO *****Playing tone1***** "/>
<action application="answer"/>
<action application="sleep" data="1000"/>
<action application="playback" data="tone_stream://%(1850,4150,475,425);loops=-1" />
<action application="hangup"/>
</condition>
</extension>
</context>
</include>
This bit works with Freeswitch 1.4 but is not working with Freeswitch 1.8, I am getting debug output like this:
2019-05-29 11:14:59.971372 [DEBUG] sofia.c:7291 Channel sofia/sip-profile/447872019798#127.0.0.1:5062 entering state [ready][200]
EXECUTE sofia/sip-profile/447872019798#127.0.0.1:5062 sleep(1000)
EXECUTE sofia/sip-profile/447872019798#127.0.0.1:5062 playback(tone_stream://%(1850,4150,475,425);loops=-1)
2019-05-29 11:15:00.971418 [ERR] switch_core_file.c:304 Invalid file format [tone_stream] for [%(1850,4150,475,425);loops=-1]!
EXECUTE sofia/sip-profile/447872019798#127.0.0.1:5062 hangup()
I have consulted documentation:
https://freeswitch.org/confluence/display/FREESWITCH/mod_tone_stream
https://freeswitch.org/confluence/display/FREESWITCH/Tone_stream
Not sure what to think and not sure where to look for some answers. Is it my configuration somewhere that disables tone_streams? Is it a bug in the new version?
For any hint or outright solution I would be grateful.

Related

java.lang.RuntimeException: Unable to create service io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService

I am using Firebase Cloud Messaging for push notifications in a Flutter app using node.js + Typescript.
The FCM configurations for onLaunch and onResume were working fine, until I added Firebase dynamic links. Now, every time I receive a notification, the app crashes.
I have included click_action: 'FLUTTER_NOTIFICATION_CLICK' in the notification payload as well.
I do not have an Application.java file, I am using Flutter Android Embedding V2 (Flutter Version >= 1.12) and hence, no additional integration steps are required for Android.
Error:
D/AndroidRuntime(14785): Shutting down VM
E/AndroidRuntime(14785): FATAL EXCEPTION: main
E/AndroidRuntime(14785): Process: com.muffly, PID: 14785
E/AndroidRuntime(14785): java.lang.RuntimeException: Unable to create service io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService: java.lang.RuntimeException: PluginRegistrantCallback is not set.
E/AndroidRuntime(14785): at android.app.ActivityThread.handleCreateService(ActivityThread.java:4043)
E/AndroidRuntime(14785): at android.app.ActivityThread.access$1600(ActivityThread.java:229)
E/AndroidRuntime(14785): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1917)
E/AndroidRuntime(14785): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(14785): at android.os.Looper.loop(Looper.java:226)
E/AndroidRuntime(14785): at android.app.ActivityThread.main(ActivityThread.java:7592)
E/AndroidRuntime(14785): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(14785): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
E/AndroidRuntime(14785): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
E/AndroidRuntime(14785): Caused by: java.lang.RuntimeException: PluginRegistrantCallback is not set.
E/AndroidRuntime(14785): at io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService.startBackgroundIsolate(FlutterFirebaseMessagingService.java:157)
E/AndroidRuntime(14785): at io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService.onCreate(FlutterFirebaseMessagingService.java:77)
E/AndroidRuntime(14785): at android.app.ActivityThread.handleCreateService(ActivityThread.java:4031)
E/AndroidRuntime(14785): ... 8 more
D/OOMEventManagerFK(14785): checkEventAndDumpForJE: 0
I/Process (14785): Sending signal. PID: 14785 SIG: 9
pubspec.yaml
firebase_core: ^0.5.0
firebase_auth: ^0.18.4+1
firebase_messaging: ^7.0.0-dev.15
firebase_dynamic_links: ^0.5.0+11
firebase_core: ^0.5.0
AndroidManifest.xml
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#mipmap/ic_launcher" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="high_importance_channel" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with YOUR_SCHEME://YOUR_HOST -->
<data
android:scheme="https"
android:host="muffly.page.link" />
</intent-filter>
Create a separated file beside MainActivity.kt and name it Application.kt and type the following code inside it.
//Don't forget to change it to your app package name!!!
package com.your.packagename
import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback
import io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService.setPluginRegistrant
class Application : FlutterApplication(), PluginRegistrantCallback {
override fun onCreate() {
super.onCreate()
setPluginRegistrant(this)
}
override fun registerWith(registry: PluginRegistry?) {
FirebaseMessagingPlugin.registerWith(registry?.registrarFor("io.flutter.plugins.firebasemessaging.FirebaseMessagingPlugin"));
}
}
Then, on your AndroidMainfest.xml add android:name=".Application" to your application tag
<application
...
android:name=".Application"
>
Finally, add firebase-messaging to your app/build.gradle.
dependencies {
...
implementation "com.google.firebase:firebase-messaging:20.1.0"
}

NLog MessageBox target not found

I am unable to use the NLog MessageBox target in a WinForm application. The config file indicates the xsi:type is invalid. When I run the program I get this error:
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'Catalog.Form2' threw an exception.
Source=Catalog
StackTrace:
at Catalog.Form2..ctor() in L:\SourceCode\Catalog\Catalog\Form2.cs:line 29
at Catalog.Program.Main() in L:\SourceCode\Catalog\Catalog\Program.cs:line 16
Inner Exception 1:
NLogConfigurationException: Exception when parsing L:\SourceCode\Catalog\Catalog\bin\Debug\NLog.config.
Inner Exception 2:
ArgumentException: Target cannot be found: 'MessageBox'
My config file contains this:
<targets>
<target name="errors" xsi:type="MessageBox" layout="${message}" />
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="errors" />
</rules>
If I change the target to "Console" everything works. Why does MessageBox not work?
NLog 4.5.11,
NLog.Schema 4.5.11,
.NET Framwork 4.7.2,
VS 2017 Pro (15.9.7)
For the MessageBox target you need to install the NLog.Windows.Forms NuGet package.
See also: https://nlog-project.org/config/?tab=targets&search=messagebox

Gradle Project Sync Failed after updating to Android Studio 3.3.0

I haven't touched my Android Studio for a loooong time, it still worked fine when I launched it, but then I updated to 3.3.0 and I get a 'gradle project sync failed'. I know this is not trivial to debug via SO, but I tried to find anything similar and I lack of knowledge about the entire studio didn't help.
So maybe you can guide me to a solution, I'm not sure what files are necessary, but here is the actual error:
ERROR: Failed to parse XML in C:\Users\roberts\AndroidProjects\LingoFlash\app\src\main\AndroidManifest.xml
ParseError at [row,col]:[27,9]
Message: expected start or end tag
Affected Modules: app
This is the AndroidManifest.xml file:
20 <application
21 android:allowBackup="true"
22 android:icon="#mipmap/ic_launcher"
23 android:label="#string/app_name"
24 android:supportsRtl="true"
25 android:theme="#style/MyMaterialTheme">
26 //------------------------------------------------------------------------------------------
27 <activity android:name=".MainActivity">
28 <intent-filter>
29 <action android:name="android.intent.action.MAIN" />
30 <category android:name="android.intent.category.LAUNCHER" />
31 </intent-filter>
32 </activity>
so what's wrong at line 27? seems to point to the MainActivity
before I paste a ton of data, what would help to debug this?
Comments in xml files do not start with Double slash // they work with <!--Your comments-->. Your manifest is having lines that start with // remove them and try to clean and build your project.
Check if you have some wrong character found in the [27,9] position of the AndroidManifest.xml.
Refs: https://stackoverflow.com/a/52932622/8034839

FileLoadException when using NLog

I'm developing API where I use NLog for logging incoming requests and their responses.
Occasionally I'm getting following error on my server
Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileLoadException
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32, IntPtr)
at NLog.Internal.FileAppenders.BaseFileAppender.WindowsCreateFile(System.String, Boolean)
at NLog.Internal.FileAppenders.BaseFileAppender.TryCreateFileStream(Boolean)
at NLog.Internal.FileAppenders.BaseFileAppender.CreateFileStream(Boolean)
at NLog.Internal.FileAppenders.RetryingMultiProcessFileAppender.Write(Byte[])
at NLog.Targets.FileTarget.WriteToFile(System.String, NLog.LogEventInfo, Byte[], Boolean)
at NLog.Targets.FileTarget.ProcessLogEvent(NLog.LogEventInfo, System.String, Byte[])
at NLog.Targets.FileTarget.FlushCurrentFileWrites(System.String, NLog.LogEventInfo, System.IO.MemoryStream, System.Collections.Generic.List`1<NLog.Common.AsyncContinuation>)
at NLog.Targets.FileTarget.Write(NLog.Common.AsyncLogEventInfo[])
at NLog.Targets.Target.WriteAsyncLogEvents(NLog.Common.AsyncLogEventInfo[])
at NLog.Targets.Wrappers.AsyncTargetWrapper.ProcessPendingEvents(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.TimerQueueTimer.CallCallback()
at System.Threading.TimerQueueTimer.Fire()
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
My nlog.config looks like this
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true" throwExceptions="true">
<variable name="logPath" value="${basedir}/App_Data/Logs"/>
<variable name="rowFormatInfo" value="${longdate} | ${level:uppercase=true} | ${message} | Thread: ${threadid}" />
<targets async="true">
<target name="traceFile" xsi:type="AsyncWrapper" overflowAction="Grow">
<target xsi:type="File" fileName="${logPath}/${shortdate}.trace.log" layout="${rowFormatInfo}" />
</target>
</targets>
<rules>
<logger name="*" minlevel="Trace" maxlevel="Debug" writeTo="traceFile" />
</rules>
</nlog>
In my opinion the problem lies with the fact that I'm using async wrapper which can result into mix of several threads trying to access the log file.
Is there any workaround to prevent such errors occurring in the peak times where my API has to deal with tens of requests per second? I don't think that switching to sync logging helps as the API runs in several concurrent threads itself.
Thanks for suggestions
Multiple threads within the same application should not give any issues, as they will just write to the async-queue (and not the file). But if you have multiple applications writing to the same file, then you can get issues.
You can also get this issue if you have an external application can monitors the log-file and tries to copy the contents somewhere else (Ex. SPLUNK).
If you don't have multiple applications writing to the same file, then just add these options to the file-target:
<target xsi:type="File"
fileName="${logPath}/${shortdate}.trace.log"
layout="${rowFormatInfo}"
keepFileOpen="true"
concurrentWrites="false" />
If you do have multiple Applications/AppDomains writing to the same file, then upgrade to latest NLog (currently 4.4.10) and use these options on the file-target:
<target xsi:type="File"
fileName="${logPath}/${shortdate}.trace.log"
layout="${rowFormatInfo}"
keepFileOpen="true"
concurrentWrites="true" />

Why does Mule application behave strangely in Linux server?

I work with Mule and I have some problem.
My mainflow.xml:
<?xml version="1.0" encoding="UTF-8"?><mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core"
xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:management="http://www.mulesoft.org/schema/mule/management"
version="CE-3.3.0"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/management http://www.mulesoft.org/schema/mule/management/current/mule-management.xsd">
<!-- For show MX4J -->
<management:jmx-default-config port="1098"
registerMx4jAdapter="true">
</management:jmx-default-config>
<management:jmx-mx4j-adaptor jmxAdaptorUrl="http://localhost:9999"
login="admin" password="admin">
</management:jmx-mx4j-adaptor>
<management:jmx-server enableStatistics="true">
<management:connector-server
url="service:jmx:rmi:///jndi/rmi://localhost:1099/server" rebind="false" />
</management:jmx-server>
<management:rmi-server createRegistry="true" />
<!-- For get statistics -->
<notifications>
<notification event="EXCEPTION" />
<notification event="ENDPOINT-MESSAGE" />
<notification-listener ref="endpointNotificationLogger" />
<notification-listener ref="statesModuleExceptionNotificationListener" />
</notifications>
<spring:beans>
<!-- For show MX4J -->
<spring:bean id="exporter"
class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
<spring:property name="beans">
<spring:map>
<spring:entry key="bean:name=MBean1"
value-ref="MBean1" />
<spring:entry key="bean:name=MBean2"
value-ref="MBean2" />
</spring:map>
</spring:property>
</spring:bean>
<spring:bean id="MBean1" name="MBean1"
class="MBean1"></spring:bean>
<spring:bean id="MBean2" name="MBean2"
class="MBean2"></spring:bean>
<!-- For get statistics -->
<spring:bean name="endpointNotificationLogger"
class="MyEndpointNotificationListener" />
<spring:bean name="myExceptionNotificationListener"
class="MyExceptionNotificationListener" />
<spring:bean id="MyBean" name="MyBean"
class="MyBean">
</spring:bean>
</spring:beans>
<!-- <file:connector name="input" autoDelete="true" doc:name="File" />-->
<file:connector name="inputFileConnector" autoDelete="true" doc:name="File" >
<service-overrides messageReceiver="myFileMessageReceiver"/>
</file:connector>
<flow name="UnpackHandler" doc:name="UnpackHandler">
...
</flow>
<flow name="XmlToCsvTransformHandler" doc:name="XmlToCsvTransformHandler">
...
</flow>
Everything works OK in Tomcat. But after that I commit changes to SVN, checkout everything, package without changes and deploy app in Tomcat my application do not work!
The latest text in logs of Tomcat for my application:
DEBUG 18.12.2014 15:12:08 997 - DisposableBeanAdapter.invokeCustomDestroyMethod - Invoking destroy method 'dispose' on bean with name '_muleSystemModel'
INFO 18.12.2014 15:12:08 997 - ModelLifecycleManager.fireDisposePhase - Disposing model: _muleSystemModel
And there are no any logs about errors...
When application works OK, after this lines I see
DEBUG 18.12.2014 10:59:53 765 - MuleXmlBuilderContextListener.initialize - Mule config file(s): WEB-INF/classes/mainflow.xml
If I have this error and delete from mainflow.xml parts for mx4j and notifications everything works again:
<?xml version="1.0" encoding="UTF-8"?><mule xmlns="http://www.mulesoft.org/schema/mule/core" mlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" xmlns:core="http://www.mulesoft.org/schema/mule/core" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="CE-3.3.0" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd ">
</spring:beans>
<file:connector name="input" autoDelete="true" doc:name="File" />
<flow name="UnpackHandler" doc:name="UnpackHandler">
...
</flow>
<flow name="XmlToCsvTransformHandler" doc:name="XmlToCsvTransformHandler">
...
</flow>
After I write parts for mx4j and notifications step by step, do not paste all text of file what I take from SVN, it works again! So there is no difference between mainflow.xml when application works and doesn't work.
This behavior is in Linux server. In the Windows server and in my local machine everything is OK. I thought about differences between slashes, but I don't write slashes...
Why application behaves so strangely?
With the information you provide I can only guess that you have some logic in the notifications that hangs them if something on which they are dependedant is not already initializated somehow.
The fact that later it does work would somehow indicate this. I can suggest you to use in the beans the attribute depends-on to make sure it's initialized after your bean dependencies in case there are.

Resources