0

is there any tutorials or docs that explains how to register to a asterisk server using Jain SIP api in a java application?

i have already written a piece of java code that allows my java client to directly interact and send and receive messages to another client directly via p2p but i was wondering if i can enhance this app to instead register to a Asterisk server and send messages to that server which will then get relayed to the appropriate client.

Possible? Or do i need a different API to connect and register to an asterisk server?

1 Answer 1

1

Two parts:

Part A: Yes, you can register using JAIN-SIP. The java doc shows that there is a REGISTER method as part of the Request class.

One example of the usage is (from this learning resource):

Request request = this.messageFactory.createRequest(
    requestURI,
    "REGISTER",
    callIdHeader,
    cSeqHeader,
    fromHeader,
    toHeader,
    viaHeaders,
    maxForwardsHeader);

Part B: I'm not sure of the use cases for your client, but... If you're not going to have a dynamic IP for your client -- you don't actually need to register the client with Asterisk. In your /etc/asterisk/sip.conf set host=10.0.0.8 or host=jain.example.com as opposed to host=dynamic

1
  • where can i specify the clients username and password?
    – Jono
    May 22, 2013 at 14:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.