Which compant should I use to create a simple SIP Phone?

Place for developers to chat about the code
Post Reply
Henry
Posts: 5
Joined: Thu Sep 09, 2010 1:59 am

Which compant should I use to create a simple SIP Phone?

Post by Henry » Thu Sep 09, 2010 2:23 am

Hi,

I'm a beginner of SIP. Just downloaded the source code last week.
The subject is my question.
What I want to do is very simple: Use SS' sip compant to make a simple SIP phone client w/o any server / proxy, the clients connected directly with their IP (run in LAN). As the start don't need care about the voice control just the sip methods. The client only need implement the normal control of a coming call / call out.

Now I worked with a SIPTransport (learned from SoftPhone) object and it's SIPTransportRequestReceived and SIPTransportResponseReceived events as following
SIPTransport m_sipTransport;

m_sipTransport = new SIPTransport(SIPDNSManager.ResolveSIPService, new SIPTransactionEngine());
m_sipTransport.AddSIPChannel(new SIPUDPChannel(new IPEndPoint(IPAddress.Parse("192.168.1.111"), 6100)));

m_sipTransport.SIPTransportRequestReceived += SIPTransportRequestReceived;
m_sipTransport.SIPTransportResponseReceived += SIPTransportResponseReceived;

I use m_sipTransport.GetRequest to create an INVITE request and m_sipTransport.SendRequest send the request to another client.

Here comes my trouble: when process with the response in SIPTransportResponseReceived, how can I make a SIPRequest / SIPResponse base on coming information. I need send ACK request when recevice 200 OK response and ...

Any sugguest about how / what should I do in SIPTransportRequestReceived and SIPTransportResponseReceived.

Thanks in advance and happy coding :-)

Henry

User avatar
Aaron
Site Admin
Posts: 4569
Joined: Thu Jul 12, 2007 12:13 am

Re: Which compant should I use to create a simple SIP Phone?

Post by Aaron » Thu Sep 09, 2010 5:03 am

The SIPSorcery.SIP.App and SIPUserAgents are what you need. Specifically the SIPClientUserAgent class to initiate a call and the SIPServerUserAgent class to answer one. Using those classes will avoid the need to directly use SIP requests and responses or to have to handle SIP transactions and things like ACKs. Instead you can just use mehtods like Call and Answer which make life a lot easier.

One point you need to be aware of is that there's little to no media processing capability in the sipsorcery stack so once you have established a SIP call there won't be any media or audio for you to listen to...

Henry
Posts: 5
Joined: Thu Sep 09, 2010 1:59 am

Re: Which compant should I use to create a simple SIP Phone?

Post by Henry » Thu Sep 09, 2010 5:37 am

Thank you for quick reply.

Where can I get some sample code that used them? I'll have a look with them.

Thanks!

User avatar
Aaron
Site Admin
Posts: 4569
Joined: Thu Jul 12, 2007 12:13 am

Re: Which compant should I use to create a simple SIP Phone?

Post by Aaron » Thu Sep 09, 2010 7:30 am

The SIPSorcery-SoftPhone project uses the SIPClientUserAgent and SIPServerUserAgent classes.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests