Re: [OpenSIPStack] Call back for an Invite Response in theTestapplication
Brought to you by:
joegenbaclor
|
From: Joegen B. <joe...@gm...> - 2009-04-07 12:30:09
|
Hi,
Sorry for the late response. You can get incoming SIPMessages in
SIPUserAgent::ProcessEvent(). If you are using TestRegistration as your
basis, then TestRegistration::ProcessEvent() is where you should look at.
Add the following code inside that function to get the BYE request
if( event->GetType() == SIPStackEvent::Message )
{
SIPMessageArrival & msgEvent = (SIPMessageArrival&)*event;
SIPMessage bye = msgEvent.GetMessage();
SIPMessage ok;
bye.CreateResponse( SIPMessage::Code200_Ok, ok );
SendRequest( ok );
}
HTH,
Joegen
--------------------------------------------------
From: "Jyothsna Banda" <jyo...@gm...>
Sent: Tuesday, April 07, 2009 3:10 PM
To: "Joegen Baclor" <jb...@so...>
Cc: <ope...@li...>
Subject: Re: [OpenSIPStack] Call back for an Invite Response in
theTestapplication
> Hi All,
>
> Please can any one look into this issue?
>
> For the issue please check the below mails.
>
>
> Br,
> Jyothsna
> On Mon, Apr 6, 2009 at 11:42 AM, Jyothsna Banda
> <jyo...@gm...>wrote:
>
>> Hi Joegen,
>>
>> Can u help?Iam stucked at this point.
>>
>> Not getting call back to the test application when the BYE is sent from
>> the other end(SJPhone)
>>
>>
>> Thanks in advance
>> Br,
>> Jyothsna
>>
>> On Thu, Apr 2, 2009 at 5:59 PM, Jyothsna Banda
>> <jyo...@gm...
>> > wrote:
>>
>>> Hi Joegen,
>>>
>>> Yes the ACk was not formed properly.
>>>
>>> Now I corrected and able to send the message.Call is established.
>>>
>>> Now at the other end(SJPhone) call is ended.So the BYE is sent from the
>>> SJPhone,Iam not getting call back to the Test application.
>>>
>>> Where will we i get the call back for the BYE request?I have kept a
>>> break
>>> point at SIPStack onreceived message also.But not received.
>>>
>>>
>>>
>>> Br,
>>> Jyothsna
>>>
>>>
>>>
>>>
>>> On Thu, Apr 2, 2009 at 5:06 PM, Joegen Baclor
>>> <joe...@gm...>wrote:
>>>
>>>> You should start by reading RFC 3261. ACK should follow the rules of
>>>> constructing messages within the dialog. Looking briefly at the code,
>>>> the
>>>> ACK that will be sent out will be missing a to-tag. This must be why
>>>> the
>>>> UAS is discarding the ACK.
>>>>
>>>>
>>>>
>>>> *From:* Jyothsna Banda <jyo...@gm...>
>>>> *Sent:* Thursday, April 02, 2009 3:24 PM
>>>> *To:* Joegen Baclor <jb...@so...>
>>>> *Cc:* ope...@li...
>>>> *Subject:* Re: [OpenSIPStack] Call back for an Invite Response in the
>>>> Testapplication
>>>>
>>>> Hi Joegen,
>>>>
>>>> If i send the message in the below way,if we chekc in th wireshar ACK
>>>> message is having
>>>> CSeq as 1 INVITE only.
>>>>
>>>> so what i did is:
>>>>
>>>>
>>>> Send_ACK(
>>>> const SIPMessage & message)
>>>>
>>>> {
>>>>
>>>> SIPMessage ack;
>>>>
>>>> SIPMessage sdp;
>>>>
>>>> const Via & via = message.GetTopVia();
>>>>
>>>> OString branch = via.GetBranch();
>>>>
>>>> if( sdp.HasSDP() )
>>>>
>>>> {
>>>>
>>>> ack.SetBody( sdp.GetBody() );
>>>>
>>>> }
>>>>
>>>> ack.SetInterfaceAddress(via.GetAddress());
>>>>
>>>> ack.SetInterfacePort(via.GetPort());
>>>>
>>>> CSeq cseq;
>>>>
>>>> cseq.SetMethod(
>>>> "ACK" );
>>>>
>>>> cseq.SetSequence( message.GetCSeqNumber() );
>>>>
>>>> ack.SetCSeq( cseq );
>>>>
>>>> if
>>>> ( message.GetTransaction() != NULL )
>>>>
>>>> {
>>>>
>>>> SIPFSM::InviteClientTransaction * trn =
>>>> dynamic_cast<SIPFSM::InviteClientTransaction*>(message.GetTransaction());
>>>>
>>>>
>>>> if( trn != NULL )
>>>>
>>>> trn->SetFinalACK( ack );
>>>>
>>>> }
>>>>
>>>> m_UA->GetStack().EnqueueTransportWriteEvent(ack);
>>>>
>>>> }
>>>>
>>>> but when i debug the code internally in the
>>>> EnqueueTransportWriteEvent(),it is calling SIPMessage method
>>>> ProcessOutBound
>>>> there it is cleaning all the message varaibles and deleting the
>>>> event.so the
>>>> message is not at all going from one to the other end.
>>>>
>>>> How to proceed further?Please can u look in to this?
>>>>
>>>>
>>>> Br,
>>>> Jyothsna
>>>> On Thu, Apr 2, 2009 at 11:11 AM, Jyothsna Banda <
>>>> jyo...@gm...> wrote:
>>>>
>>>>> Hi Joegen,
>>>>>
>>>>> Thanks again for the quick response.
>>>>>
>>>>> By using that method iam sending the ACK,in wireshark it is showing
>>>>> ,but
>>>>> the SJphone is not receiving the ACK message? check the below sample
>>>>> code
>>>>> how iam sending from the test application.
>>>>>
>>>>> /*********** sample code ***********/
>>>>>
>>>>>
>>>>> OStringStream msg;
>>>>>
>>>>> msg <<
>>>>> "ACK " << "sip:" << m_Domain <<":"<<"5060"<< " SIP/2.0" << "\r\n";
>>>>>
>>>>> msg <<
>>>>> "From: <sip:" << m_ListenerIP<< ">" << ";tag=" <<
>>>>> ParserTools::GenTagParameter() << "\r\n";
>>>>>
>>>>> msg <<
>>>>> "To: <sip:" << m_ToUser << m_Domain << ">" << "\r\n";
>>>>>
>>>>> msg <<
>>>>> "Contact: " << "<" << m_ContactURI << ">" << "\r\n";
>>>>>
>>>>> msg <<
>>>>> "Via:" << "SIP/2.0/UDP " << m_ListenerIP <<";branch=" <<
>>>>> ParserTools::GenBranchParameter() << "\r\n";
>>>>>
>>>>> msg <<
>>>>> "CSeq: 1 ACK" << "\r\n";
>>>>>
>>>>> msg <<
>>>>> "Max-Forwards:" << "70" << "\r\n";
>>>>>
>>>>> msg <<
>>>>> "Call-ID: " << ParserTools::GenGUID() << "\r\n";
>>>>>
>>>>> msg <<
>>>>> "Content-Length: 0" <<"\r\n";
>>>>>
>>>>> Parse( msg.str() );
>>>>>
>>>>> TransactionId tid;
>>>>>
>>>>> m_UA->GetStack().EnqueueTransportWriteEvent(*
>>>>> this);
>>>>>
>>>>> /************************************************************************/
>>>>> Can we use call session from test application,How to call the call
>>>>> session methods?
>>>>>
>>>>> where it is being used?
>>>>>
>>>>> i think call session is having full functionality for call
>>>>> establishment?
>>>>>
>>>>>
>>>>> Can u tell me the code flow for eatblishing a call from my test
>>>>> application?
>>>>>
>>>>>
>>>>> Br,
>>>>> Jyothsna
>>>>> On Thu, Apr 2, 2009 at 6:03 AM, Joegen Baclor <
>>>>> joe...@gm...> wrote:
>>>>>
>>>>>> Ahhh, I see what you are doing wrong. You don’t use
>>>>>> FindTransactionAndAddEvent() to send ACK because ACK never creates a
>>>>>> transaction. Instead you must use
>>>>>> GetStack().EnqueueTransportWriteEvent(
>>>>>> ack );
>>>>>> Look at BOOL CallSession::SendAck( const SIPMessage & response,
>>>>>> constSIPMessage & sdp ) for a sample implementation.
>>>>>>
>>>>>> HTH,
>>>>>>
>>>>>> Joegen
>>>>>>
>>>>>> *From:* Jyothsna Banda <jyo...@gm...>
>>>>>> *Sent:* Wednesday, April 01, 2009 8:41 PM
>>>>>> *To:* Joegen Baclor <jb...@so...> ;
>>>>>> ope...@li...
>>>>>> *Subject:* Re: [OpenSIPStack] Call back for an Invite Response in the
>>>>>> Testapplication
>>>>>>
>>>>>>
>>>>>> Hi Joegen,
>>>>>>
>>>>>> Thanks for the reply.
>>>>>>
>>>>>> Iam using the same test registration application.
>>>>>>
>>>>>> Scenario: Sending Invite from Testapplication to SJPhone(running in
>>>>>> another system)
>>>>>>
>>>>>> I have added few methods in Register Class for Invite,ACK and 200_OK.
>>>>>>
>>>>>> Instead of sending the Registration ,iam calling the Invite method
>>>>>> which i have added.
>>>>>>
>>>>>> Find the attached Source file and XML ,reading the values from this
>>>>>> file.
>>>>>>
>>>>>> Now iam getting call back (200OK)to onreceived message,there iam
>>>>>> preparing the ACK and sending back.but ACk is not going.
>>>>>>
>>>>>> Please check the code and let me know whether iam doing something
>>>>>> wrong
>>>>>> .
>>>>>>
>>>>>> Br,
>>>>>> Jyothsna
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Apr 1, 2009 at 5:14 PM, Joegen Baclor
>>>>>> <joe...@gm...
>>>>>> > wrote:
>>>>>>
>>>>>>> Can you publish the test application code? I want to see how you
>>>>>>> are
>>>>>>> sending the INVITE out so we have something in common to look at.
>>>>>>> Tools/TestRegistration sample application in OpenSBC demonstrates
>>>>>>> pretty
>>>>>>> basic transaction callbacks. You might want to start with that as
>>>>>>> well.
>>>>>>>
>>>>>>>
>>>>>>> --------------------------------------------------
>>>>>>> From: "Jyothsna Banda" <jyo...@gm...>
>>>>>>> Sent: Wednesday, April 01, 2009 5:53 PM
>>>>>>> To: <ope...@li...>
>>>>>>> Subject: [OpenSIPStack] Call back for an Invite Response in the
>>>>>>> Testapplication
>>>>>>>
>>>>>>> > Hi,
>>>>>>> >
>>>>>>> > I have tried two scenarios for sending an Invite Request:
>>>>>>> >
>>>>>>> > First Scenario:
>>>>>>> >
>>>>>>> > Iam sending an Invite request thru test application to SJPhone
>>>>>>> running on
>>>>>>> > another machine.
>>>>>>> >
>>>>>>> > receiving the 200 Ok from Sjphone to test application. Where will
>>>>>>> > we
>>>>>>> get
>>>>>>> > the
>>>>>>> > call back in Test application, so that we can send an Ack for the
>>>>>>> 200 ok
>>>>>>> > response.
>>>>>>> >
>>>>>>> > Second Scenario:
>>>>>>> >
>>>>>>> > when sending the Invite message from test application to
>>>>>>> OpensipStack
>>>>>>> > server
>>>>>>> > running on the other message,
>>>>>>> > getting the 100 Trying call back in the test application
>>>>>>> > Onreceived
>>>>>>> > message.Here how to send the 200 ok response from test application
>>>>>>> acting
>>>>>>> > as
>>>>>>> > a user agent server.Also how to set the test application as User
>>>>>>> Agent
>>>>>>> > server?
>>>>>>> >
>>>>>>> >
>>>>>>> >
>>>>>>> > Can any one please help.
>>>>>>> >
>>>>>>> > Br,
>>>>>>> > Jyothsna
>>>>>>> >
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> > _______________________________________________
>>>>>>> > opensipstack-devel mailing list
>>>>>>> > ope...@li...
>>>>>>> > https://lists.sourceforge.net/lists/listinfo/opensipstack-devel
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> >
>>>>>>> > No virus found in this incoming message.
>>>>>>> > Checked by AVG - www.avg.com
>>>>>>> > Version: 8.0.238 / Virus Database: 270.11.35/2033 - Release Date:
>>>>>>> 03/31/09
>>>>>>> > 13:05:00
>>>>>>> >
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> _______________________________________________
>>>>>>> opensipstack-devel mailing list
>>>>>>> ope...@li...
>>>>>>> https://lists.sourceforge.net/lists/listinfo/opensipstack-devel
>>>>>>>
>>>>>>
>>>>>> ------------------------------
>>>>>>
>>>>>>
>>>>>> No virus found in this incoming message.
>>>>>> Checked by AVG - www.avg.com
>>>>>> Version: 8.0.238 / Virus Database: 270.11.35/2033 - Release Date:
>>>>>> 03/31/09 13:05:00
>>>>>>
>>>>>>
>>>>>
>>>> ------------------------------
>>>>
>>>>
>>>> No virus found in this incoming message.
>>>> Checked by AVG - www.avg.com
>>>> Version: 8.0.238 / Virus Database: 270.11.37/2036 - Release Date:
>>>> 04/01/09 21:02:00
>>>>
>>>>
>>>
>>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> _______________________________________________
> opensipstack-devel mailing list
> ope...@li...
> https://lists.sourceforge.net/lists/listinfo/opensipstack-devel
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.0.238 / Virus Database: 270.11.44/2044 - Release Date: 04/06/09
> 18:59:00
>
|