Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3661168
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:16:36+00:00 2026-05-19T01:16:36+00:00

I am creating a class that implements the SipListener interface to receive events from

  • 0

I am creating a class that implements the SipListener interface to receive events from the JAIN-SIP stack (for an Android device). To test it, I connect 2 devices to an OpenSIPs and have one try to call the other. I have no problem using 3rd party clients.

Everything seems to be working well with my basic implementation, except for one strange problem. When I receive the INVITE request in processRequest, I create a RINGING response, followed by an OK response. The problem is that (according to tcpdump) the RINGING response never gets to the server. After the INVITE packet is received, the device sends out a TRYING packet (I don’t do it in my code, so it must be part of JAIN-SIP) and follows it up with an OK packet. I followed various examples and they all seem to suggest something along these lines:

//This function gets called from processRequest
//Some initialization code removed to keep this short
private void processInvite(RequestEvent requestEvent)
{
        ServerTransaction serverTransaction = requestEvent.getServerTransaction();
        SipProvider sipProvider = (SipProvider) requestEvent.getSource();
            Request request = requestEvent.getRequest();

        //Create RINGING response
        Response response = m_messageFactory.createResponse(Response.RINGING,
        request);

        //Add a contact header
        Address contactAddress = m_addressFactory
        .createAddress(m_username + " <sip:" + getLocalIpAddress() + ":" + m_sipPort + ">");

        ContactHeader contactHeader = m_headerFactory.createContactHeader(contactAddress);

        response.addHeader(contactHeader);

        if (serverTransaction == null)
            {
                serverTransaction = sipProvider.getNewServerTransaction(request);
            }

        //Send RINGING response
        //This never makes it to the server
        serverTransaction.sendResponse(response);

        //Create OK response
        Response okResponse = m_messageFactory.createResponse(Response.OK, request);
        ToHeader toHeader = (ToHeader) okResponse.getHeader(ToHeader.NAME);
        toHeader.setTag("4321");
        okResponse.addHeader(contactHeader);

        //Send OK Response
        //This makes it to the server
        serverTransaction.sendResponse(okResponse);
}

For reference, the INVITE headers look like this:

INVITE sip:4321@64.x.x.x:5060 SIP/2.0  
Call-ID: 25e87b79f720728c6676d492e10c5984@10.x.x.10  
CSeq: 20 INVITE  
From: "Caller" <sip:1234@64.x.x.x:5060>;tag=12345  
To: "Callee" <sip:4321@64.x.x.x:5060>  
Via: SIP/2.0/UDP 10.x.x.10:5060;branch=z9hG4bKe45cd7919b5177a806ec1a9238b841f9393739  
Max-Forwards: 70  
Contact: "4321" <sip:1234@10.x.x.10:5060>  
Content-Length: 0  

with 64.x.x.x being the OpenSIPs IP and 10.x.x.10 being the UAC’s IP.

Am I missing a header or otherwise setting up the RINGING packet incorrectly? Any help is greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:16:37+00:00Added an answer on May 19, 2026 at 1:16 am

    i think its not the callee that is sending the trying message but the opensips which is sending the message, which it is supposed to send while it is trying to contact the callee. and i am pretty sure the ringing message is not being sent because you havent set the toheader for it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Creating a class that implements DynamicObject public class Test : DynamicObject { public override
I am creating a class that implements java.util.List . My class is using E
I'm creating a class that derives from List... public class MyList : List<MyListItem> {}
I'm creating a new class that inherits from UIView. I remember that xcode 3
I have a class that implements IHttpModule in a separate assembly from a website.
I am creating subview class that gets information about its frame from its datasource.
I am creating a class that implements the composite pattern; the class is supposed
I'm creating a specialised proxy class that implements IList<T> and wraps an internal List<T>
I m creating a class that extends AlertDialog. and setting layout. But when pop
I am creating a class that is mapped to an existing global so it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.