How To Connect To SIP

This post is the start of a series. I’m going to be releasing all of the bits and pieces that make up the online payments system at my library. It should be a good model for most libraries to follow, you can use nearly any payment gateway, and all you need is SIP and PHP.

The first step is going to be to make sure our web server can actually connect to our SIP server. This will save you lot’s of time thinking your PHP is broken, when it’s really a port open/closed issue.

First, login to your web server, the one that will be connecting to SIP through PHP. Open up a command prompt and enter the command ‘telnet sip.mydomain.com 666’ where sip.mydomain.com is the address to your SIP server, and 666 is the port number you wish to connect into.

After you press enter, your screen should go totally blank. It will look really weird, but not to worry, this is normal. You’ve now started a telnet connection to your SIP server. You can type in anything you want (it won’t show up, this is something called localecho), and when you hit enter you should get a 96 as a response. The 96 response means that SIP didn’t understand the command. This does verify that you are connected into the server, however.

If you receive another message, like the one in this screen shot, then your webserver cannot see your SIP server. You’ll have to make the changes to the firewall to open the port.

Failed SIP Connection

Now we know that your webserver can actually connect to your SIP server. In the next post in this series, we’ll actually make the connection through SIP, and get some real data from SIP.

3 Responses to “How To Connect To SIP”

  1. Mike Says:

    I’m glad you’re posting this series. III sells a module for this purpose but it sounds like it may not be necessary!


  2. Connect To SIP With PHP – CoryDunne.com Says:

    […] time, we took a look at how to make sure your web server can see your SIP server. This time, we’re going to carry on with actually making the two talk to each […]


  3. SIP Strings For Patron Accounts – CoryDunne.com Says:

    […] we’ve looked at how to make our web server talk to our SIP server, and how to make PHP talk to our SIP server. Let’s start to retrieve some real data from […]


Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>