Search code examples
csipvoipraspberry-pi2pjsip

pjsip ringing tones and answer codes


I am writing a pjsip application and calling / answering works just fine. Now i want to implement that when i call someone i hear ringing, when i get a call its ringing.

I have searched for this but i only stumbled on answers who refer on the pjsua app in the example folders (pjproject-2.4.5/pjsip-apps/src/pjsua/) . So i tried to understand this program which contains multiple files (all in all about 3k lines of code) and special structs which just makes it harder to understand. So i could not figure out how to do this functionality and i would appreciate a hint to the right direction.

Another point would be a list of the codes i can give on answering an incoming call, since i could not find a one with descriptions what which code means.

appreciate your time.


Solution

  • SIP response codes are splitted in 6 classes

    • 1xx: Provisional — request received, continuing to process the request; Provisional responses, also known as informational responses, indicate that the server contacted is performing some further action and does not yet have a definitive response. A server sends a 1xx response if it expects to take more than 200 ms to obtain a final response. Note that 1xx responses are not transmitted reliably. They never cause the client to send an ACK. Provisional (1xx) responses MAY contain message bodies, including session descriptions.

    • 2xx: Success — the action was successfully received, understood, and accepted;

    • 3xx: Redirection — further action needs to be taken in order to complete the request;

    • 4xx: Client Error — the request contains bad syntax or cannot be fulfilled at this server;

    • 5xx: Server Error — the server failed to fulfill an apparently valid request;

    • 6xx: Global Failure — the request cannot be fulfilled at any server.

      Here you can find PJSIP struct which holds these codes and SIP codes description