×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    23

    How to set the source port in SipConnectionClient in JSR180

    Hi all,

    I tried to register to a sip server using the doRegister code from the SipClientConnection class in JSR180. It works perfectly, but I'd like to know how I could set the source port (from which I send the SIP REGISTER message) in the code. Currently, the source port is chosen at random by the system.

    ANyone has any idea?
    Thanks.

  2. #2
    Registered User
    Join Date
    Jan 2006
    Posts
    9

    Re: How to set the source port in SipConnectionClient in JSR180

    Hi capricious,
    If u want to set the SIP listening point then u can set it using SipConnectionNotifier as:
    SipConnectionNotifier scn =
    (SipConnectionNotifier) Connector.open("sip:5060");
    Declare a member variable of type SipConnectionNotifier in ur appl and intialise it in ur constructor as mentioned above.
    Then whenever u create any request using initRequest() pass scn as second parameter. It will fill the contact header of request with specified port number as:
    scc.initRequest("REGISTER", scn);

  3. #3
    Registered User
    Join Date
    Feb 2006
    Posts
    23

    Re: How to set the source port in SipConnectionClient in JSR180

    Hi hari_scjp,

    Thanks for your reply.
    Your suggestion didn't work. My network trace shows that my PC is sending the SIP REGISTER at port 1765 and the SIP server received it on port 5060. Then the SIP server sends 200 OK from its port 5060 to my PC's port 1765.

    For subsequent SIP REGISTERs to the SIP server, my PC uses other port numbers (eg. 1794, etc..) randomly. The scenario I want to achieve is to *fix* this port to a number, say 5080, in the code. I do not want to have the PC selecting some random port when sending the REGISTER. Is this possible?

    Thanks again.

  4. #4
    Registered User
    Join Date
    Oct 2006
    Posts
    3

    Re: How to set the source port in SipConnectionClient in JSR180

    Quote Originally Posted by capricious28
    Hi all,

    I tried to register to a sip server using the doRegister code from the SipClientConnection class in JSR180. It works perfectly, but I'd like to know how I could set the source port (from which I send the SIP REGISTER message) in the code. Currently, the source port is chosen at random by the system.

    ANyone has any idea?
    Thanks.
    If you do not mind, would you share your registration code here plz..

Similar Threads

  1. Replies: 1
    Last Post: 2007-02-09, 12:21
  2. problem viewing variable values when debugging
    By jas203 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 0
    Last Post: 2006-03-25, 22:37
  3. Link Errors Help me
    By TrungThanhMtad in forum Symbian
    Replies: 2
    Last Post: 2005-10-15, 05:13
  4. J2ME 2.0 will not run stand alone.
    By demirateser in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2003-10-08, 08:26

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •