I am working with linphone call feature using Asterisk server. I have set call limit to one(1) in asterisk server for every sip users. So it will permit only 1 outgoing call and 1 incoming call at a time. Now I want to know if other user calls to user which is already busy with other call then how can I realize that, the end user is busy? Is there any way to get that using linphone lib? Or is there any way to get Asterisk HangupCauseCode using linphonelib?
I have checked with LinphoneCall.getReason() while CallEnd state but it returns null.
You should write your dialplan and save somewhere DIALSTATUS variable after dial attempt.
Related
I am developing an app that is designed to allow emergency calls using Twilio - my code is derived from https://github.com/twilio/twilio-client-quickstart-android.
All I've done which is different to the GitHub code is create a separate AlertManager class that does the Twilio initialisation outside of an Activity.
At any moment a user must be able to open the app and tap a button which will (as quickly as possible) make an emergency call using Twilio.
My issue is that Twilio requires the creation of a clientDevice by requesting a "capabilityToken" from my server. That is fine, but the token expires after an hour.
Assuming there is always an external internet connection, how can I make it so my application always has a clientDevice (with a valid token) object available in memory somewhere, such that when the user enters the Activity to make an emergency call, they are able to do it immediately without the app having to request a new token nor create a new clientDevice?
From a quick test using Airplane mode and hard coding a valid token it appears the Twilio SDK can create a clientDevice as long as it has a token, i.e. only one network request is required to retrieve the token, rather than two if another is required to create the clientDevice.
I know I could use some kind of Service to fetch tokens, but I'm not entirely sure where I can store my clientDevice. It can't reside inside an Activity since the app will not always be running. I did wonder about creating my own Application class but as I understand it Android can and will create new instances of that class when it needs to which would then result in my clientDevice being removed from memory. Or is it possible to store it in the Service and then send some kind of broadcast to the Service to make the call?
I hope that makes some kind of sense and if anyone has any ideas it would be much appreciated.
Twilio developer evangelist here.
I have a couple of ideas about the token expiry.
First up, you can set the token expiry time up to 24 hours.
Second, you could use Twilio's AccessManager library that takes an access token and lets you listen to events for when a token is close to expiry or when it expires.
I don't know about keeping live objects while your application is in the background though I'm afraid. Hopefully someone else can help you here.
I have my VIOP call in action and the suddenly I get GSM call or something else so I need to put VOIP call on hold.
I found this https://www.twilio.com/blog/2009/09/call-queueing-putting-callers-on-hold-calll-redirect-new-url-new-feature.html
So now I thinks that I need to use twiml to place caller on hold
<Response>
<Say> Thank you for calling, a representative will be with you shortly</Say>
<Play loop="100">mymp3link</Play>
</Response>
And afterwards taking caller off hold with:
POST https://api.twilio.com/2008-08-01/Account/{YourAccountSid}/Calls/{WaitingCallersCallSid}
CurrentUrl=http://www.example.com/dial-representitive
But the main question is if this requests could help with my issue?
And if it can help how can I use my Android client to send this twiml request?? (with twilio library or with common HTTP request??)
P.S. Seems need Twilio evangelist here.
Twilio Documentarian here - will help if I can :)
For the initial use case you are describing (you are on a VoIP call with another party, and then receive a call that requires you to put the call on hold), I will suggest a path of least resistance, and we can iterate from there.
In the TwiML to initiate the call from the Android client, rather than using <Dial> to dial a number, consider creating a two-person <Conference>. Then if your Android client needs to jump off the conference call, they can simply rejoin the same conference call in progress once their non-VoIP call has ended.
I am developing a SIP based application. In general if one registered user of asterisk calls to the user who is not registered, in this scenario call takes some minutes to hangup and user needs to wait sometime to make another call.
So what I want to do is, I don't want to allow a caller to call that peer which is unregistered. So is there any parameter to set in asterisk peer settings to do this task.
I am using sipdroid for reference.
-Generally, asterisk returns "404 user not found" almost instantly if an user (callee) is not online. But, as per your case, if its taking time, you need to refine the code in siprdoid for response handling.
I have a big list of opt-in numbers.
Some of them are bogus or fake.
I need to write a small app that does the following:-
Read numbers from an excel file
Call each number: if the call gets through (the phone rings or is busy/engaged), we mark the number as valid in a new column in the excel sheet. If the number is invalid, we mark the number as invalid.
Is it possible to achieve this in Android?
Can we get the response status while making a call from the app?
Example: Status=Ringing, Status=Busy/Engaged, Status=Invalid etc
Is there a better way of finding if a phone number is valid or invalid?
You can't. You are unable to call any phone number other way than firing out an intent to invoke device's Phone app do the job, therefore full and smooth automation is hardly possible. You may try to do that and at the same time set up own listener to know if the call succeeded or not, but that's far from what you wanted.
You cannot do it in Android but you can develop it in a cloud-based IVR system using Call Control XML (CCXML) and a platform that has good call progress analysis, like Voxeo. Take a look at this Answer which provides more detail. Be careful with this type of solution as there are laws which govern automatic notification. Make sure people opt in for this type of notification/verification.
I am building an Android application that will automatically make calls and send SMSes to some telephone numbers.
The problem is I need to specify the duration (how long the call will last for) of all the calls.
Is there any way to specify the call duration from Java code? Or how do I cut the present outgoing call?
You may work on Java Runnables and then merge it with call and telephony API.