naresh924 / csipsimple

Automatically exported from code.google.com/p/csipsimple
0 stars 0 forks source link

Add public API to allow extensibility of the outgoingcall chooser #110

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Support web based callback.

Original issue reported on code.google.com by r3gis...@gmail.com on 26 Jul 2010 at 10:42

GoogleCodeExporter commented 9 years ago
it would be nice to support Betamax callback too.
we already have access to the "API" for costs.

Original comment by ferna...@bugabundo.net on 20 Feb 2011 at 10:42

GoogleCodeExporter commented 9 years ago
Hi.

For betamax providers should be easy to implement using their api.
https://myaccount.12voip.com/clx/makecall.php?username=_USERNAME_&password=_PASS
WORD_&from=_FROM_&to=_TO_
This feature is very useful when we are only with GPRS or a bad 3G reception.
The config its the same we use in SIP, user,pass and contact to call, picked in 
contact list ( TO ), so we just need a button and a field to put our own number 
(FROM)
The only  problem that i identify with this solution if if the user want to 
cancel the call, i cant find any request in their api to cancel the previous 
http request...

Keep up with excellent work

Original comment by pacard...@gmail.com on 20 Feb 2011 at 11:05

GoogleCodeExporter commented 9 years ago
Apart from csipsimple for SIP calls, I'm currently using InternetCall 
(https://market.android.com/details?id=com.ggp.internetcall) for BetaMax 
callback and access number dialing. It would be great however if these two 
features could be integrated into csipsimple so I can remove InternetCall and 
save a screen tap on each call.

I see two obvious ways to implement this:
1. Add this functionality to the current BetaMax providers. However this means 
that a single profile needs to support three different ways of calling, which 
probably means quite a lot of code changes.
2. Add two new provider types; a HTTP callback implementation that simply calls 
the above-mentioned URL, and a direct call type that simply prefixes the 
current number with a configured Betamax access number and uses the Android 
Dialer to call this number.

For users that want to try both csipsimple and InternetCall together, here's 
what my current setup looks like. I installed InternetCall first, csipsimple 
second (I guess installing the other way around will give a different 
experience, anyone willing to test?).

With my current setup, when dialing a number from the Android dialer I get a 
screen where I can choose the following:
- Dialer, which will pop-up the csipsimple screen where I can choose either 
BetaMax SIP or default dialer.
- InternetCall Callback, which will use the Betamax API as mentioned in the 
previous comment to trigger callback. 
- InternetCall Direct, which will prefix the number with the Betamax access 
number (e.g. +31107441675,,<numbertocall>) and then call that number using the 
Android dialer. 

In order to get this to work, I added the following filters to csipsimple:
- Betamax can't call numbers starting with the InternetCall Direct access 
number (to prevent csipsimple to pop up when selecting InternetCall Direct on 
the first pop-up)
- InternetCall Direct and InternetCall Callback cannot call any number.

Original comment by ruud.sen...@gmail.com on 28 May 2011 at 2:59

GoogleCodeExporter commented 9 years ago
Issue 643 has been merged into this issue.

Original comment by r3gis...@gmail.com on 26 Jun 2011 at 9:20

GoogleCodeExporter commented 9 years ago
Solution will be to have a public API to allow extensibility of the 
outgoingCall receiver/activity.

Basically should allow a third party app to register an intent receiver that 
will recieve an intent that ask whether it can handle one "number", what to 
show to user in the row and what is the intent to launch when pressed.

It will allow web based callback, calling card functionnality and third party 
apps integration.

Original comment by r3gis...@gmail.com on 26 Jun 2011 at 9:21

GoogleCodeExporter commented 9 years ago
Good news, this issue is about to be closed.

Next nightly build will have everything to allow third party plugins to extends 
behavior of the outgoing call handler.

So you'll need 
 * next nightly build (r973 or upper -- will be built tonight)
 * A plugin to fit your needs. For now I did one plugin that is available here :
http://nightlies.csipsimple.com/plugins/ 
For all betamax accounts. It has all features provided by internet-call 
application but cleanly integrated to CSipSimple.

Benefits of having it like that :
 * All rewriting / force call / never call rules of CSipSimple can applies to these plugins !
 * You can extend the app the way you want with all plugins that will hopefully be contributed (I think that I'll do the skype plugin tonight -- the betamax plugin took me about 1/2 day to do... so I guess many other developers will be able to do their own plugins too).
 * You can use plugins within csipsimple dialers (digit and text/contact/autocomplete dialer) (using the account choose button on the top right of the dialer)

If some developer wants to create his own plugin for csipsimple call handler, I 
released under Apache license on Github source code of : 
 * the betamax call handler ( https://github.com/r3gis3r/CSipSimple-CallHandler-plugins/tree/master/CallHandlerBetamax )
 * a very basic sample to understand how it works (for 12voip) : (https://github.com/r3gis3r/CSipSimple-CallHandler-plugins/tree/master/CallHandlerTwVoip)

I'll add to this github repo all other callhandlers I'll release.
(For now, skype and a basic and configurable Calling Card plugins are planned).

Original comment by r3gis...@gmail.com on 3 Jul 2011 at 9:17

GoogleCodeExporter commented 9 years ago
Issue 899 has been merged into this issue.

Original comment by r3gis...@gmail.com on 3 Jul 2011 at 9:19

GoogleCodeExporter commented 9 years ago
Skype plugin also added now.

I also did a quick fix on Betamax plugin so if you download it previously, 
re-download ;). (Else access number calls will not work ;) ).

Original comment by r3gis...@gmail.com on 3 Jul 2011 at 9:57

GoogleCodeExporter commented 9 years ago
Hi,
I used your template to create custom WEB callback plug-in and found a bug in 
Intent logic regarding PendingIntent.getBroadcast().

The thing is that there are being always created new intets with different 
extended data EXTRA_PHONE_NUMBER, but they might not be always used or 
destroyed and reside in memory. Therefore while called next time, the called 
phone number might not be the called one but any of the previously called, 
typically the first phonenumber called after the phone reboot.

As a workaround I used:

PendingIntent.getBroadcast(context, 0, i, FLAG_UPDATE_CURRENT );

Which uses the existing intent and only updates extended data, the 
EXTRA_PHONE_NUMBER carrying the actual phone number to be called.

--
Milan Benicek
SIPhone s.r.o.

Original comment by milan.be...@siphone.cz on 19 Jul 2011 at 10:24

GoogleCodeExporter commented 9 years ago
Yes, you're right. I missed that but extra are not part of what make an 
pendingIntent unique.

So you're right the flag should be set either to UPDATE_CURRENT or maybe better 
to CANCEL_CURRENT (in case your intent has others extra you don't want to see 
anymore it's safer to use CANCEL).

I'll update sample projects. Thx for poiting this out :) !

Original comment by r3gis...@gmail.com on 19 Jul 2011 at 2:47

GoogleCodeExporter commented 9 years ago

Original comment by r3gis...@gmail.com on 24 Nov 2011 at 5:25