Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIP Proxy and SIP Registrar examples #14

Closed
cristianmad opened this issue Nov 11, 2016 · 7 comments
Closed

SIP Proxy and SIP Registrar examples #14

cristianmad opened this issue Nov 11, 2016 · 7 comments

Comments

@cristianmad
Copy link

Hi,
I am looking at building a very basic SIP Proxy and Registrar in .NET and Sipsorcery looks very promising. I looked through the code (SIPSorcery.Servers.Cores) and it seems to support most of the things that I need (actualy more than I need) but I was exactly sure what would be the proper way of using it.

Do you, by any chance, have a basic example showcasing the initilization and some basic interaction with the SIP Registrar (assuming RegistrarCore) and the SIP Proxy (assuming SIPProxyCore).

I was also looking for a nuget package for the Servers side of this project (SIPSorcery.Servers.Cores) but I was not able to find one.

Thank you,
Cristian

@sipsorcery
Copy link
Member

I don't have any basic examples of SIP servers sorry.

The SIPRegistrarCore may be easy to strip down by removing the calls to the function delegates and persistence classes that are set in the constructor (registrarBindingsManager, getSIPAccount etc). You'll need to either remove the calls to those managers and delegates or replace them with your own logic. They are the points where the logic switches from SIP processing to application specific logic such as storing the registrar binding or looking up the SIP credentials in a database. Alternatively you could stub those methods and classes pretty quickly and then plug in whatever your application will need to do.

The Proxy is harder as it's a more complex task. The code has two proxy implementations the SIProxyCore (simpler and stateless SIP proxy) and SIPAppServerCore (complex and stateful SIP proxy). What do you need your SIP Proxy to do?

@cristianmad
Copy link
Author

Thank you for your quick and detailed reply.

Basically we are developing a system composed of various types of SIP clients and a number of PBXs. When developing the clients (and also for demo purposes), I do not want to have to be forced to deploy the entire backend infrastructure if I only want to basically test a softphone. Also, I am not looking at having a media server (since the media would go straight between the registered clients - for my demo purposes).

Here would be the objectives for both the registrar and proxy:
Registrar:

  • Allow any SIP client to register/unregister without validating anything. Following your recommendation, I will look at replacing the delegates indicated by you and basically build an in-memory map containing all the registered clients.

Proxy:

  • Allow registered clients to call each other.
  • Not interested in media support. The RTP would flow directly between the 2 clients.
  • Not interested in more than 2 party calls (ex. conferencing)
  • Not interested in transfer support. (unless it is straightforward to implement)
  • Have the ability to generate an external call. For example, say you have 2 clients connected, I want to be able to generate an external call and send an invite to one of them. (again, signalling only, no media required)
    Since the purpose of this is to support the client development and demos (not production), I am looking at the simplest and least time/resource consuming possible approach.
    Do you think that I could use the simple SIPProxyCore to achieve this?

Thank you again!

@sipsorcery
Copy link
Member

This shell app I whipped up might help get you started https://github.com/sipsorcery/sipsorcery/tree/master/sipsorcery-simpleservers/Proxy.

It skimps on almost all the validation and error checking (not to mention authentication etc) but I suspect it will be a lot easy to start from it than any of the heavily customised server cores in the SIPSorcery.Servers.Cores namespace.

@cristianmad
Copy link
Author

That is exactly what I needed! Thank you very much!

Starting from your example, I handled some of the other SIP methods (INVITE, CANCEL, BYE, ACK, ...) and have my basic test proxy! :)

Thank you again

@asadcr
Copy link

asadcr commented Dec 17, 2022

@cristianmad Would you be able to share the other SIP Methods implementation ? like INVITE BYE etc ?

@lavkushtyagi
Copy link

@cristianmad Do you create it in .NET if yes please share me details and sample code for Same. i have the same requirement. Thanks in advance.

@cristianmadularu
Copy link

Unfortunatelly, this was about 7 years ago and I no longer have access to that code.
Sorry :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants