0

How to link to the sip server though IP? I used the listeningPoint to link with the local unused IP, it works; when I link to the SIP phone's IP, it doesn't.

Can I direct my link to the SIP server?

I just want to create a JAVA SE Application to receive the phone number and display the information of the caller.

Here's what I've tried so far:

Properties properties = new Properties();
properties.setProperty("javax.sip.STACK_NAME", "GetPhoneNum");
properties.setProperty("javax.sip.IP_ADDRESS", "192.168.1.2");
sipStack = sipFactory.createSipStack(properties);
ListeningPoint udp = sipStack.createListeningPoint(port, "udp");
sipProvider = sipStack.createSipProvider(udp);
sipProvider.addSipListener(this)

I createed the sipFactory and the sipStack the with the parameter (properties), then I added the javax.sip.IP_ADDRESS properties with the my local IP address.

ccjmne
  • 9,333
  • 3
  • 47
  • 62
Ronnie Tws
  • 464
  • 3
  • 6
  • Wht have you tried so far? Code? – Christian Gollhardt Aug 06 '14 at 01:09
  • Properties properties = new Properties(); properties.setProperty("javax.sip.STACK_NAME", "GetPhoneNum"); properties.setProperty("javax.sip.IP_ADDRESS", "192.168.1.2"); sipStack = sipFactory.createSipStack(properties); ListeningPoint udp = sipStack.createListeningPoint(port, "udp"); sipProvider = sipStack.createSipProvider(udp); sipProvider.addSipListener(this); – Ronnie Tws Aug 06 '14 at 02:12
  • I create the sipfactory and create the sipStack the with the parameter (properties), then I add the javax.sip.IP_ADDRESS properties with the my local ip address. – Ronnie Tws Aug 06 '14 at 02:16
  • I realize that I can only create the SipStack by used the PC's local IP. Once, I used other ip or the SIP phone's ip, it show the error message
    "javax.sip.InvalidArgumentException: Cannot assign requested address: Cannot bind"
    – Ronnie Tws Aug 06 '14 at 02:19
  • For relevant information about your question (especialy code), pls edit it. Comments are more or less for side notes and discussion. – Christian Gollhardt Aug 06 '14 at 02:21

1 Answers1

0

You need to clarify what you nean by "link the sip server". The way it works is as follows: 1. Create the sip stack. Do not specify an ip address here. That is deprecated. 2. Create the listening point from the stack but here specify ip,port,transport. 3. Get sip provider. 4. Add the listener.

To register you have to create a sip register request, a client transaction using the provider for that request and send the request using that transaction.

When ac invite comes in, get the from header and display the address.

  • Is that a way to link the local PC IP (The SIP Application) to the PBX? So I enabled to get the Analog Contact Number. So every incoming calls. The PBX will send INVITE to the local PC IP (The SIP Application), then it can display the Contact Number of the caller(Analog user or SIP Account User). – Ronnie Tws Aug 13 '14 at 18:01
  • Not sure what you want. I will try to guess that you want to be NOTIFIED when a call arrives. You would normally achieve that by SUBSCRIBING to the pbx for notification when a call arrives. Different Pbxes support this using differently. For example some use a resource list to track in progress dialogs. You should clarify and proof read your question before posting. – LostInTheFrequencyDomain Aug 14 '14 at 03:13