ykjainth / imsdroid

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

HELP!HELP!HELP!HELP!HELP!HELP!HELP! #221

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I want to start "NativeService".
But it throws exception below.

Please write a example on how to start this service if you were kind.

thx

Original issue reported on code.google.com by max_yong...@163.com on 27 Apr 2011 at 9:04

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
To get help please explain what you want to do and provide the code used to 
start the NativeService.

Original comment by boss...@yahoo.fr on 28 Apr 2011 at 12:38

GoogleCodeExporter commented 9 years ago
Thanks for you help! 
I want to do a simple example,It's only call.
outgoing is ok.
but I don't know how to monitor the Incoming and display it.

Original comment by max_yong...@163.com on 28 Apr 2011 at 3:18

GoogleCodeExporter commented 9 years ago
final BroadcastReceiver mSipBroadCastRecv = new BroadcastReceiver() {
                                @Override
                                public void onReceive(Context context, Intent intent) {
                                                InviteState state;
                                                final String action = intent.getAction();
                                                if(NgnInviteEventArgs.ACTION_INVITE_EVENT.equals(action)){
                                                                NgnInviteEventArgs args = intent.getParcelableExtra(NgnEventArgs.EXTRA_EMBEDDED);
                                                                if(args == null){
                                                                                Log.e(TAG, "Invalid event args");
                                                                                return;
                                                                }
                                                                Log.d(TAG, "This is an event for session number "+args.getSessionId());                         
                                                                // Retrieve the session from the store
                                                                NgnAVSession avSession = NgnAVSession.getSession(args.getSessionId());
                                                                if(avSession == null){
                                                                                Log.e(TAG, "Cannot find session");
                                                                                return;
                                                                }
                                                                switch((state = avSession.getState())){
                                                                                case NONE:
                                                                                default:
                                                                                                break;

                                                                                case INCOMING:
                                                                                                Log.i(TAG, "Incoming call");
                                                                                                break;

                                                                                case INPROGRESS:
                                                                                                Log.i(TAG, "Call in progress");
                                                                                                break;

                                                                                case REMOTE_RINGING:
                                                                                                Log.i(TAG, "Remote party is ringing");
                                                                                                break;

                                                                                case EARLY_MEDIA:
                                                                                                Log.i(TAG, "Early media started");
                                                                                                break;

                                                                                case INCALL:
                                                                                                Log.i(TAG, "Call connected");
                                                                                                break;

                                                                                case TERMINATING:
                                                                                                Log.i(TAG, "Call terminating");
                                                                                                break;

                                                                                case TERMINATED:
                                                                                                Log.i(TAG, "Call terminated");
                                                                                                break;
                                                                }
                                                }
                                }
                };

Original comment by boss...@yahoo.fr on 29 Apr 2011 at 7:23

GoogleCodeExporter commented 9 years ago
Off course you must register the broadcast receiver like this:
final IntentFilter intentFilter = new IntentFilter();
                                intentFilter.addAction(NgnInviteEventArgs.ACTION_INVITE_EVENT);
                    registerReceiver(mSipBroadCastRecv, intentFilter);

Original comment by boss...@yahoo.fr on 29 Apr 2011 at 7:37

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
you did me a great favor.
I will take a closer look.
thanks a lot again!

Original comment by max_yong...@163.com on 29 Apr 2011 at 7:53

GoogleCodeExporter commented 9 years ago

Original comment by boss...@yahoo.fr on 19 May 2011 at 5:11