0

How to find the sip server and port is reachable using pjsip library? I have been advised to use pjsip_options_method, but I don't know how to use this and if you have any better solution to suggest, please do here.

RJV Kumar
  • 2,408
  • 1
  • 19
  • 28
  • With SIP, to find out if a (proxy's) port is reachable, you have to send a request to that port. Most likely an OPTIONS or REGISTER request, but any one will do. – Bucq May 02 '18 at 08:06
  • how to send OPTIONS using pjsip library? Do you have any sample request? – RJV Kumar May 02 '18 at 09:06

1 Answers1

1

Pjsip provides functionality to help you build a complete SIP application more easily. But if all you want to know is if a SIP server is running behind a certain port then maybe using pjsip is a bit of overkill. Especially if you are unfamiliar with it.

You could just send a UDP packet containing an OPTIONS request to the port. If a SIP server is running it will respond with an OPTIONS response.

RFC3261 describes how to compose an OPTIONS request/response and provides some examples.

If you find yourself a (free) UDP packet sender/receiver application on the internet you will be in business in no time.

Community
  • 1
  • 1
Bucq
  • 931
  • 6
  • 17