我现在在开发一个SIP UA的过程中要实现PC2PHONE的功能遇到了问题。我用的是eXosip,目前PC2PC已经没有了问题。但是我要在实现PC2PHONE的时候,不知道该如何构造对方的TEL URL。比如我现在要呼叫 086-0743-8222032。我试着用了如下方式:
tel:+86-0743-8222032来发起一个INVITE,结果我注册的那个PROXY(SIP SERVER)那里没有反映。我这个SIP SERVER是我的一个朋友给我的中国电信提供的。我已经成功地在这个SIP SERVER上注册成功并呼叫FWD上面的客户端成功。
这里有做过相关软件的朋友吗?能否指点一下这个TEL URL该如何构造?谢谢

解决方案 »

  1.   

    回复人: alec626(月吻长河) ( ) 信誉:100 :
    谢谢,还是有点不明白你能否举个离子?你说的是否是这样?SIP: phonenumber@domain;user=phone这样好象不行吧?
    在RFC:http://www.ietf.org/rfc/rfc2806.txt?number=2806
    这里有一个TEL URL的规范,我看了后,就是不明白里面的telephone-subscriber这个构造2.2 "tel" URL scheme   The URL syntax is formally described as follows. For the basis of
       this syntax, see [RFC2303].telephone-url         = telephone-scheme ":"
                            telephone-subscriber
    telephone-scheme      = "tel"
    telephone-subscriber  = global-phone-number / local-phone-number
    global-phone-number   = "+" base-phone-number [isdn-subaddress]
                            [post-dial] *(area-specifier /
                            service-provider / future-extension)
    base-phone-number     = 1*phonedigit
    local-phone-number    = 1*(phonedigit / dtmf-digit /
                            pause-character) [isdn-subaddress]
                            [post-dial] area-specifier
                            *(area-specifier / service-provider /
                            future-extension)
    isdn-subaddress       = ";isub=" 1*phonedigit
    post-dial             = ";postd=" 1*(phonedigit /
                            dtmf-digit / pause-character)
    area-specifier        = ";" phone-context-tag "=" phone-context-ident
    phone-context-tag     = "phone-context"
    phone-context-ident   = network-prefix / private-prefix
    network-prefix        = global-network-prefix / local-network-prefix
    global-network-prefix = "+" 1*phonedigit
    local-network-prefix  = 1*(phonedigit / dtmf-digit / pause-character)
    private-prefix        = (%x21-22 / %x24-27 / %x2C / %x2F / %x3A /
                            %x3C-40 / %x45-4F / %x51-56 / %x58-60 /
                            %x65-6F / %x71-76 / %x78-7E)
                            *(%x21-3A / %x3C-7E)
                            ; Characters in URLs must follow escaping rules
                            ; as explained in [RFC2396]Vaha-Sipila                 Standards Track                     [Page 4]RFC 2806                URLs for Telephone Calls              April 2000
                            ; See sections 1.2 and 2.5.2
    service-provider      = ";" provider-tag "=" provider-hostname
    provider-tag          = "tsp"
    provider-hostname     = domain ; <domain> is defined in [RFC1035]
                            ; See section 2.5.10
    future-extension      = ";" 1*(token-char) ["=" ((1*(token-char)
                            ["?" 1*(token-char)]) / quoted-string )]
                            ; See section 2.5.11 and [RFC2543]
    token-char            = (%x21 / %x23-27 / %x2A-2B / %x2D-2E / %x30-39
                            / %x41-5A / %x5E-7A / %x7C / %x7E)
                            ; Characters in URLs must follow escaping rules
                            ; as explained in [RFC2396]
                            ; See sections 1.2 and 2.5.11
    quoted-string         = %x22 *( "\" CHAR / (%x20-21 / %x23-7E
                            / %x80-FF )) %x22
                            ; Characters in URLs must follow escaping rules
                            ; as explained in [RFC2396]
                            ; See sections 1.2 and 2.5.11
    phonedigit            = DIGIT / visual-separator
    visual-separator      = "-" / "." / "(" / ")"
    pause-character       = one-second-pause / wait-for-dial-tone
    one-second-pause      = "p"
    wait-for-dial-tone    = "w"
    dtmf-digit            = "*" / "#" / "A" / "B" / "C" / "D"
      

  2.   

    就是这样的
    SIP: phonenumber@domain;user=phone
      

  3.   

    alec626(月吻长河):我在我的程序里试过了:
    sip:phonenumber@domain;user=phone其中这个domain是我的UA注册到上面的那个proxy地址。
    结果还是出现了480错误。这是我抓的包:
    REGISTER sip:218.18.90.11 SIP/2.0
    Via: SIP/2.0/UDP 222.248.101.25:5060;rport;branch=z9hG4bK11904
    From: <sip:[email protected]>;tag=10286
    To: <sip:[email protected]>
    Call-ID: [email protected]
    CSeq: 1 REGISTER
    Contact: <sip:[email protected]>
    Max-Forwards: 5
    User-Agent: eXosip/0.1
    Expires: 3600
    Content-Length: 0
    SIP/2.0 401 Unauthorized
    Via: SIP/2.0/UDP 222.248.101.25:5060;rport;branch=z9hG4bK11904
    To: <sip:[email protected]>
    From: <sip:[email protected]>;tag=10286
    Call-ID: [email protected]
    CSeq: 1 REGISTER
    User-Agent: ZTE-SoftSwitch
    WWW-Authenticate: Digest realm="zte",
    nonce="b7bc7f413c5191ad5c1576d1fff48fb5",
    ZTE-ID=f1213acc7b2192099c074b52bb33cca6
    REGISTER sip:218.18.90.11 SIP/2.0
    Via: SIP/2.0/UDP 222.248.101.25:5060;rport;branch=z9hG4bK41
    From: <sip:[email protected]>;tag=10286
    To: <sip:[email protected]>
    Call-ID: [email protected]
    CSeq: 2 REGISTER
    Contact: <sip:[email protected]>
    Authorization: Digest username="84141301", realm="zte", nonce="b7bc7f413c5191ad5c1576d1fff48fb5", uri="sip:218.18.90.11", response="c3c1573057deb80d3fcfc07ff355f6bd", algorithm=MD5
    Max-Forwards: 5
    User-Agent: eXosip/0.1
    Expires: 3600
    Content-Length: 0
    SIP/2.0 200 OK
    Via: SIP/2.0/UDP 222.248.101.25:5060;rport;branch=z9hG4bK41
    To: <sip:[email protected]>
    From: <sip:[email protected]>;tag=10286
    Call-ID: [email protected]
    CSeq: 2 REGISTER
    Contact: <sip:[email protected]>;expires=3600
    Date: Tue, 03 May 2005 20:20:56 GMT
    User-Agent: ZTE-SoftSwitch
    INVITE sip:[email protected] SIP/2.0
    Via: SIP/2.0/UDP 222.248.101.25:5060;rport;branch=z9hG4bK26500
    From: <sip:[email protected]>;tag=18467
    To: <sip:[email protected]>;user=phone
    Call-ID: [email protected]
    CSeq: 20 INVITE
    Contact: <sip:[email protected]:5060>
    Max-Forwards: 5
    User-Agent: eXosip/0.1
    Subject: hello
    Expires: 120
    Allow: INVITE, ACK, CANCEL, BYE, OPTIONS, REFER, SUBSCRIBE, NOTIFY, MESSAGE
    Content-Type: application/sdp
    Content-Length:   293v=0
    o=userX 20000001 20000001 IN IP4 222.248.101.25
    s=A call
    c=IN IP4 222.248.101.25
    t=1115122834 1115126434
    m=audio 10500 RTP/AVP 0 8 3 110 111
    a=rtpmap:0 PCMU/8000
    a=rtpmap:8 PCMA/8000
    a=rtpmap:3 GSM/8000
    a=rtpmap:110 speex/8000
    a=rtpmap:111 speex/16000
    a=AS:110 20
    a=AS:111 20
    SIP/2.0 100 Trying
    Via: SIP/2.0/UDP 222.248.101.25:5060;rport;branch=z9hG4bK26500
    To: <sip:[email protected]>;user=phone
    From: <sip:[email protected]>;tag=18467
    Call-ID: [email protected]
    CSeq: 20 INVITE
    SIP/2.0 480 Temporarily Unavailable
    Via: SIP/2.0/UDP 222.248.101.25:5060;rport;branch=z9hG4bK26500
    To: <sip:[email protected]>;tag=da126201-5815;user=phone
    From: <sip:[email protected]>;tag=18467
    Call-ID: [email protected]
    CSeq: 20 INVITE
    User-Agent: ZTE Softswitch/1.0.0
    Content-Length: 0