Embodiment one
A kind of Web page application program that realizes that this embodiment provides carries out the principle schematic of the method communicated as shown in Figure 1 with SIP equipment, and concrete handling process as shown in Figure 2, comprises following treatment step:
Step 21, a Web page application program SIP service broker by access to netwoks is set at network side.
The embodiment of the present invention arranges Web page application program SIP service broker at network side, this Web page application program SIP service broker is arranged on the communication port between Web page application program and the SIP equipment of network side, and above-mentioned Web page application program SIP service broker can be realized by the terminal of an operation Session Initiation Protocol or server.Above-mentioned SIP equipment can be SIP equipment.
Above-mentioned Web page application program SIP service broker is assigned at least one IP address, and a Web page application program SIP service broker can act on behalf of one or more Web page application program.Use cross-domain access security control technology that Web page application program SIP service broker and Web page application program can be allowed from different territories.
HTTP/HTTPS(SecureHypertextTransferProtocol is provided with in above-mentioned Web page application program SIP service broker, Secure Hypertext Transfer Protocol) processing unit, SIP processing unit, and HTTP/HTTPS, SIP intercommunication processing unit, and HTTP/HTTPS communication interface and SIP communication interface.
Above-mentioned HTTP/HTTPS processing unit can carry out HTTP/HTTPS session by HTTP/HTTPS communication interface and Web page application program, above-mentioned SIP processing unit can carry out SIP session by SIP communication interface and SIP equipment, and above-mentioned HTTP/HTTPS, SIP intercommunication processing unit can realize HTTP/HTTPS session and SIP session, conversion between HTTP/HTTPS data and SIP data.
Step 22, Web page application program send HTTP/HTTPS request message by HTTP/HTTPS session to Web page application program SIP service broker.
When Web page application program needs the operation such as calling, chat carried out other SIP equipment, the various input information of user are submitted to Web page application program by above-mentioned Web page application program.
Above-mentioned Web page application program obtains the login username of the user of self, access to netwoks address, the network address and port, the data such as sound, image capture device, media coding that use the browser title of Web page application program and version information, browser to support, all data of above-mentioned acquisition are used SDP(SessionDescriptionProtocol by Web page application program, Session Description Protocol) encapsulate, obtain SDP data.Above-mentioned port information comprises and is not limited to NAT(NetworkAddressTranslation, network address translation) information, the above-mentioned network address can be IP address, and above-mentioned access to netwoks address can be URL(UniformResourceLocator, URL(uniform resource locator)).
Above-mentioned Web page application program structure HTTP/HTTPS request message, data field in this HTTP/HTTPS request message is above-mentioned SDP data, the network address of SIP equipment and port information for the purpose of the field of call intent address, action field is the operation information that above-mentioned Web page application program will carry out.
Web page application program and Web page application program SIP service broker set up HTTP/HTTPS session, by described HTTP/HTTPS session, send above-mentioned HTTP/HTTPS request message to described Web page application program SIP service broker.Above-mentioned Web page application program can use the modes such as the HTTPRequest of HTMLForm, XMLHTTPRequest or JSON form that above-mentioned HTTP/HTTPS request message is sent to Web page application program SIP service broker.
Above-mentioned HTTP/HTTPS request message can be invite message etc.
Step 23, Web page application program SIP service broker extract the login username of the user of the Web page application program in HTTP/HTTPS request message, access to netwoks address and the network address and the information such as port information, browser institute support media coding, are stored by the log-on message of the information of extraction as above-mentioned Web page application program.
After HTTP/HTTPS processing unit in above-mentioned Web page application program SIP service broker receives above-mentioned HTTP/HTTPS request message, reply to Web page application program and send successful respond message, such as 200OK message.If correctly do not receive above-mentioned HTTP/HTTPS request message, then reply to Web page application program and send failed message.
When above-mentioned Web page application program SIP service broker receives the HTTP/HTTPS message that above-mentioned Web page application program sends over first time, namely when above-mentioned Web page application program is not registered in above-mentioned Web page application program SIP service broker, above-mentioned Web page application program SIP service broker extracts the login username of the user of the Web page application program carried in above-mentioned HTTP/HTTPS request message, access to netwoks address and the network address and port information, browser title and version information, the sound that browser is supported, image capture device, the data such as media coding, the log-on message of all information extracted as the current login user of above-mentioned Web page application program is stored in the Web page application program customer data base in inner memory cell.Web page application program SIP service broker can carry out screening, providing different services, and can carry out charging respectively for different Web page application programs, login user.
After above-mentioned Web page application program is registered in above-mentioned Web page application program SIP service broker, then Web page application program SIP service broker does not need to store the information of carrying in above-mentioned HTTP/HTTPS request message.And, only can carry the login username of the user of Web page application program, access to netwoks address and the network address and port information in the HTTP/HTTPS request message that next time, Web page application program sent to Web page application program SIP service broker, and not carry the media parameter information such as sound, image capture device, media coding that Web page application program supports.And inquire about above-mentioned Web page application program database by HTTP/HTTPS processing unit according to the login username of the user of the Web page application program received, access to netwoks address and the network address and port information, obtain the media parameter information such as sound, image capture device, media coding that corresponding Web page application program is supported, and add in above-mentioned HTTP/HTTPS request message.
After the information such as sound, image capture device, media coding supported when title and version information, the browser of Web page application program sends and changes, the information such as sound, image capture device, media coding in the HTTP/HTTPS request message that above-mentioned Web page application program sends to Web page application program SIP service broker, the title and version information, browser of carrying above-mentioned Web page application program supported.
The service of described Web page application program sip agent can carry out SIP registration to SIP equipment, and the SIP that also can receive from SIP equipment registers.When SIP equipment is registered to the service of Web page application program sip agent, above-mentioned SIP equipment obtains the data such as its access to netwoks address, the network address and port, device identification, the sound supported, image capture device, media coding, send the SIP registration message carrying above-mentioned data to the service of Web page application program sip agent, the log-on message of all data of carrying in above-mentioned SIP registration message as above-mentioned SIP equipment is stored in the SIP equipment database in inner memory cell by the service of Web page application program sip agent.
Above-mentioned HTTP/HTTPS request message is converted to sip request message by HTTP/HTTPS, SIP intercommunication processing unit in step 24, Web page application program SIP service broker.
This HTTP/HTTPS request message is sent to HTTP/HTTPS, SIP intercommunication processing unit by HTTP/HTTPS processing unit.HTTP/HTTPS, SIP intercommunication processing unit extracts in this HTTP/HTTPS request message the above-mentioned SDP data of carrying, and the network address of object SIP equipment and port information, the operation information that above-mentioned Web page application program will carry out.
HTTP/HTTPS, SIP intercommunication processing unit is according to the call format of SIP session, above-mentioned HTTP/HTTPS request message is converted to sip request message, the above-mentioned SDP data of the data field in above-mentioned HTTP/HTTPS request message are set to the SDP part in above-mentioned sip request message, the network address of the object SIP equipment in the call intent address field in above-mentioned HTTP/HTTPS request message and port information are set to the destination address part in above-mentioned sip request message, the operation information that above-mentioned Web page application program in action field in above-mentioned HTTP/HTTPS request message will carry out is set to the method part in above-mentioned sip request message.
The simple procedure of HTTP and SIP conversion is below described with a little example;
Such as, user A logged on by Web page application program the Web page application program SIP service broker that domain name is sipproxy.com, and the user B that present A will be the SIP equipment of sipserver.com to domain name initiates audio call.With the URL of the statement A of Session Initiation Protocol be now:sip:Asipproxy.com, the URL of B issip:Bsipserver.com.
First, the Web page application program at user A place needs to obtain the data such as sound, image capture device, media coding that self the network address and port, browser title and version information, browser are supported, above-mentioned data are used SDP(SessionDescriptionProtocol by Web page application program, Session Description Protocol) encapsulate, obtain SDP data.A kind of above-mentioned SDP data that this embodiment provides specific as follows:
v=0
o=-00INIP4127.0.0.1
s=
c=INIP40.0.0.0
t=00
m=audio1RTP/AVPF1031040810610513126
a=candidate:12udp1142.133.114.3752750typhostnamertcp
a=candidate:11udp1142.133.114.3752751typhostnamertp
a=mid:audio
a=rtcp-mux
a=crypto:0AES_CM_128_HMAC_SHA1_32inline:aIz76FzkcxEFR1wp+u338L2+quDHyRN7Zf4MRuhl
a=crypto:1AES_CM_128_HMAC_SHA1_80inline:Cb2lRZHfCaT3IY+t+/XM7b/f0UVDULozbudPjGB1
a=rtpmap:103ISAC/16000
a=rtpmap:104ISAC/32000
a=rtpmap:0PCMU/8000
a=rtpmap:8PCMA/8000
a=rtpmap:106CN/32000
a=rtpmap:105CN/16000
a=rtpmap:13CN/8000
a=rtpmap:126telephone-event/8000
For the HTTPREQUEST of JSON form, the HTTP inclusion data format that Web page application program sends is as follows:
Described Web page application program SIP service broker, after receiving this HTTP request message, transfers it to sip request message, sends to sipserver.com.Above-mentioned sip request message is as follows: From:<
sip:Asipproxy.comsip:Asipproxy.comsip:Asipproxy.com>;tag=xxxx
To:sip:Bsipserver.comsip:Bsipserver.com;Call-ID:…..
CSeq:1INVITE
Via:SIP/2.0/UDPsipproxy.com;…..
Content-Type:application/SDP
a=rtcp-mux
a=candidate:12udp1142.133.114.3752750typhostnamertcp
a=candidate:11udp1142.133.114.3752751typhostnamertp
a=crypto:0AES_CM_128_HMAC_SHA1_32inline:aIz76FzkcxEFR1wp+u338L2+quDHyRN7Zf4MRuhl
a=crypto:1AES_CM_128_HMAC_SHA1_80inline:Cb2lRZHfCaT3IY+t+/XM7b/f0UVDULozbudPjGB1
a=rtpmap:103ISAC/16000
a=rtpmap:104ISAC/32000
a=rtpmap:0PCMU/8000
a=rtpmap:8PCMA/8000
a=rtpmap:106CN/32000
a=rtpmap:105CN/16000
a=rtpmap:13CN/8000
a=rtpmap:126telephone-event/8000
Then, the sip request message be converted to is sent to SIP processing unit by above-mentioned HTTP/HTTPS, SIP intercommunication processing unit.
Above-mentioned sip request message is sent to object SIP equipment by SIP session by step 25, above-mentioned Web page application program SIP service broker.
After SIP processing unit receives above-mentioned sip request message, extract the network address and the port information of the SIP equipment of carrying in above-mentioned sip request message, inquire about above-mentioned SIP equipment database according to the network address of this SIP equipment and port information, obtain the access to netwoks address in the log-on message of above-mentioned SIP equipment.
If above-mentioned purpose SIP equipment is not registered in above-mentioned Web page application program SIP service broker, then Web page application program SIP service broker can notify that above-mentioned purpose SIP equipment completes registration as early as possible or waits for that above-mentioned purpose SIP equipment completes registration.
Then, set up SIP session between above-mentioned SIP processing unit and object SIP equipment, according to the access to netwoks address of object SIP equipment, the network address and port information, above-mentioned sip request message is sent to object SIP equipment.
Step 26, object SIP equipment send SIP response message by SIP session to above-mentioned Web page application program SIP service broker.
After object SIP equipment receives above-mentioned sip request message, the data such as sound, image capture device, media coding that the login username of the user of the Web page application program carried in above-mentioned sip request message in advance, URL and the network address and port information, browser title and version information, browser are supported, process accordingly to this sip request message.
Then, object SIP equipment obtains self data such as device identification, access to netwoks address, the network address and port, the sound self supported, image capture device, media coding, and the login username of the user of above-mentioned Web page application program, all data of above-mentioned acquisition use SDP to encapsulate by object SIP equipment, obtain SDP data.If object SIP equipment completes registration in above-mentioned Web page application program SIP service broker, then in above-mentioned SDP data can a Portable device mark, access to netwoks address, the network address and port information, and the login username of the user of above-mentioned Web page application program.
Above-mentioned purpose SIP equipment structure SIP response message, the SDP part in this SIP response message is above-mentioned SDP data, and destination address part is the network address and the port information of above-mentioned browser, and method part is the operation information that SIP equipment will be carried out.
Then, set up SIP session between object SIP equipment and above-mentioned Web page application program SIP service broker, send SIP response message by this SIP session to above-mentioned Web page application program SIP service broker.
Above-mentioned SIP response message is converted to HTTP/HTTPS response message by HTTP/HTTPS, SIP intercommunication processing unit in step 27, Web page application program SIP service broker.
After SIP processing unit in above-mentioned Web page application program SIP service broker receives above-mentioned SIP response message, reply to above-mentioned SIP equipment and send successful respond message.
When above-mentioned Web page application program SIP service broker receives the sip message that above-mentioned SIP equipment sends over first time, namely when above-mentioned SIP equipment is not registered in above-mentioned Web page application program SIP service broker, above-mentioned Web page application program SIP service broker extracts the device identification of the SIP equipment in the SDP data of carrying in above-mentioned SIP response message, access to netwoks address and the network address and port information, the sound that SIP equipment is supported, image capture device, the data such as media coding, using all information of extracting as in SIP equipment database in the memory cell of inside of the log-on message association store of above-mentioned SIP equipment.
After above-mentioned SIP equipment is registered in above-mentioned Web page application program SIP service broker, then Web page application program SIP service broker does not need to store the information of carrying in above-mentioned SIP response message.And, when only carrying the device identification of SIP equipment, access to netwoks address and the network address and port information in the sip message that next time, SIP equipment sent to Web page application program SIP service broker, SIP processing unit inquires about above-mentioned SIP equipment database according to the device identification of the SIP equipment received, the network address and port information, obtain the media parameter information such as sound, image capture device, media coding that corresponding SIP equipment is supported, and add in above-mentioned sip message.
Above-mentioned SIP response message is sent to HTTP/HTTPS, SIP intercommunication processing unit in Web page application program SIP service broker by above-mentioned SIP processing unit.HTTP/HTTPS, SIP intercommunication processing unit inquires about above-mentioned Web page application program customer data base according to the login username of the user of the Web page application program carried in SIP response message, obtain the access to netwoks address of above-mentioned Web page application program, the network address and port information, and the media parameter information such as sound, image capture device, media coding that Web page application program is supported.
Described HTTP/HTTPS, SIP intercommunication processing unit is according to the call format of HTTP/HTTPS session, described SIP response message is converted to HTTP/HTTPS response message by the media parameter information based on above-mentioned Web page application program, the above-mentioned SDP data of the SDP part in above-mentioned SIP response message are set to the data field in above-mentioned HTTP/HTTPS response message, the network address of the Web page application program in the destination address part in above-mentioned SIP response message and port information are set to the call intent address field in above-mentioned HTTP/HTTPS response message, the operation information that above-mentioned SIP equipment in method part in above-mentioned SIP response message will be carried out is set to the action field in above-mentioned HTTP/HTTPS response message.
Above-mentioned HTTP/HTTPS response message is sent to Web page application program by HTTP/HTTPS session according to polling mechanism or full duplex communication mechanism by step 28, Web page application program SIP service broker.
Then, above-mentioned HTTP/set up HTTP/HTTPS session between HTTPS, SIP intercommunication processing unit and above-mentioned Web page application program, sends to Web page application program according to polling mechanism or full duplex communication mechanism by above-mentioned HTTP/HTTPS response message by this HTTP/HTTPS session.
What this embodiment provided sends to the processing procedure of Web page application program as Fig. 3 above-mentioned HTTP/HTTPS response message according to long polling mechanism, according to short polling mechanism, above-mentioned HTTP/HTTPS response message is sent to the processing procedure of Web page application program as shown in Figure 4, at Fig. 3, in 4, Web page application program sends query messages according to the time interval of setting to Web page application program SIP service broker, whether inquiry has SIP equipment to return the response message come, after Web page application program SIP service broker receives above-mentioned query messages, above-mentioned HTTP/HTTPS response message is sent to Web page application program.In addition, the WebSocket standard of SPDY agreement and HTML5 provides real duplex communication capabilities, makes described Web page application program SIP service broker can push to browser the sip message be converted in real time.
SPDY agreement likely becomes Hypertext Transfer Protocol Next Generation standard, and on the popular browser such as GoogleChrome, MozillaFirefox, obtains realization.The protocol provides for the ability of server active push message.
WebSocket(webpage socket) be the network technology that full duplex communication is provided between HTML5 a kind of browser of starting to provide and server.
Above-mentioned HTTP/HTTPS response message by setting up full duplex communication mechanism between SPDY or WebSocket and Web page application program, can be sent to Web page application program according to this full duplex communication mechanism by above-mentioned Web page application program SIP service broker.
Above-mentioned various ways can coexist, and automatically can change according to browser capabilities.
Like this, just achieve the communication between two-way Web page application program to SIP equipment, based on the embodiment of the present invention, the VoIP video/audio communication between Web page application program and the SIP equipment of server end can be realized, instant message communicates with state aware etc.
Embodiment two
This embodiment offers a kind of system realizing Web page application program and SIP equipment and carry out communicating, its concrete structure as shown in Figure 5, comprises following module: Web page application program 51, Web page application program SIP service broker 52 and SIP equipment 53.
Described Web page application program 51, sends HTTP/HTTPS request message for using HTTP/HTTPS agreement to the Web page application program SIP service broker of network side;
Web page application program SIP service broker 52, for described HTTP/HTTPS request message is converted to sip message, and sets up SIP session between SIP equipment, utilize described SIP session that described sip message is sent to described SIP equipment;
SIP equipment 53, for receiving the sip message that described Web page application program SIP service broker sends over.
Concrete, the concrete structure of a kind of Web page application program sip agent that this embodiment provides comprises as shown in Figure 6:
SIP processing unit 61, HTTP/HTTPS, SIP intercommunication processing unit 62, HTTP/HTTPS processing unit 63 and memory cell 64, and, and HTTP/HTTPS communication interface and SIP communication interface.
Described HTTP/HTTPS processing unit 63, for carrying out HTTP/HTTPS session by HTTP/HTTPS communication interface and client browser;
Described SIP processing unit 61, for carrying out SIP session by SIP communication interface and SIP equipment;
Described HTTP/HTTPS, SIP intercommunication processing unit 62, for realizing HTTP/HTTPS session and SIP session, conversion between HTTP/HTTPS data and SIP data.
Described memory cell 64, specifically for by the log-on message of SIP equipment database purchase SIP equipment, this log-on message comprises: sound, image capture device, media coding data that the device identification of SIP equipment, access to netwoks address and the network address and port information, SIP equipment are supported;
The log-on message of active user of Web page application program is stored, sound, image capture device, media coding data that this log-on message comprises the login username of the user of Web page application program, access to netwoks address and the network address and port information, uses the browser title of described Web page application program and version information, browser to support by Web page application program customer data base.
Concrete, described Web page application program 51, during specifically for needing to communicate with object SIP equipment when Web page application program, obtain the login username of active user, access to netwoks address, the network address and port, the sound, image capture device, the media coding data that use the browser title of described Web page application program and version information, browser to support, use Session Description Protocol SDP to encapsulate all data obtained, obtain SDP data;
Structure HTTP/HTTPS request message, data field in this HTTP/HTTPS request message is described SDP data, the network address of SIP equipment and port information for the purpose of the field of call intent address, action field is the operation information that described Web page application program will carry out;
Set up HTTP/HTTPS session with Web page application program SIP service broker, by described HTTP/HTTPS session, send described HTTP/HTTPS request message to described Web page application program SIP service broker.
Concrete, described Web page application program SIP service broker 52, specifically for extracting the data such as sound, image capture device, media coding that the login username of the user of the Web page application program carried in described HTTP/HTTPS request message, access to netwoks address and the network address and port information, browser title and version information, browser are supported, all information extracted are stored in the Web page application program customer data base in inner memory cell as the log-on message of the active user of described Web page application program;
The described SDP data of carrying are extracted in the data field of described HTTP/HTTPS request message by described HTTP/HTTPS, SIP intercommunication processing unit, the network address of the object SIP equipment of carrying in the field of call intent address and port information, the operation information that the described Web page application program carried in action field will carry out;
By the call format of described HTTP/HTTPS, SIP intercommunication processing unit according to SIP session, described HTTP/HTTPS request message is converted to sip request message, described SDP data are set to the SDP part in described sip request message, the network address of described object SIP equipment and port information are set to the destination address part in described sip request message, the operation information that described Web page application program will carry out are set to the method part in described sip request message.
Further, by described HTTP/HTTPS, SIP intercommunication processing unit, described sip request message is sent to described SIP processing unit, described SIP processing unit extracts the network address and the port information of the SIP equipment of carrying in described sip request message, inquire about according to the network address of this SIP equipment and port information the SIP equipment database stored in the memory cell of described Web page application program SIP service broker, obtain the access to netwoks address in the log-on message of described SIP equipment; Sound, image capture device, media coding data that the device identification of storage purpose SIP equipment in described SIP equipment database, access to netwoks address, the network address and port, SIP equipment are supported;
Set up SIP session between described SIP processing unit and object SIP equipment, according to the access to netwoks address of described object SIP equipment, the network address and port information, described sip request message is sent to object SIP equipment.
Concrete, described object SIP equipment 53, specifically for processing accordingly described sip request message, obtain the device identification of self, access to netwoks address, the network address and port, the sound self supported, image capture device, media coding data, and the login username data of the user of described Web page application program, use SDP to encapsulate all described data obtained, obtain SDP data;
Structure SIP response message, SDP part in this SIP response message is described SDP data, destination address part is the network address and the port information of described Web page application program, method part is the operation information that SIP equipment will be carried out, and set up SIP session between described Web page application program SIP service broker, send SIP response message by this SIP session to described Web page application program SIP service broker;
Described Web page application program SIP service broker, also for inquiring about described Web page application program customer data base by described HTTP/HTTPS, SIP intercommunication processing unit according to the login username of the user of the Web page application program carried in described SIP response message, obtain the access to netwoks address of described Web page application program, the network address and port information, and the media parameter information such as sound, image capture device, media coding that Web page application program is supported;
By the call format of described HTTP/HTTPS, SIP intercommunication processing unit according to HTTP/HTTPS session, described SIP response message is converted to HTTP/HTTPS response message, SDP part in described SIP response message is set to the data field in described HTTP/HTTPS response message, destination address part is set to the call intent address field in described HTTP/HTTPS response message, and method part is set to the action field in described HTTP/HTTPS response message;
By setting up HTTP/HTTPS session between described HTTP/HTTPS, SIP intercommunication processing unit and described Web page application program, according to polling mechanism or full duplex communication mechanism, described HTTP/HTTPS response message is sent to described Web page application program by this HTTP/HTTPS session.
Realize by the system of the embodiment of the present invention detailed process that Web page application program and SIP equipment carry out communicating and preceding method embodiment similar, repeat no more herein.
One of ordinary skill in the art will appreciate that: accompanying drawing is the schematic diagram of an embodiment, the module in accompanying drawing or flow process might not be that enforcement the present invention is necessary.
One of ordinary skill in the art will appreciate that: the module in the equipment in embodiment can describe according to embodiment and be distributed in the equipment of embodiment, also can carry out respective change and be arranged in the one or more equipment being different from the present embodiment.The module of above-described embodiment can merge into a module, also can split into multiple submodule further.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-OnlyMemory, ROM) or random store-memory body (RandomAccessMemory, RAM) etc.
In sum, the embodiment of the present invention is by arranging Web page application program SIP service broker at network side, this Web page application program SIP service broker realizes HTTP/HTTPS session and SIP session, conversion between HTTP/HTTPS data and SIP data, can realize the VoIP video/audio communication between Web page application program and the SIP equipment of server end, instant message communicates with state aware etc.
The embodiment of the present invention makes to carry out seamless communication with the VoIP system/equipment/software/terminal of vast support Session Initiation Protocol based on the application program of webpage, and then and PSTN(PublicSwitchedTelephoneNetwork, PSTN) in conventional telephone set communicate.
The above; be only the present invention's preferably embodiment, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; the change that can expect easily or replacement, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of claim.