Freeswitch prevent hangup - freeswitch

Can somebody tell me how to prevent my freeswitch extension from hangup after playing some music?
Here is my extension:
<include>
<extension name="welcome_ivr" continue="true">
<condition field="destination_number" expression="^411$">
<action application="answer" />
<action application="playback" data="/usr/local/funny.wav"/>
</condition>
</extension>
</include>
and to this extension i call a script which look likes this:
def handler(session, args):
logging.basicConfig(filename='/tmp/test.log',level=logging.INFO)
while session.ready():
logging.info("string")
return
So after the song is played it hangup. How can i prevent that. I want the channel stay open also after the song is played and only hangup if i want to hangup (session.hangup())
Hope somebody can help me.

Yes, once the song is over it's "done" so it hangs up.
Have it go to park after, then it will stay open until the park timeout.
<action application="park" />

It was very simple. I just change the extension to play the song endless.
<action application="endless_playback" data="/usr/local/funny.wav"/>
So i can do stuff how long i want.

Related

Sending pushes to devices without google play account

We're developping an Android app which uses Parse. All devices that install the app have their deviceToken and pushType registered in _Installation Parse Table upon registration, since they have google play accounts. They all receive push notifications from Parse without any problems.
I have a fairphone device which has been used for testing purposes since the beginning. It has never had google play account, but Parse push notifications were succesfully received without problems. But some three months ago, this device doesn't get push notifications anymore. I have uninstalled the app completely, erased all data, given again permission to receive notifications, but nothing works.
I can't understand why this device doesn't get push notifications from Parse.
My question is: is there a way to debug my app and discover why a certain device doesn't get parse push notifications?
This is my manifest part related to parse push notifications:
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="br.org.eita.responsa.push.ResponsaPushReceiver"
android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="br.org.eita.responsa" />
</intent-filter>
</receiver>

Parse - Installation table not setting deviceToken nor pushType

I had an app working on Parse, with the notifications working fine. I changed app packaging and I create a new app on Parse.
With the new app, deviceToken and pushType columns remain always empty on table _Installation, so pushes doesn't work even if sent from Parse web page, and a new entry is generated as application is launched.
I've updated parse keys on my java code and on my cloud code.
Someone has some idea what I may have missed or what may happen so the same code has different behaviour in different apps with equivalent configurations?
If I update one of the installation with pushType="gcm" and "deviceToken" the one I had in the other app, this device receives notifications.
Thank you
okay, I had a similar issue. both those columns were empty.
this is mainly due to the manifest issue.
your permissions seem okay because you are getting the notification and also able to reg in the parse data base.
so the problem should be in the <receiver> tags there should only be 2 of them like mine.
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
<receiver android:name="com.parse.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<!--
IMPORTANT: If you change the package name of this sample app,
change "com.parse.tutorials.pushnotifications" in the lines
below to match the new package name.
-->
<category android:name="com.example.ifis" />
</intent-filter>
</receiver>
if you have any receiver like "com.google.android.gcm.GCMBroadcastReceiver" pls remove and also one <service android:name="com.parse.PushService" />
Enable parse logging:
Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);
In my case I was missing GCM permissions
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="my.package.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="my.package.permission.C2D_MESSAGE" />

Bridge a call from sip phone to real phone using freeswitch

How to bridge a call to real phone from a sip phone in Freeswitch. I have used following command but it didn’t work
<action application="bridge" data="sofia/gateway/ytel.com/xxxxxx#ip"/>
Thanks in advance
If you have the gateway ytel.com set up, then you shouldn't have #ip, it should be:
<action application="bridge" data="sofia/gateway/ytel.com/xxxxxx"/>
You either use sofia/gateway/$myCarrier/$number OR sofia/$profile/$number#$IPorDomain

Launch Intent from account-authenticator accountPreferences screen?

I have included the AccountManager code in my app to enable the user to create and manage their account from inside their Settings application.
I linked in the "accountPreferences" preferences file inside my account-authenticator definition, and the options show properly in the Settings > Accounts > My App screen. When I tap on one of them, instead of getting the activity I linked in, I get:
01-14 14:47:27.304: ERROR/AndroidRuntime(27708): FATAL EXCEPTION: main
android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
at android.app.ContextImpl.startActivity(ContextImpl.java:944)
at android.app.ContextImpl.startActivity(ContextImpl.java:931)
at android.preference.Preference.performClick(Preference.java:967)
at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:215)
I have the intents inside my PreferenceScreen defined as:
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="com.myapp.android"
android:targetClass="com.myapp.android.activities.AccountForwardingActivity"/>
And the target activity is also defined as you'd expect, with no special flags other than an intent-filter to match that action (I have other custom actions listed as well).
<activity android:name=".activities.AccountForwardingActivity"
android:theme="#style/Theme.MyApp"
android:launchMode="singleTask">
<intent-filter>
<action android:name="com.myapp.android.PAYMENT_TYPES"/>
<action android:name="com.myapp.android.ADDRESS_LIST"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
What am I doing wrong? How can I mark this intent, launched from Settings.apk, to be a new task?
My problem was putting the Preference Screens inside my PreferenceCategory.
This works fine:
<PreferenceCategory android:title="General Settings" />
<PreferenceScreen
android:title="Account Settings"
android:summary="Favorites, Orders, and more.">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="com.myapp.android"
android:targetClass="com.myapp.android.activities.AccountForwardingActivity"/>
</PreferenceScreen>
Nesting that PreferenceScreen inside the PreferenceCategory does not work, and results in the error above.

Rhomobile: Custom URL Schemes

I'm writing a Rhomobile application targeted at iPhone and Android.
I need to create a custom url scheme, so that i can create urls that look like test://some-params that will launch my program and will pass it the params.
As far as I understand this is done in build.yml through the BundleURLScheme parameter, and then System.get_start_params() to get those parameters.
However, this works on the iPhone only as far as I understand.
Is there any way to make this work on Android too?
Thanks alot!
OKay, I've found the answer myself, in case anybody needs this too:
Create an extension to the application as explained here:
http://docs.rhomobile.com/rhodes/extensions#generating-a-native-extension-template
Add an android_manifest_changes file, as decribed in the above link.
In that file add the following lines:
<manifest xmlns:android='http://schemas.android.com/apk/res/android'
android:versionName='1.0' package='com.rhomobile.webbrowserpoc'
android:versionCode='10000' android:installLocation='auto'>
<application android:name='com.rhomobile.rhodes.RhodesApplication'
android:label='#string/app_name' android:icon='#drawable/icon'
android:debuggable='true'>
<activity android:name='com.rhomobile.rhodes.RhodesActivity'
android:label='#string/app_name' android:launchMode='singleTask'
android:configChanges='orientation|keyboardHidden'
android:screenOrientation='unspecified'>
<intent-filter>
<action android:name='android.intent.action.VIEW' />
<category android:name='android.intent.category.BROWSABLE' />
<category android:name='android.intent.category.DEFAULT' />
<data android:pathPrefix='' android:scheme=''
android:host='' />
</intent-filter>
</activity>
</application>
Only the <data android:pathPrefix='' android:scheme='' android:host='' /> line should be filled in with correct properties.

Resources