Improve company productivity with a Business Account.Sign Up

x
?
Solved

SIP Proxy INVITE causes error 403 FORBIDDEN

Posted on 2011-02-17
7
Medium Priority
?
11,487 Views
Last Modified: 2013-12-27
Hi All,

Just wondering if anyone has any experience in regards to the SIP protocol and SIP proxies working with a SIP server? I've got a problem where my phone works directly with a SIP server/pbx, but when I route it through my home-made SIP proxy (written in c#), based on RFC3261, after an INVITE I get a "403 Forbidden" returned from the pbx.

Registration works fine, the following process is where it breaks
-> REGISTER
<- 407 Proxy Authentication Required
-> REGISTER (now with Auth info)
<- 200 OK
-> INVITE
<- 407 Proxy Authentication Required
-> ACK
-> INVITE (now with Auth info)
<- 403 Forbidden

Not sure why it is forbidden, when the phone talks direct it's OK and works perfectly.

The final invite (the one that results in the 403 error) is:
INVITE sip:31@10.1.1.3 SIP/2.0
Via: SIP/2.0/UDP 10.1.1.46:5060;branch=z9hG4bK36B1D64BA09A41087FCC96BEF8FAF613
Via: SIP/2.0/UDP 10.1.1.88:5061;branch=z9hG4bK3c49b772
From: "Test One" <sip:21@10.1.1.46>;tag=0007505a393901096ad799a8-4e59d2cc
To: <sip:31@10.1.1.46>
Call-ID: 0007505a-39390008-66fe78ec-7fd183be@10.1.1.88
Max-Forwards: 69
Date: Fri, 18 Feb 2011 03:11:23 GMT
CSeq: 102 INVITE
User-Agent: Cisco-CP7940G/8.0
Contact: <sip:21@10.1.1.88:5061;transport=udp>
Proxy-Authorization: Digest username="21",realm="3CXPhoneSystem",uri="sip:31@10.1.1.46",response="121e25ec861128d9bba5c2ffdd1a7ef2",nonce="414d535c036e745b96:3af1591dca90c314854206ba7e1895c8",algorithm=MD5
Expires: 180
Accept: application/sdp
Allow: ACK,BYE,CANCEL,INVITE,NOTIFY,OPTIONS,REFER,REGISTER,UPDATE
Remote-Party-ID: "Test One" <sip:21@10.1.1.46>;party=calling;id-type=subscriber;privacy=off;screen=yes
Supported: replaces,join,norefersub
Content-Length: 224
Content-Type: application/sdp
Content-Disposition: session;handling=optional

The phone is on 10.1.1.88, the pbx on 10.1.1.3 and my proxy is on 10.1.1.46. The phone is extension 21, trying to call extension 31. Extension 31 is registered directly to the pbx, it is not going via the SIP proxy.

While at the moment the phone 10.1.1.88 is on the same network as the pbx the sip proxy is being developed due to upcoming network changes in the environment.
0
Comment
Question by:DominikBM
  • 3
  • 2
5 Comments
 

Author Comment

by:DominikBM
ID: 34939088
Happy to provide more information, whatever may be relevant!

Thanks!
0
 

Author Comment

by:DominikBM
ID: 34939846
Thanks _alias99, greatly appreciate your help :-)
0
 
LVL 19

Accepted Solution

by:
feptias earned 2000 total points
ID: 34941128
On most IP phones, when you configure the user account, there are fields for username, auth id, registrar (or sip domain) and outbound proxy. Looking at the way you are using the SIP proxy I would expect the registrar field to be 10.1.1.3 and the outbound proxy field to be 10.1.1.46, but looking at the SIP I think that may not be what you have done.

It is commendable that you are trying to write your own SIP proxy in C# from scratch - wow. You will no doubt learn a lot by doing so, but were you aware that there are open source projects with many man-years of development already invested in them doing just that? ...and with a large, active and helpful user community. OpenSIPS and Kamailio for example.
0
 

Author Comment

by:DominikBM
ID: 34946110
Hi feptias,

Thanks for your help. You were absolutely right, the problem was that the phone had the SIP proxy server address set for all fields, while it should only have had it set for the "outbound proxy" field. Changing this fixed the issue, so many thanks!

In regards to open source SIP proxy servers, yes I looked at quite a number of them but none were suitable in terms of licensing (mine is built into a product that is not open source, and under GPL we'd have to make the whole thing open source) as well as platform considerations (Windows, non-Java). When the handful of options that were left proved to be incomplete or undocumented I coded my own.

Thanks again!
0
 
LVL 19

Expert Comment

by:feptias
ID: 34946261
Good luck with the project. Thanks for the points.
0

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Cyberspace is the new townsquare.  Does the change from a physical space to a digital space spell doom and destruction or growth and prosperity.
A recent study by Google illustrates that almost 84% of patients go for both online and offline sources for hospital research. What do you think, “Is the Healthcare Industry the next to be disrupted by Digital Marketing?”
The Bounty Board allows you to request an article or video on any technical topic, or fulfill a bounty request to earn points. Watch this video to learn how to use the Bounty Board to get the content you want, earn points, and browse submitted bount…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question