I have seen your question in several different forums. The right place for this question is [email protected].
The method in question is deprecated. I am going to be changing that to throw exception and not return null pointer. You will need to store the Dialog, transaction association in a table or you can make up a "DialogContext" or "ApplicationData" structure and use that to store the association. DialogContext dialogContext = new DialogContext(); dialogContext.setTransaction(transaction); dialog.setApplicationData(dialogContext); No DialogContext is NOT part of the API. It is up to you to define such a structure. Thanks. On Tue, Jun 22, 2010 at 1:05 PM, ashu sinha <[email protected]> wrote: > Hi , > After searching alot in google, I am not able to solve 1 problem and I > got a post of 2008 in which I found your email id.So, I am sending you this > mail, in hope that you can help me. > > I am trying to achieve the HOLD functionality. I am using JAIN SIP > API. I got so many theory on how to achieve the hold functionality. > But, I am facing a problem that, I got information that I should sent Invite > Request using the same dialog for HOLD with a=sendonly and otherside send OK > with a=recvonly. > I am doing this but sending new invite i.e. from UI on pressing the hold > button, making the flow same as for fresh Invite Request except the > attributes part(that is, sendonly, recvonly). > > > Here is the code that I am trying:- > > > > if (request.getMethod().equals(Request. INVITE )) { > > if (serverTransaction.getDialog().getState() == null ) { > > messageProcessor .processInvite(serverTransaction, > request); // this as you mentioned in your code > > > > } else { > > *String rawContent > =serverTransaction.getRequest().getRawContent().toString(); * > > javax.sdp.SessionDescription sessionDescription = null ; > > > try { > > sessionDescription = > SdpFactory.getInstance().createSessionDescription(rawContent); > > > > Vector<AttributeField> attributeFields = > sessionDescription.getAttributes( true ); > > String attributeType= "" ; > > for ( int x=0; x<attributeFields.size(); x++){ > > > attributeType=attributeFields.get(x).getName().trim().toLowerCase(); > > > if (attributeType.equalsIgnoreCase( "sendrecv" > )||attributeType.equalsIgnoreCase( "sendonly" ) > ||attributeType.equalsIgnoreCase( "recvonly" )) > > break ; > > } > > > > if (attributeType.equalsIgnoreCase( "sendonly" )){ > > //We got a hold request,so we will send Ok to > other party with recvonly attribute > > sipMeetingManager .sendHoldOk(serverTransaction, > request); > > } > > else if (attributeType.equalsIgnoreCase( "sendrecv") > > > //We got an *un *-hold request on basis of > sendrecv > > sipMeetingManager > .sendUnHoldOk(serverTransaction, > request); > > } > > } catch (Exception e){ > > e.printStackTrace(); > > } > > } > > } > > So, I have created the functions sendHoldOk and SendUnholdOk by following > the same body as provided by you in Jain Sip. > > The problem is in the red line above that after getting hold request it gets > hold but in this line it comes NULL POINTER EXCEPTION. > > > > I am struggling to know that as there is way to know the transaction details > as happens in firstTransaction by using Dialog as:- > dialog.getFirstTransaction().getRequest().getMethod().equals(Request. *INVITE > *). > > So that we can easily send OK or ACK to the request. > > How I can know the other requests which are not under FirstTransaction so > that for HOLD and UNHOLD requests I can send the OK or ACK. > > > > Plz provide me some help. > Thanks in advance. > _______________________________________________ > Sip-implementors mailing list > [email protected] > https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors > -- M. Ranganathan _______________________________________________ Sip-implementors mailing list [email protected] https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors
