locked
Using PJSIP RRS feed

  • Question

  • pjsip was the best free SIP User Agent I could find. I have a few problems though.

    I have an speech application deployed on the local host called "sample". The application is configured to be listening at port 9014.

    I have added pjsip as a trusted peer to be running at port 5070

     

    When I run pjsip in TCP mode from local port 5070 and call the application as

    sipTongue Tiedample@Felix-PC:9014;transport=TCP

     

    I get the following error:

     

    Make call: sipTongue Tiedample@Felix-PC:9014
     11:02:26.465   pjsua_call.c Making call with acc #0 to sipTongue Tiedample@Felix-PC:9014

     11:02:26.474   pjsua_call.c Dialog creation failed: Invalid URI (PJSIP_EINVALID
    URI) [status=171039]
    >>> m
    (You currently have 0 calls)
    Buddy list:
     -none-

    Choices:
       0         For current dialog.
      -1         All 0 buddies in buddy list
      [1 - 0]    Select from buddy list
      URL        An URL
      <Enter>    Empty input (or 'q') to cancel
    Make call: sipTongue Tiedample@Felix-PC:9014;transport=TCP
     11:03:05.700   pjsua_call.c Making call with acc #0 to sipTongue Tiedample@Felix-PC:9014
    ;transport=TCP
     11:03:05.713   tcpc031F429C TCP client transport created
     11:03:05.717   tcpc031F429C TCP transport 192.168.1.104:50025 is connecting to
    192.168.1.104:9014...
     11:03:05.726   pjsua_core.c TX 996 bytes Request msg INVITE/cseq=1404109334 (td
    ta031F1A6C) to tcp 192.168.1.104:9014:
    INVITE sipTongue Tiedample@Felix-PC:9014;transport=TCP SIP/2.0
    Via: SIP/2.0/tcp 192.168.1.104:50025;rport;branch=z9hG4bKPj73950bbdcf614b2ba11d3
    eb514bda98b
    Max-Forwards: 70
    From: <sip:192.168.1.104>;tag=47ae4a2ca5304f7891c3a3bb695a7a54
    To: sipTongue Tiedample@Felix-PC
    Contact: <sip:192.168.1.104:9999;transport=TCP>
    Call-ID: bd2803f5761f4a9fb9ab7a10782452cd
    CSeq: 1404109334 INVITE
    Allow: INVITE, ACK, BYE, CANCEL, SUBSCRIBE, NOTIFY, PUBLISH, REFER, MESSAGE, OPT
    IONS
    Supported: norefersub
    User-Agent: PJSUA v0.5.8/win32
    Content-Type: application/sdp
    Content-Length:   427

    v=0
    o=- 3386660585 3386660585 IN IP4 192.168.1.104
    s=pjmedia
    c=IN IP4 192.168.1.104
    t=0 0
    m=audio 4000 RTP/AVP 103 102 104 117 3 0 8 101
    a=rtcp:4001 IN IP4 192.168.1.104
    a=rtpmap:103 speex/16000
    a=rtpmap:102 speex/8000
    a=rtpmap:104 speex/32000
    a=rtpmap:117 iLBC/8000
    a=fmtp:117 mode=20
    a=rtpmap:3 GSM/8000
    a=rtpmap:0 PCMU/8000
    a=rtpmap:8 PCMA/8000
    a=sendrecv
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15

    --end msg--
     11:03:05.831        pjsua.c Call 0 state changed to CALLING
    >>>  11:03:06.717   tcpc031F429C TCP connect() error: No connection could be mad
    e because the target machine actively refused it. [code=130061]
     11:03:06.721    tsx031F2A9C Failed to send Request msg INVITE/cseq=1404109334 (
    tdta031F1A6C)! err=130061 (No connection could be made because the target machin
    e actively refused it.)
     11:03:06.729        pjsua.c Call 0 is DISCONNECTED [reason=703 (No connection c
    ould be made because the target machine actively refused it.)]
     11:03:06.733   tcpc031F429C TCP transport destroyed with reason 130061: No conn
    ection could be made because the target machine actively refused it.

    1. Am I making some mistake calling the application? Am I callid the wrong SIP address?

    2. Am I missing something in configuring the trusted SIP peer?

    3. Is there a security setting I am missing?

     

    Please help.

     

    Pranay

     

    Friday, April 27, 2007 3:15 PM

