locked
OCS 2007, OpenSer and Asterisk RRS feed

  • Question

  • I am trying to setup Office Communications Server 2007 to play along with Asterisk (to use Asterisk for outgoing calls, as well as calling desktop phones).

    Calls from OCS to Asterisk or to PSTN via Asterisk (in between OpenSER) works fine. When I call from Asterisk to OCS, the Communicator rings, but as soon as I answer the call, the call drops. Weirdly, the other leg (Phone - Asterisk) still remains active till I actually hangup.

    Sip debug shows is below. Interesting item I can see is:

    [Sep 30 16:02:58] NOTICE[6424]: chan_sip.c:8027 set_address_from_contact: '' is not a valid SIP contact (missing sipSmile trying to use anyway
    [Sep 30 16:02:58] WARNING[6424]: chan_sip.c:8056 set_address_from_contact: Invalid host name in Contact: (can't resolve in DNS) : ''
    list_route: no route

    I think the Contact: header is coming empty somehow. Have any of you experienced any such issues? I am running Asterisk 1.4.19 and OpenSer 1.3.1 (I also tried with 1.2 of Openser)

    Thanks in advance.

    Remzi

    (10.x.x.x (linux.domain.com) is Openser, 168.x.x.x is Asterisk)

        -- Executing [1134@home:1] Dial("SIP/7512-08498fa8", "SIP/+74127412@openser") in new stack
    Audio is at 168.x.x.x port 19986
    Adding codec 0x4 (ulaw) to SDP
    Adding codec 0x8 (alaw) to SDP
    Adding non-codec 0x1 (telephone-event) to SDP
    Reliably Transmitting (no NAT) to 10.x.x.x:5060:
    INVITE sip:+74127412@linux.domain.com SIP/2.0
    Via: SIP/2.0/UDP 168.x.x.x:5060;branch=z9hG4bK1a2645df;rport
    From: "Remzi Semsettin Turer" <sip:7512@168.x.x.x>;tag=as3ab38a83
    To: <sip:+74127412@linux.domain.com>
    Contact: <sip:7512@168.x.x.x>
    Call-ID: 0ca69c242018dad4057d47e82fbfdde5@168.x.x.x
    CSeq: 102 INVITE
    User-Agent: Asterisk PBX
    Max-Forwards: 70
    Date: Tue, 30 Sep 2008 20:02:53 GMT
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
    Supported: replaces
    Content-Type: application/sdp
    Content-Length: 262

    v=0
    o=root 6396 6396 IN IP4 168.x.x.x
    s=session
    c=IN IP4 168.x.x.x
    t=0 0
    m=audio 19986 RTP/AVP 0 8 101
    a=rtpmap:0 PCMU/8000
    a=rtpmap:8 PCMA/8000
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-16
    a=silenceSuppSurpriseff - - - -
    a=ptime:20
    a=sendrecv

    ---
        -- Called +74127412@openser
    <--- SIP read from 10.x.x.x:5060 --->
    SIP/2.0 100 Giving a try
    Via: SIP/2.0/UDP 168.x.x.x:5060;branch=z9hG4bK1a2645df;rport=5060
    From: "Remzi Semsettin Turer" <sip:7512@168.x.x.x>;tag=as3ab38a83
    To: <sip:+74127412@linux.domain.com>
    Call-ID: 0ca69c242018dad4057d47e82fbfdde5@168.x.x.x
    CSeq: 102 INVITE
    Server: OpenSER (1.3.1-notls (i386/linux))
    Content-Length: 0


    <------------->
    --- (8 headers 0 lines) ---

    <--- SIP read from 10.x.x.x:5060 --->
    SIP/2.0 183 Session Progress
    FROM: "Remzi Semsettin Turer"<sip:7512@168.x.x.x>;tag=as3ab38a83
    TO: <sip:+74127412@linux.domain.com>;epid=C534DAB535;tag=a715f5592
    CSEQ: 102 INVITE
    CALL-ID: 0ca69c242018dad4057d47e82fbfdde5@168.x.x.x
    VIA: SIP/2.0/UDP 168.x.x.x:5060;branch=z9hG4bK1a2645df;rport=5060
    CONTENT-LENGTH: 0
    SERVER: RTCC/3.0.0.0 MediationServer


    <------------->
    --- (8 headers 0 lines) ---
    ivr2*CLI>
    <--- SIP read from 10.x.x.x:5060 --->
    SIP/2.0 180 Ringing
    FROM: "Remzi Semsettin Turer"<sip:7512@168.x.x.x>;tag=as3ab38a83
    TO: <sip:+74127412@linux.domain.com>;epid=C534DAB535;tag=a715f5592
    CSEQ: 102 INVITE
    CALL-ID: 0ca69c242018dad4057d47e82fbfdde5@168.x.x.x
    VIA: SIP/2.0/UDP 168.x.x.x:5060;branch=z9hG4bK1a2645df;rport=5060
    CONTENT-LENGTH: 0
    SERVER: RTCC/3.0.0.0 MediationServer


    <------------->
    --- (8 headers 0 lines) ---
        -- SIP/openser-08313418 is ringing
    <--- SIP read from 10.x.x.x:5060 --->
    SIP/2.0 200 OK
    FROM: "Remzi Semsettin Turer"<sip:7512@168.x.x.x>;tag=as3ab38a83
    TO: <sip:+74127412@linux.domain.com>;epid=C534DAB535;tag=a715f5592
    CSEQ: 102 INVITE
    CALL-ID: 0ca69c242018dad4057d47e82fbfdde5@168.x.x.x
    VIA: SIP/2.0/UDP 168.x.x.x:5060;branch=z9hG4bK1a2645df;rport=5060
    CONTENT-LENGTH: 244
    SUPPORTED: 100rel
    CONTENT-TYPE: application/sdp
    ALLOW: UPDATE
    SERVER: RTCC/3.0.0.0 MediationServer
    ALLOW: Ack, Cancel, Bye,Invite

    v=0
    o=- 0 0 IN IP4 10.4.21.3
    s=session
    c=IN IP4 10.4.21.3
    b=CT:1000
    t=0 0
    m=audio 63802 RTP/AVP 0 101
    c=IN IP4 10.4.21.3
    a=rtcp:63803
    a=label:Audio
    a=rtpmap:0 PCMU/8000
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-16
    a=ptime:20

    <------------->
    --- (12 headers 14 lines) ---
    Found RTP audio format 0
    Found RTP audio format 101
    Peer audio RTP is at port 10.4.21.3:63802
    Got unsupported a:rtcp in SDP offer
    Found audio description format PCMU for ID 0
    Found audio description format telephone-event for ID 101
    Got unsupported a:fmtp in SDP offer
    Capabilities: us - 0xc (ulaw|alaw), peer - audio=0x4 (ulaw)/video=0x0 (nothing), combined - 0x4 (ulaw)
    Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
    Peer audio RTP is at port 10.4.21.3:63802
    [Sep 30 16:02:58] NOTICE[6424]: chan_sip.c:8027 set_address_from_contact: '' is not a valid SIP contact (missing sipSmile trying to use anyway
    [Sep 30 16:02:58] WARNING[6424]: chan_sip.c:8056 set_address_from_contact: Invalid host name in Contact: (can't resolve in DNS) : ''
    list_route: no route
    Transmitting (no NAT) to 10.x.x.x:5060:
    ACK sip:+74127412@linux.domain.com SIP/2.0
    Via: SIP/2.0/UDP 168.x.x.x:5060;branch=z9hG4bK6a2a750f;rport
    From: "Remzi Semsettin Turer" <sip:7512@168.x.x.x>;tag=as3ab38a83
    To: <sip:+74127412@linux.domain.com>;tag=a715f5592
    Contact: <sip:7512@168.x.x.x>
    Call-ID: 0ca69c242018dad4057d47e82fbfdde5@168.x.x.x
    CSeq: 102 ACK
    User-Agent: Asterisk PBX
    Max-Forwards: 70
    Content-Length: 0


    ---
    Reliably Transmitting (no NAT) to 10.x.x.x:5060:
    BYE sip:+74127412@linux.domain.com SIP/2.0
    Via: SIP/2.0/UDP 168.x.x.x:5060;branch=z9hG4bK4370408d;rport
    From: "Remzi Semsettin Turer" <sip:7512@168.x.x.x>;tag=as3ab38a83
    To: <sip:+74127412@linux.domain.com>;tag=a715f5592
    Call-ID: 0ca69c242018dad4057d47e82fbfdde5@168.x.x.x
    CSeq: 103 BYE
    User-Agent: Asterisk PBX
    Max-Forwards: 70
    X-Asterisk-HangupCause: Normal Clearing
    X-Asterisk-HangupCauseCode: 16
    Content-Length: 0


    ---
    Scheduling destruction of SIP dialog '0ca69c242018dad4057d47e82fbfdde5@168.x.x.x' in 32000 ms (Method: INVITE)
        -- SIP/openser-08313418 answered SIP/7512-08498fa8
    <--- SIP read from 10.x.x.x:5060 --->
    SIP/2.0 200 OK
    FROM: "Remzi Semsettin Turer"<sip:7512@168.x.x.x>;tag=as3ab38a83
    TO: <sip:+74127412@linux.domain.com>;tag=a715f5592;epid=C534DAB535
    CSEQ: 103 BYE
    CALL-ID: 0ca69c242018dad4057d47e82fbfdde5@168.x.x.x
    VIA: SIP/2.0/UDP 168.x.x.x:5060;branch=z9hG4bK4370408d;rport=5060
    CONTENT-LENGTH: 0
    SERVER: RTCC/3.0.0.0 MediationServer


    <------------->
    --- (8 headers 0 lines) ---

    Reliably Transmitting (no NAT) to 10.x.x.x:5060:
    BYE sip:+74127412@linux.domain.com SIP/2.0
    Via: SIP/2.0/UDP 168.x.x.x:5060;branch=z9hG4bK674c340c;rport
    From: "Remzi Semsettin Turer" <sip:7512@168.x.x.x>;tag=as3ab38a83
    To: <sip:+74127412@linux.domain.com>;tag=a715f5592
    Call-ID: 0ca69c242018dad4057d47e82fbfdde5@168.x.x.x
    CSeq: 104 BYE
    User-Agent: Asterisk PBX
    Max-Forwards: 70
    Content-Length: 0


    ---
      == Spawn extension (home, 1134, 1) exited non-zero on 'SIP/7512-08498fa8'

    <--- SIP read from 10.x.x.x:5060 --->
    SIP/2.0 481 Call Leg/Transaction Does Not Exist
    FROM: "Remzi Semsettin Turer"<sip:7512@168.x.x.x>;tag=as3ab38a83
    TO: <sip:+74127412@linux.domain.com>;tag=a715f5592
    CSEQ: 104 BYE
    CALL-ID: 0ca69c242018dad4057d47e82fbfdde5@168.x.x.x
    VIA: SIP/2.0/UDP 168.x.x.x:5060;branch=z9hG4bK674c340c;rport=5060
    CONTENT-LENGTH: 0
    SERVER: RTCC/3.0.0.0 MediationServer


    <------------->
    --- (8 headers 0 lines) ---
    [Sep 30 16:03:30] WARNING[6424]: chan_sip.c:12808 handle_response: Remote host can't match request BYE to call '0ca69c242018dad4057d47e82fbfdde5@168.x.x.x'. Giving up.


    Tuesday, September 30, 2008 8:23 PM

Answers

  •  

    Check two things in your Asterisk sip.conf file with regards to the OpenSER server

     

    1) Deny all - then allow ulaw (no need for anything else)

     

    2) put a line that says NAT=YES

     

    If you use NAT=YES - Asterisk will ALWAYS send communications directly to the OpenSER server instead of trying to 'redirect' directly to the Mediation server - which is Asterisk's default setting.

     

     

    The 'SIP contact' issue is something else - Asterisk cannot recognise the SIP contact as it is sent by OCS - part of the OpenSER config file on this page includes code to correct that.  You might need to remove the # symbols on a few lines of the code to make the SIP contact change work.

     

    http://confluence.terena.org:8080/display/IPTelCB/3.2.7.+Tying+MS+OCS+with+Asterisk+through+OpenSER

     

     

    Regards

     

    Paul Adams

    Thursday, October 2, 2008 8:44 PM

All replies

  •  

    Check two things in your Asterisk sip.conf file with regards to the OpenSER server

     

    1) Deny all - then allow ulaw (no need for anything else)

     

    2) put a line that says NAT=YES

     

    If you use NAT=YES - Asterisk will ALWAYS send communications directly to the OpenSER server instead of trying to 'redirect' directly to the Mediation server - which is Asterisk's default setting.

     

     

    The 'SIP contact' issue is something else - Asterisk cannot recognise the SIP contact as it is sent by OCS - part of the OpenSER config file on this page includes code to correct that.  You might need to remove the # symbols on a few lines of the code to make the SIP contact change work.

     

    http://confluence.terena.org:8080/display/IPTelCB/3.2.7.+Tying+MS+OCS+with+Asterisk+through+OpenSER

     

     

    Regards

     

    Paul Adams

    Thursday, October 2, 2008 8:44 PM
  • It was 1 and 2 along with adding # in front of
            remove_hf("Contact");

    became

    # remove_hf("Contact");


    And that did the trick. Thanks for all the help Paul.

    Friday, October 3, 2008 8:25 PM