Closed GoogleCodeExporter closed 8 years ago
In addition,I captured the SIP/SDP message package by using Wireshark and find
that "o=doubango 1983 678901 IN IP4 10.0.2.15".I want to set "o=- 1983 678901
IN IP4 10.0.2.15",how to do it?
Original comment by yuwenbin...@gmail.com
on 9 Dec 2010 at 8:25
First update the source code to SVN revision 343.
sendLMessage() is now implemented.
To achieve your workflow:
// establish an MSRP session
ActionConfig sessionConfig = new ActionConfig();
MyMsrpSession msrpSession = MyMsrpSession.createOutgoingSession(sipStack, MediaType.Chat);
sessionConfig.addHeader("Subject","Hello");
msrpSession.session.callMsrp("+8521341041108", sessionConfig);
sessionConfig.delete();
// Once the session is established
if(msrpSession.isConnected())
{
byte[] content = "Hi buddy!".getBytes();
final ByteBuffer payload = ByteBuffer.allocateDirect(content.length);
payload.put(content);
ActionConfig messageConfig = new ActionConfig();
messageConfig.setMediaString(twrap_media_type_t.twrap_media_msrp, "content-type", "text/plain;charset=utf-8");
msrpSession.session.sendMessage(payload, (long)payload.capacity(), messageConfig);
}
Original comment by boss...@yahoo.fr
on 9 Dec 2010 at 4:34
Thank you for your help!
Original comment by yuwenbin...@gmail.com
on 9 Dec 2010 at 5:10
[deleted comment]
[deleted comment]
Dear yuwenbin...@gmail.com is the code of chat messaging work ?
Please answer .
It's only call and doesn't send message .
Please help .
Original comment by Arian.Sa...@gmail.com
on 13 Feb 2011 at 7:41
Yes,the code works.establish an MSRP session and send MSRP message must be
asynchronous
Original comment by Splash.P...@gmail.com
on 15 Feb 2011 at 3:15
Thanks for your answer,but I have some difficults.
I want to know except the code of top and the changes of revision 343,there are
not any changes in the other part of imsdroid project or there is no any
additional code which you didnn't write here.
Please help.I have already some days trying this ,but widthout any result.
Original comment by Arian.Sa...@gmail.com
on 16 Feb 2011 at 2:19
(msrpSession.isConnected()) its always return false .
Original comment by Arian.Sa...@gmail.com
on 16 Feb 2011 at 2:44
byte[] content = "Hi buddy!".getBytes();
final ByteBuffer payload = ByteBuffer.allocateDirect(content.length);
payload.put(content);
ActionConfig messageConfig = new ActionConfig();
messageConfig.setMediaString(twrap_media_type_t.twrap_media_msrp, "content-type", "text/plain;charset=utf-8");
msrpSession.session.sendMessage(payload, (long)payload.capacity(), messageConfig);
These code MUST be put when receiving 200OK(SIP).
for example,in SipService::OnInviteEvent method.
establish an MSRP session and send MSRP message must be asynchronous,this is
very importment.
Original comment by Splash.P...@gmail.com
on 16 Feb 2011 at 3:23
If it isn't difficult for you please write down the whole
SipService::OnInviteEvent method.
Please .
Thanks in advance.
Original comment by Arian.Sa...@gmail.com
on 16 Feb 2011 at 4:24
No problem.But you have to wait 2 days.
Original comment by Splash.P...@gmail.com
on 16 Feb 2011 at 4:37
[deleted comment]
[deleted comment]
addition.
Dear Splash.P...@gmail.com
Please write here any changes you done in your project for imsdroid chat
messaging
Thanks in advance .I will wait.
It's very important for me.
Original comment by Arian.Sa...@gmail.com
on 17 Feb 2011 at 12:50
[deleted comment]
Dear Splash.P...@gmail.com please answer is it possible to have
SipService::OnInviteEvent method tomorrow(on Friday)?
Original comment by Arian.Sa...@gmail.com
on 17 Feb 2011 at 7:11
[deleted comment]
[deleted comment]
Dear everybody
why the ruturn value is always "false" for follow funtion:
tinyWRAPJNI.MsrpSession_sendMessage__SWIG_0(swigCPtr, this, payload, len,
ActionConfig.getCPtr(config), config);
Original comment by sundl2...@gmail.com
on 18 Feb 2011 at 11:14
public int OnInviteEvent(InviteEvent e) {
short code = e.getCode();
String phrase = e.getPhrase();
tsip_invite_event_type_t type = e.getType();
//SipMessage message = e.getSipMessage();
InviteSession session = e.getSession();
session.accept();
ChatService cs = ChatService.getChatService();
if(code > 399 && code < 500){
Log.d("MSRP_TEST","xxx");
}
if(code == 200 && session!=null){
if(cs.sendMessage("Hello World!")){
Log.d("MSRP_TEST","sendMessage Hello World! true!");
}
else{
Log.d("MSRP_TEST","sendMessage Hello World! false!");
}
}
Original comment by Splash.P...@gmail.com
on 18 Feb 2011 at 12:28
public boolean sendMessage(String messageBody){
Log.d("MSRP_TEST","msrpSession ID-->"+msrpSession.getId());
if(!msrpSession.isConnected()){
Log.d("MSRP_TEST","msrpSession is not connected");
msrpSession.setConnected(true);
//return false;
}
if(msrpSession.isConnected()){
Log.d("MSRP_TEST","msrpSession is connected");
}
byte[] content = messageBody.getBytes();
final ByteBuffer payload = ByteBuffer.allocateDirect(content.length);
payload.put(content);
ActionConfig messageConfig = new ActionConfig();
messageConfig.setMediaString(twrap_media_type_t.twrap_media_msrp, "Content-Type", "text/plain;charset=utf-8");
if(msrpSession.session.sendMessage(payload, (long)payload.capacity(), messageConfig)){
Log.d("MSRP_TEST",messageBody+" MSRP message send!");
return true;
}
else{
Log.d("MSRP_TEST",messageBody+" MSRP message send error!");
return false;
}
}
Original comment by Splash.P...@gmail.com
on 18 Feb 2011 at 12:29
[deleted comment]
Thank you very much.
but in onInviteEvent method the code's value always equals to 100 and
it is not become 200.
Can you say what can be the reason? or I do smth. wrong.
Please answer.
Original comment by Arian.Sa...@gmail.com
on 18 Feb 2011 at 2:16
Issue 142 has been merged into this issue.
Original comment by boss...@yahoo.fr
on 18 Feb 2011 at 2:36
If you want help you should send network trace (wireshark) and provide more
information:
Which client are you using on the remote side?
Are you using a real device or the emulator?
BTW the code I provided in comment 2 should work without any problem.
Original comment by boss...@yahoo.fr
on 18 Feb 2011 at 2:38
A Invite B,then B receive a INVITE message.B accept this INVITE and 200 OK will
be sent.
Original comment by Splash.P...@gmail.com
on 18 Feb 2011 at 2:47
I am running project on emulator and I use x-lite4.
But can an emulator be the reason of my problem?
Thanks in advance.
Original comment by Arian.Sa...@gmail.com
on 18 Feb 2011 at 2:55
It will not work on the emultor as the ip address is not routable and I don't
think that xlite support MSRP.
Original comment by boss...@yahoo.fr
on 18 Feb 2011 at 2:59
You are wrong.It may work on the emultor.I ever used two emultor(run
IMSDroid).chat message may be received.
Original comment by Splash.P...@gmail.com
on 18 Feb 2011 at 4:05
OK if "Splash.P...@gmail.com" say it. He is the expert ;)
@Arian.Sa...@gmail.com: Issue 142 has been merged into this issue so you don't
need to always send on both.
Original comment by boss...@yahoo.fr
on 18 Feb 2011 at 4:17
Hi Everybody.
I want to know how to get the reiceved message(incoming message)
someone can write the code or a attach a file of getting incoming message?
Original comment by timeandr...@time.com
on 18 Feb 2011 at 7:02
Please help me.
I want to know in OnInviteEvent method we must call sendMessage method and in
the same onInviteEvent method we must call a takeIncomingSession method.
and in which cases they called
Pleease write smth here.
Original comment by timeandr...@time.com
on 19 Feb 2011 at 5:34
Please write smth Dear Splash.P...@gmail.com and Dear boss...@yahoo.fr.
I am waiting to Your answer.
Original comment by timeandr...@time.com
on 20 Feb 2011 at 3:11
Thanks Splash.P...@gmail.com and boss...@yahoo.fr for help.
Original comment by Arian.Sa...@gmail.com
on 20 Feb 2011 at 4:04
Now I can send message and I have the same question in onInviteEvent method in
which case I will add takeIncomingSession() method .
Please answer I have already work on chat messaging very long time.
Thanks in advance.
Original comment by Arian.Sa...@gmail.com
on 20 Feb 2011 at 6:40
[deleted comment]
I can't send message
when the code=200,I call the sendMessage() method of ChatService's class,then
call the method msrpSession.session.sendMessage(payload,
(long)payload.capacity(), messageConfig)) that in the MrspSession class
,finally,call tinyWRAPJNI.MsrpSession_sendMessage__SWIG_0(swigCPtr, this,
payload, len, ActionConfig.getCPtr(config), config).
but the function of tinyWRAPJNI.MsrpSession_sendMessage__SWIG_0 is always
return false
Please answer what reason for it?
Original comment by sundl2...@gmail.com
on 21 Feb 2011 at 3:46
Attachments:
Dear Splash.P...@gmail.com
why the ims client can't accept the message when i send a message?
please help
Original comment by sundl2...@gmail.com
on 21 Feb 2011 at 8:20
[deleted comment]
@timeandr...@time.com
First, you should know that MSRP messaging is not officially supported in
IMSDroid. However, you have all functions you need to implement a chat client
as per RFC 4975. The best way to get started is to see how file transfer (MSRP)
is implemented in IMSDroid. You can also checkout the source of Boghe
(http://code.google.com/p/boghe) which support MSRP messaging and uses the same
API (Doubango).
You don't need to call sendMessage() in OnInviteEvent().
- OnInviteEvent() is a callbak function called from the native code (Doubango)
to the managed (imsdroid). This function is called to notify you about the
incoming/outgoing messages associated to this session. You should also see
OnDialogEvent() which monitor the sip session state
(connecting,connected,terminating,terminated).
- takeIncomingSession() is used to take a reference to the session otherwise it
will be destroyed by the garbage collector if the reference count reach zero.
This function will also add the session to a static map to allow you to
retrieve it from any function in your code.
- sendMessage() is called to send a MSRP message. This function will only
succeed if the session is connected (mSession.isConnected()). The session state
is set to "connected" by OnDialogEvent() callback when you receive 200 INVITE
response.
Last and not least: To get help you MUST attach both network (Wireshark) and
device logs (DDMS). Doubango log tag: "tinyWRAP".
Original comment by boss...@yahoo.fr
on 21 Feb 2011 at 8:40
@sundl2...@gmail.com
Please attach both network (Wireshark) and device logs (DDMS).
Original comment by boss...@yahoo.fr
on 21 Feb 2011 at 8:43
Thanks .
Maybe I wrote smth wrong and you didn't understand me right
I want to know how to get incoming messages.
Please help me
Original comment by timeandr...@time.com
on 21 Feb 2011 at 10:28
@timeandr...@time.com
Incoming MSRP messages (chat) are receive as MSRP file messages.
OnInviteEvent() and OnDialogEvent() are only used for SIP signaling layer.
// 1. create the MSRP messaging session
MyMsrpSession mSession =
MyMsrpSession.createOutgoingSession(ServiceManager.getSipService().getStack()
, MediaType.Chat);
// 2. Hook the MSRP callback in order to receive incoming requests or responses
mSession.setCallback(new MsrpCallback(){
@Override
public int OnEvent(MsrpEvent e) {
@SuppressWarnings("unused")
final MsrpSession session = e.getSipSession();
final MsrpMessage message = e.getMessage();
if(message == null){
return -1;
}
if(message.isRequest()){ // You have received a request
switch(message.getRequestType()){
case tmsrp_SEND: // You have received Chuck
// see file transfer to understand how to get content data, MSRP headers and
// byte-byte range
break;
case tmsrp_REPORT: break;
default :case tmsrp_AUTH: break;
}
}
else{ // You have received a response to a reguest (SEND,AUTH or REPORT)
@SuppressWarnings("unused")
final short code = message.getCode();
// see file transfer to understand how to get content data, MSRP headers and
// byte-byte range
}
return 0;
}
});
3. send the message as explained in comment 2
Original comment by boss...@yahoo.fr
on 21 Feb 2011 at 10:57
Thanks.
But if it is not so diffiult for you write in which part of file transfer I
shall look
to understand for my chat messaging,or write smth else that can help me
more,(Please)
I am new in android and that is why I have some difficults ,but I have great
desire to understand chat messaging, and want that chat messaging work in my
project.
Thanks in advance ,
I will wait to your answer.
Original comment by timeandr...@time.com
on 21 Feb 2011 at 11:50
MSRP callback used to receive chunks (file transfer):
http://code.google.com/p/imsdroid/source/browse/trunk/imsdroid/src/org/doubango/
imsdroid/sip/MyMsrpSession.java#386
Original comment by boss...@yahoo.fr
on 21 Feb 2011 at 2:14
[deleted comment]
Thank you for your help
Addition,I want to know that the detail steps of sending a message
Original comment by sundl2...@gmail.com
on 21 Feb 2011 at 4:04
Hi,all
How to send a message by calling messagingSession ? Addition,which steps will be call
Original comment by sundl2...@gmail.com
on 24 Feb 2011 at 9:04
Hi,
Please can you attach the whole classes of chat messaging .
I am new to android and have some difficults.
I look what you write above,and I could understand ,but I can't understand
where this methods will be written
for example the onInviteEvent() method and how I will write in code that for
chat messaging will work onInvteEvent()(I can't understand the connection of
this methods)
Thanks in advance.
Any advice will help me.
Original comment by s...@android.com
on 2 Mar 2011 at 3:50
Original issue reported on code.google.com by
yuwenbin...@gmail.com
on 9 Dec 2010 at 7:21