[SIPForum-discussion] Unsubscribe

aditi g pallavim35 at gmail.com
Fri Mar 23 08:22:10 UTC 2007


Hello

Here when you are sending Invite to hold the call,it is Reinvite that you
have to send.
So from code ,i could see that you are creating new client
transaction.Thisis wrong as for hold ,
you have send REinvite with same sip header as orginal invite but with
different SDP where you can
specify a= sendonly.You do not have to create new transaction.
Thanks


On 3/23/07, HYUNGON KIM <peter324.kim at samsung.com> wrote:
>
> Unsubscribe
>
>
>
>
>
>
> ------- *Original Message* -------
> *Sender* : Danish Zaidi<danishzaidi54 at yahoo.com>
> *Date* : 2007-03-23 08:50
> *Title* : [SIPForum-discussion] am i missing something with call hold
>
> Hello
>
> the Hold Event is sent like the INVITE the difference is only attribute is
> sendonly
>
> if m correct then why its not working, this sendHold Code works if i use
> it for Invite Purpose only...
>
> public void sendHold()
>     {
>         try
>         {
>             toUser = "1112";
>             outgoingCall = true;
>             rtpConnection = new RtpConnection();
>             localRtpPort = rtpConnection.inizialize(localRtpStartPort,
> localRtpEndPort, bufferLenght, minimumThreshold, enabledThreshold,
> packetSize);
>             System.out.print("Sending INVITE...  ");
>             reqUnauthInvite = null;
>             reqAuthInvite = null;
>             SipURI requestURI = addressFactory.createSipURI(toUser,
> serverIpPort);
>             SipURI toAddress = addressFactory.createSipURI(toUser,
> serverIp);
>             System.out.println("Server IP In Client.java is "+serverIp);
>             Address toNameAddress = addressFactory.createAddress
> (toAddress);
>             ToHeader toHeader = headerFactory.createToHeader(toNameAddress,
> null);
>             System.out.println("IPAddress In Client.java is
> "+sipStack.getIPAddress());
>             SipURI fromAddress = addressFactory.createSipURI(username,
> sipStack.getIPAddress());
>             Address fromNameAddress = addressFactory.createAddress
> (fromAddress);
>             FromHeader fromHeader = headerFactory.createFromHeader(fromNameAddress,
> userTag);
>             ArrayList viaHeaders = new ArrayList();
>             javax.sip.header.ViaHeader viaHeader =
> headerFactory.createViaHeader(sipStack.getIPAddress(),
> sipProvider.getListeningPoint().getPort(), transportProt, null);
>             viaHeaders.add(viaHeader);
>             CallIdHeader callIdHeader = cldTemp;
>             CSeqHeader cSeqHeader = headerFactory.createCSeqHeader(1,
> "INVITE");
>             MaxForwardsHeader maxForwards =
> headerFactory.createMaxForwardsHeader(70);
>             Request request = messageFactory.createRequest(requestURI,
> "INVITE", callIdHeader, cSeqHeader, fromHeader, toHeader, viaHeaders,
> maxForwards);
>             request.addHeader(contactHeader);
>             ContentTypeHeader contentTypeHeader =
> headerFactory.createContentTypeHeader("application", "sdp");
>             String myAddress = Globals.addr.getHostAddress();
>             String string1 = " RTP/AVP";
>             String string2 = "";
>             int i=0;
>             //for(int i = 0; i < codecListModel.getSize(); i++)
>             {
>                 if(String.valueOf(codecListModel.elementAt(i)).equals("
> PCMU/8000 "))
>                 {
>                     string1 = (new
> StringBuilder()).append(string1).append(" 0").toString();
>                     string2 = (new
> StringBuilder()).append(string2).append("a=rtpmap:0
> PCMU/8000\r\n").toString();
>                     //continue;
>                 }
>                 if(String.valueOf(codecListModel.elementAt(i)).equals("
> GSM/8000 "))
>                 {
>                     string1 = (new
> StringBuilder()).append(string1).append(" 3").toString();
>                     string2 = (new
> StringBuilder()).append(string2).append("a=rtpmap:3
> GSM/8000\r\n").toString();
>                     //continue;
>                 }
>                 if(String.valueOf(codecListModel.elementAt(i)).equals("
> G723/8000 "))
>                 {
>                     string1 = (new
> StringBuilder()).append(string1).append(" 4").toString();
>                     string2 = (new
> StringBuilder()).append(string2).append("a=rtpmap:4
> G723/8000\r\n").toString();
>                     //continue;
>                 }
>                 if(String.valueOf(codecListModel.elementAt(i)).equals("
> DVI4/8000 "))
>                 {
>                     string1 = (new
> StringBuilder()).append(string1).append(" 5").toString();
>                     string2 = (new
> StringBuilder()).append(string2).append("a=rtpmap:5
> DVI4/8000\r\n").toString();
>                 }
>             }
>
>             string2+="a=sendonly";
>             string1 = (new
> StringBuilder()).append(string1).append("\r\n").toString();
>             String sdpData = (new StringBuilder()).append("v=0\r\no=4855
> 13760799956958020 13760799956958020 IN IP4
> ").append(myAddress).append("\r\n").append("s=Session SDP\r\n").append("c=IN
> IP4  ").append(myAddress).append("\r\n").append("t=0 0\r\n").append("m=audio
> ").append(localRtpPort).append(string1).append(string2).toString();
>             byte contents[] = sdpData.getBytes();
>             request.setContent(contents, contentTypeHeader);
>             request.addHeader(userAgentHeader);
>             javax.sip.header.Header callInfoHeader =
> headerFactory.createHeader("Call-Info", "<http://www.kleis.it>");
>             request.addHeader(callInfoHeader);
>             inviteTid = sipProvider.getNewClientTransaction(request);
>             inviteTid.sendRequest();
>             dialog = inviteTid.getDialog();
>             reqUnauthInvite = request;
>             System.out.println("DONE");
>         }
>         catch(Exception ex)
>         {
>             System.out.println(ex.getMessage());
>             ex.printStackTrace();
>         }
>         return;
>     }
>
>
> sorrry about the indentation mistakes
>
> but plzz help me with the SIP Call HOLD
>
> thanx in advance
>
> ------------------------------
> Bored stiff? <http://us.rd.yahoo.com/evt=49935/*http://games.yahoo.com>Loosen up...
> Download and play hundreds of games for free<http://us.rd.yahoo.com/evt=49935/*http://games.yahoo.com>on Yahoo! Games.
>
>
>
>
>        <http://www.samsungnetworks.co.kr/>   ??? (KIM HYUN GON) ??
> ?????? ??3? Tel. 070-7015-0442 Fax.070-7015-5678 M.P  017-642-1518
> peter324.kim at samsung.com    <http://www.wyz070.co.kr/>
>
>
>
>
>
>
> _______________________________________________
> This is the SIP Forum discussion mailing list
> TO UNSUBSCRIBE, or edit your delivery options, please visit
> http://sipforum.org/mailman/listinfo/discussion
> Post to the list at discussion at sipforum.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sipforum.org/pipermail/discussion/attachments/20070323/48c718e6/attachment-0002.html>


More information about the discussion mailing list