Answers

  • Speech Server will always send a 302; your SIP UA should then send an INVITE to the address specified in the Contact header (in this case sip:99@localhost:50392;transport=Tcp;maddr=127.0.0.1;x-mss-call-id=5877e9254e9c45d4b6dce3bbe6eb93fb).

     

    It looks like PJSIP doesn't follow the redirect.  Perhaps it has a configuration option to do so?  If not, then this is either a reason to change to a SIP UA, or a reason to use the advanced application settings to specify a specific port.

     

    SipXPhone has been used successfully by several people, and there is a windows version available.

    Monday, April 30, 2007 7:36 PM

All replies

  • Does the "Welcome to MSS" app work fine when called by this?
    Friday, April 27, 2007 8:18 PM
  • It appears that the port is used by another process. You could use netstat command to figure which process is listening in that port.

     

    Friday, April 27, 2007 8:19 PM
  • I have two applications.

    WelcomeToOcs

    running on default port (I assume 5060)

     

    sample

    running on 9014

     

    Also to be noted is that the Speech server is running on default port (5060?)

     

    How does MSS07 differentiate between SIP invites to different applications? Is it based on port numbers?

    If Speech Server is listening on a certain port, and SIP INVITE is sent to that port, how does it reach the applicaton?

     

     

    Friday, April 27, 2007 8:42 PM
  • netstat result:

    Active Connections

      Proto  Local Address          Foreign Address        State
      TCP    127.0.0.1:8036         Felix-PC:51999         ESTABLISHED
      TCP    127.0.0.1:8036         Felix-PC:52000         ESTABLISHED
      TCP    127.0.0.1:8036         Felix-PC:52001         ESTABLISHED
      TCP    127.0.0.1:8036         Felix-PC:52005         ESTABLISHED
      TCP    127.0.0.1:51999        Felix-PC:8036          ESTABLISHED
      TCP    127.0.0.1:52000        Felix-PC:8036          ESTABLISHED
      TCP    127.0.0.1:52001        Felix-PC:8036          ESTABLISHED
      TCP    127.0.0.1:52002        Felix-PC:52004         ESTABLISHED
      TCP    127.0.0.1:52004        Felix-PC:52002         ESTABLISHED
      TCP    127.0.0.1:52005        Felix-PC:8036          ESTABLISHED
      TCP    192.168.1.104:49175    kc-in-f125:5222        ESTABLISHED
      TCP    192.168.1.104:49190    nc-ok-66-138-0-209:39441  ESTABLISHED
      TCP    192.168.1.104:49726    by1msg5276704:msnp     ESTABLISHED
      TCP    192.168.1.104:52138    ip-66-218-228-94:20096  ESTABLISHED
      TCP    192.168.1.104:52139    66-169-38-193:54578    ESTABLISHED
      TCP    192.168.1.104:52149    wr-in-f19:http         ESTABLISHED
      TCP    192.168.1.104:52152    wr-in-f189:http        ESTABLISHED
      TCP    192.168.1.104:52161    207.68.178.134:http    ESTABLISHED
      TCP    192.168.1.104:52162    67.28.122.178:http     ESTABLISHED

     

    I have little experience in understanding netstat results, but I dont see any binding to 5060 here.

    Friday, April 27, 2007 8:46 PM
  • Anything sent to 5060 will be handled by MSS, if your app is configured on a separate port it handle it fine if you call it directly.

     

    When you call the Welcome To OCS application, does that work?

     

    Why do you need your app on a separate port?

     

    Are there any errors in the event logs?

    Friday, April 27, 2007 10:44 PM
  • I don't get the netstat thing either. If I run netstat -a -o and filter the results based on the Process ID of Microsoft.SpeechServer.Tap.exe this is what I get:

     

    TCP    pbeber76:2551          localhost:8036         ESTABLISHED     4516
     TCP    pbeber76:2552          pbeber76.redmond.corp.microsoft.com:0  LISTENING       4516

     

    I.e. no mention of 5060 which is what it is listening on.

     

    Have you added exceptions to the firewall on the Speech Server machine?

     

    Friday, April 27, 2007 10:50 PM
  • "No connection could be made because the target machine actively refused it" means that nothing is listening to that port, 9014 in your case.  So, lets get the dumb questions out of the way 1st - is Speech Service actually running?  You can check with services.msc or issuing "sc query msspeechservice" at a command prompt.

     

    If it is running, are there any errors or warnings in the NT Application Event log from Speech Service?  If you have correctly configured Speech Service to listen on 9014, then at startup there should be an event 29032 "Application 'Sample' has started listening on port 9014".  If you don't get this message, then Speech Service is not listening on 9014, and the error you're getting is expected.

     

    Ahmed asks a valid question - why are you configuring a specific port of your application?  We recommend that you don't do this unless you have a specific reason why you can't go via the primary listening port (default 5060).  Incoming calls to this port are routed to the relevant application based on the user field - so sipTongue Tiedample is routed to whichever app is configured for user "sample".  You configure this through the Called Party Address field of an application, and the "Call Answering Precedence".

     

    I echo Ahmed's suggestion of testing WelcomeToOcs.  Try calling sip:999@localhost:5060;transport=TCP - 999 is arbitrary, as WelcomeToOcs is configured to accept all incoming calls.  I am assuming that you haven't changed the default listening port from 5060. 

     

    The ports of your trusted SIP peer are irrelevant for incoming calls.

    Monday, April 30, 2007 10:51 AM
  • I did not get the part of where you talk about "user". how can I configure "user" for a certain applications. I am currently using only WelcomeToOcs application. The server and application both are listening on default ports (5060 I assume). The application called party address is configured to be "*", hence I assume any string should go through.

     

    Please elaborate on configuring the user.

    Monday, April 30, 2007 6:39 PM
  • A SIP URI has the following form:

     

    sip:<user>@<host>:<port>

     

    You are correct "*" for WelcomeToOcs means that it should accept anything for "<user>".
    Monday, April 30, 2007 7:12 PM
  • Following are the steps I took . This would probably help finding where the problem lies

    1. Started the Microsoft Office Communications Server 2007 Speech Server.

    The server is running on default port.

    2. The server has only one application running on it. "WelcomeToOcs" running on default port

    4. Added a Trusted SIP peer. A peer called pjsip running on local host on port 5071.

    5. Restarted the speech server. No warnings or errors in event log

    6. Started pjsip on port 5071 no UDP

    8. Called <sip:99@localhost:5060;transport=TCP>

     

    Following is the SIP message log pjsip logged:

     

    Request msg INVITE/cseq=796082715 (tdta0149954C) created.
      15:01:23.623    inv030E8DCC Sending Request msg INVITE/cseq=796082715 (tdta0149954C)
      15:01:23.623    dlg030E8DCC Sending Request msg INVITE/cseq=796082715 (tdta0149954C)
      15:01:23.623    tsx0149A57C Transaction created for Request msg INVITE/cseq=796082714 (tdta0149954C)
      15:01:23.623    tsx0149A57C Sending Request msg INVITE/cseq=796082714 (tdta0149954C) in state Null
      15:01:23.623  sip_resolve.c Resolving server 'localhost:5060' type=TCP
      15:01:23.625  sip_resolve.c Server resolved: 'localhost:5060' type=TCP has 1 entries, entry[0]=127.0.0.1:5060 type=TCP
      15:01:23.625   tcpc0149BD7C TCP client transport created
      15:01:23.629   tcpc0149BD7C TCP transport 192.168.1.104:50387 is connecting to 127.0.0.1:5060...
      15:01:23.636   tcpc0149BD7C TCP transport 192.168.1.104:50387 is connected to 127.0.0.1:5060
      15:01:23.640   pjsua_core.c TX 989 bytes Request msg INVITE/cseq=796082714 (tdta0149954C) to tcp 127.0.0.1:5060:
    INVITE sip:99@localhost:5060;transport=TCP SIP/2.0
    Via: SIP/2.0/tcp 192.168.1.104:50387;rport;branch=z9hG4bKPjf9b202fad67c4ac2aa34e1b46eb93da8
    Max-Forwards: 70
    From: <sip:192.168.1.104>;tag=907d080f34734834a5a5a8c6d9e49aba
    To: sip:99@localhost
    Contact: <sip:192.168.1.104:5071;transport=TCP>
    Call-ID: 5877e9254e9c45d4b6dce3bbe6eb93fb
    CSeq: 796082714 INVITE
    Allow: INVITE, ACK, BYE, CANCEL, SUBSCRIBE, NOTIFY, PUBLISH, REFER, MESSAGE, OPTIONS
    Supported: norefersub
    User-Agent: PJSUA v0.5.8/win32
    Content-Type: application/sdp
    Content-Length:   427

    v=0
    o=- 3386934083 3386934083 IN IP4 192.168.1.104
    s=pjmedia
    c=IN IP4 192.168.1.104
    t=0 0
    m=audio 4000 RTP/AVP 103 102 104 117 3 0 8 101
    a=rtcp:4001 IN IP4 192.168.1.104
    a=rtpmap:103 speex/16000
    a=rtpmap:102 speex/8000
    a=rtpmap:104 speex/32000
    a=rtpmap:117 iLBC/8000
    a=fmtp:117 mode=20
    a=rtpmap:3 GSM/8000
    a=rtpmap:0 PCMU/8000
    a=rtpmap:8 PCMA/8000
    a=sendrecv
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15

    --end msg--
      15:01:23.803    tsx0149A57C State changed from Null to Calling, event=TX_MSG
      15:01:23.803    dlg030E8DCC Transaction tsx0149A57C state changed to Calling
      15:01:23.803        pjsua.c Call 0 state changed to CALLING  
      15:01:24.035 sip_endpoint.c Processing incoming message: Response msg 100/INVITE/cseq=796082714 (rdata0149BE48)
      15:01:24.035   pjsua_core.c RX 307 bytes Response msg 100/INVITE/cseq=796082714 (rdata0149BE48) from tcp 127.0.0.1:5060:
    SIP/2.0 100 Trying
    FROM: <sip:192.168.1.104>;tag=907d080f34734834a5a5a8c6d9e49aba
    TO: <sip:99@localhost>
    CSEQ: 796082714 INVITE
    CALL-ID: 5877e9254e9c45d4b6dce3bbe6eb93fb
    MAX-FORWARDS: 70
    VIA: SIP/2.0/tcp 192.168.1.104:50387;branch=z9hG4bKPjf9b202fad67c4ac2aa34e1b46eb93da8;rport
    CONTENT-LENGTH: 0


    --end msg--
      15:01:24.071    tsx0149A57C Incoming Response msg 100/INVITE/cseq=796082714 (rdata0149BE48) in state Calling
      15:01:24.071    tsx0149A57C State changed from Calling to Proceeding, event=RX_MSG
      15:01:24.071    dlg030E8DCC Received Response msg 100/INVITE/cseq=796082714 (rdata0149BE48)
      15:01:24.071    dlg030E8DCC Transaction tsx0149A57C state changed to Proceeding
      15:01:24.887 sip_endpoint.c Processing incoming message: Response msg 302/INVITE/cseq=796082714 (rdata0149BE48)
      15:01:24.887   pjsua_core.c RX 466 bytes Response msg 302/INVITE/cseq=796082714 (rdata0149BE48) from tcp 127.0.0.1:5060:
    SIP/2.0 302 Moved Temporarily
    FROM: <sip:192.168.1.104>;tag=907d080f34734834a5a5a8c6d9e49aba
    TO: <sip:99@localhost>;tag=e576bfe2a
    CSEQ: 796082714 INVITE
    CALL-ID: 5877e9254e9c45d4b6dce3bbe6eb93fb
    MAX-FORWARDS: 70
    VIA: SIP/2.0/tcp 192.168.1.104:50387;branch=z9hG4bKPjf9b202fad67c4ac2aa34e1b46eb93da8;rport
    CONTACT: <sip:99@localhost:50392;transport=Tcp;maddr=127.0.0.1;x-mss-call-id=5877e9254e9c45d4b6dce3bbe6eb93fb>
    CONTENT-LENGTH: 0
    SERVER: RTCC/3.0.0.0


    --end msg--
      15:01:24.924    tsx0149A57C Incoming Response msg 302/INVITE/cseq=796082714 (rdata0149BE48) in state Proceeding
      15:01:24.924       endpoint Request msg ACK/cseq=796082714 (tdta0149DDDC) created.
      15:01:24.924    tsx0149A57C State changed from Proceeding to Completed, event=RX_MSG
      15:01:24.924    dlg030E8DCC Received Response msg 302/INVITE/cseq=796082714 (rdata0149BE48)
      15:01:24.924    dlg030E8DCC Transaction tsx0149A57C state changed to Completed
      15:01:24.924        pjsua.c Call 0 is DISCONNECTED [reason=302 (Moved Temporarily)]
      15:01:24.928    dlg030E8DCC Session count dec to 1 by mod-invite
      15:01:24.929   pjsua_core.c TX 346 bytes Request msg ACK/cseq=796082714 (tdta0149DDDC) to tcp 127.0.0.1:5060:
    ACK sip:99@localhost:5060;transport=TCP SIP/2.0
    Via: SIP/2.0/tcp 192.168.1.104:50387;rport;branch=z9hG4bKPjf9b202fad67c4ac2aa34e1b46eb93da8
    Max-Forwards: 70
    From: <sip:192.168.1.104>;tag=907d080f34734834a5a5a8c6d9e49aba
    To: sip:99@localhost;tag=e576bfe2a
    Call-ID: 5877e9254e9c45d4b6dce3bbe6eb93fb
    CSeq: 796082714 ACK
    Content-Length:  0

     

     

     

    The server responds with a 302 MOVED Temporarily message.

    Why?

    Also can someone give me a link to a SIP UA with TCP capabilities for windows?
    -- 

    Monday, April 30, 2007 7:13 PM
  • Speech Server will always send a 302; your SIP UA should then send an INVITE to the address specified in the Contact header (in this case sip:99@localhost:50392;transport=Tcp;maddr=127.0.0.1;x-mss-call-id=5877e9254e9c45d4b6dce3bbe6eb93fb).

     

    It looks like PJSIP doesn't follow the redirect.  Perhaps it has a configuration option to do so?  If not, then this is either a reason to change to a SIP UA, or a reason to use the advanced application settings to specify a specific port.

     

    SipXPhone has been used successfully by several people, and there is a windows version available.

    Monday, April 30, 2007 7:36 PM
  • In response to your question "Also can someone give me a link to a SIP UA with TCP capabilities for windows", Phil Beber posted the following URL to another thread on this forum.

     

    http://www.download.com/sipXphone/3000-2349_4-10405204.html

    Monday, April 30, 2007 7:50 PM
  • Counterpath's X-Lite also works if you specify TCP transport in the sip URI:

    sip:<user>@<host>:<port>;transport=tcp

    Monday, April 30, 2007 10:12 PM
  • Thanks a lot. The problem was with my SIP UA. I configured the SipXPhone as a trusted peer and it worked. This thread helped a lot to clarify OCS speech server 2007 SIP interface.
    Tuesday, May 1, 2007 1:59 PM
  • how do i configure the administrator console inorder to receive the service.

    i am using xlite, and when i call my server, it shows that service unavailable.

    i have sip peer port is 5065, and 5066 fot tcp, tls. and i use the default port for my application.

    what is wrong with my configuration?

    Sunday, May 20, 2007 9:43 PM