CN113489717A - Internal and external network intercommunication method, device, equipment and storage medium based on SIP protocol - Google Patents

Internal and external network intercommunication method, device, equipment and storage medium based on SIP protocol Download PDF

Info

Publication number
CN113489717A
CN113489717A CN202110750044.6A CN202110750044A CN113489717A CN 113489717 A CN113489717 A CN 113489717A CN 202110750044 A CN202110750044 A CN 202110750044A CN 113489717 A CN113489717 A CN 113489717A
Authority
CN
China
Prior art keywords
address
service unit
target
call request
intranet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110750044.6A
Other languages
Chinese (zh)
Inventor
王志翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Feixun Digital Technology Co ltd
Original Assignee
Beijing Feixun Digital Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Feixun Digital Technology Co ltd filed Critical Beijing Feixun Digital Technology Co ltd
Priority to CN202110750044.6A priority Critical patent/CN113489717A/en
Publication of CN113489717A publication Critical patent/CN113489717A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1101Session protocols
    • H04L65/1104Session initiation protocol [SIP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/256NAT traversal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management

Abstract

The embodiment of the invention discloses an internal and external network intercommunication method, a device, equipment and a storage medium based on an SIP protocol. The method is applied to the SIP client of the enterprise intranet and comprises the following steps: responding to the pulling operation of the target media stream, and sending a first call request to an SIP server; the SIP server is deployed in a target external network server, and the first call request comprises an internal network IP address and an internal network port number of the SIP client and a matched external network IP address and an external network port number; receiving a first response message which comprises a target external network IP address used by a media processing service unit for sending a target media stream to an SIP client; and receiving the target media stream through the external network IP address and the external network port, and sending the target media stream to the internal network IP address and the internal network port. The technical scheme of the embodiment of the invention realizes the intercommunication of the internal network and the external network based on the SIP protocol and ensures the message transmission and the media stream push between the internal network and the external network.

Description

Internal and external network intercommunication method, device, equipment and storage medium based on SIP protocol
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to an internal and external network intercommunication method, device, equipment and storage medium based on an SIP protocol.
Background
With the progress of computer science and technology, Internet Protocol (IP) data networks based on packet switching technology replace the core position of the traditional telephone network based on circuit switching in the communication field due to the convenience and cheapness of the data networks. Session Initiation Protocol (SIP) is an application layer signaling control Protocol, and can provide complete Session creation and Session change services for various instant messaging services, so that the security of the SIP Protocol plays a crucial role in the security of instant messaging.
The inventor discovers that in the process of implementing the invention: at present, the JAVA implementation mode of the SIP protocol is JAIN SIP, but the SIP stack needs to transmit a specific IP address and port for monitoring during initialization, and cannot monitor the access of the external network when transmitting the internal network IP, and cannot monitor the access of the internal network when transmitting the external network IP. Therefore, when the internal and external network equipment needs to interact with the SIP server, the internal and external network IP addresses can be identified because the SIP server does not support the simultaneous monitoring of the internal network IP address and the external network IP address. If the intranet address is monitored, the intranet equipment can normally access, and the extranet equipment cannot access; if the outer network address is monitored, the outer network equipment can normally access, and the inner network equipment cannot access.
Disclosure of Invention
The embodiment of the invention provides an internal and external network intercommunication method, device, equipment and storage medium based on an SIP protocol, which realize the internal and external network intercommunication based on the SIP protocol and ensure the message transmission and media stream push between the internal and external networks.
In a first aspect, an embodiment of the present invention provides an internal and external network interworking method based on an SIP protocol, applied to a session initiation protocol SIP client deployed in an intranet, including:
responding to the pulling operation of the target media stream, and sending a first call request to a signaling control service unit of the SIP server;
the SIP server is deployed in a target external network server, and the first call request comprises an internal network IP address and an internal network port number of the SIP client, and an external network IP address and an external network port number which are matched with the internal network IP address and the internal network port number;
receiving a first response message corresponding to the first call request forwarded by the signaling control service unit; the first response message includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client;
and receiving a target media stream sent by the media processing service unit through the target external network IP address through the external network IP address and the external network port in the first call request, and sending the target media stream to the internal network IP address and the internal network port in the first call request.
Optionally, before sending the first call request to the signaling control service unit of the SIP server in response to the pull operation on the target media stream, the method further includes:
a Network Address Translation (NAT) function is added to a media library source code file of the SIP client.
Optionally, sending the first call request to the signaling control service unit of the SIP server in response to the pull operation on the target media stream, where the sending includes:
responding to the pulling operation of the target media stream, and generating a call request corresponding to the target media stream;
writing an intranet IP address and an intranet port number of the SIP client, and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number in the call request;
and sending the call request as a first call request to a signaling control service unit.
In a second aspect, an embodiment of the present invention further provides an internal and external network interworking method based on an SIP protocol, which is applied to an SIP server deployed in a target external network server, and includes:
the signaling control service unit receives a first call request which is sent by the SIP client and corresponds to the target media stream, and sends a second call request which corresponds to the target media stream to the media processing service unit in the SIP server;
the SIP client is deployed in an enterprise intranet, and the first call request comprises an intranet IP address and an intranet port number of the SIP client and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number;
the signaling control service unit receives a second response message corresponding to the second call request returned by the media processing service unit and sends the second response message to the coding unit, and the second response message sent by the signaling control service unit to the coding unit includes: the media processing service unit receives a target external network IP address used by the target media stream sent by the coding unit;
the signaling control service unit receives a first response message corresponding to the first call request returned by the media processing service unit and sends the first response message to the SIP client; the first response message sent by the signaling control service unit to the SIP client includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client;
and the media processing service unit is used for sending the target media stream to the external network IP address and the external network port in the first call request so as to send the target media stream to the internal network IP address and the internal network port in the first call request through the external network IP address and the external network port.
Optionally, before the receiving, by the signaling control service unit, the first call request corresponding to the target media stream sent by the SIP client, the method further includes:
the method for creating the listening point in the SIP protocol stack in the source code file of the SIP server is modified into the method for binding the target IP address forcibly.
Optionally, the signaling control service unit receives a second response message corresponding to the second call request and returned by the media processing service unit, and sends the second response message to the encoding unit, where the second response message includes:
the signaling control service unit receives a second response message which is returned by the media processing service unit and corresponds to the second call request;
modifying the target intranet IP address in the second response message into a corresponding target extranet IP address, and sending the target intranet IP address to the coding unit; and the number of the first and second groups,
the signaling control service unit receives a first response message corresponding to the first call request returned by the media processing service unit and sends the first response message to the SIP client, and the signaling control service unit comprises:
the signaling control service unit receives a first response message which is returned by the media processing service unit and corresponds to the first call request;
and modifying the target intranet IP address in the first response message into a corresponding target extranet IP address, and sending the target intranet IP address to the SIP client.
In a third aspect, an embodiment of the present invention further provides an internal and external network interworking apparatus based on an SIP protocol, applied to an SIP client deployed in an intranet, including:
a first call request sending module, configured to send a first call request to a signaling control service unit of an SIP server in response to a pull operation on a target media stream;
the SIP server is deployed in a target external network server, and the first call request comprises an internal network IP address and an internal network port number of the SIP client, and an external network IP address and an external network port number which are matched with the internal network IP address and the internal network port number;
a first response receiving module, configured to receive a first response message corresponding to the first call request, where the first response message is forwarded by the signaling control service unit; the first response message includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client;
and the media stream receiving module is used for receiving a target media stream sent by the media processing service unit through the target external network IP address through the external network IP address and the external network port in the first call request and sending the target media stream to the internal network IP address and the internal network port in the first call request.
In a fourth aspect, an embodiment of the present invention further provides an internal and external network interworking apparatus based on an SIP protocol, which is applied to an SIP server deployed in a target external network server, and includes:
the first call request receiving module is used for receiving a first call request which is sent by the SIP client and corresponds to a target media stream through the signaling control service unit and sending a second call request which corresponds to the target media stream to the media processing service unit in the SIP server;
the SIP client is deployed in an enterprise intranet, and the first call request comprises an intranet IP address and an intranet port number of the SIP client and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number;
a second response receiving module, configured to receive, through the signaling control service unit, a second response message corresponding to the second call request and returned by the media processing service unit, and send the second response message to the encoding unit, where the second response message sent by the signaling control service unit to the encoding unit includes: the media processing service unit receives a target external network IP address used by the target media stream sent by the coding unit;
the first response sending module is used for receiving a first response message which is returned by the media processing service unit and corresponds to the first call request through the signaling control service unit and sending the first response message to the SIP client; the first response message sent by the signaling control service unit to the SIP client includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client;
and the media stream sending module is used for sending the target media stream to the external network IP address and the external network port in the first call request through the media processing service unit so as to send the target media stream to the internal network IP address and the internal network port in the first call request through the external network IP address and the external network port.
In a fifth aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a memory for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for interworking between internal and external networks based on the SIP protocol provided by any embodiment of the present invention.
In a sixth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the program, when executed by a processor, implements an internal and external network interworking method based on an SIP protocol according to any embodiment of the present invention.
The technical scheme of the embodiment of the invention is deployed at an SIP client of an enterprise intranet, responds to the pulling operation of a target media stream, and sends a first call request to a signaling control service unit of an SIP server; the SIP server is deployed in a target external network server, and the first call request comprises an internal network IP address and an internal network port number of the SIP client, and an external network IP address and an external network port number which are matched with the internal network IP address and the internal network port number; receiving a first response message corresponding to the first call request forwarded by the signaling control service unit; the first response message includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client; through the outer network IP address and the outer network port in the first call request, the target media stream sent by the media processing service unit through the target outer network IP address is received, and the target media stream is sent to the inner network IP address and the inner network port in the first call request. Specifically, by converting the target intranet IP in the response message fed back by the media processing service unit for the first call request into the corresponding target extranet IP, the IP address used by the media processing service unit of the SIP server to transmit the target media stream can be determined even if the client cannot recognize the target intranet IP address. The target media stream is received by the extranet IP and the port in the first call request and then sent to the intranet IP and the port, so that the target media stream can be pushed to the intranet IP address and the port even if the SIP server only can access the extranet, intercommunication of the intranet and the extranet based on the SIP protocol is realized, and message transmission and media stream pushing between the intranet and the extranet are ensured.
Drawings
Fig. 1 is a flowchart of an internal and external network interworking method based on an SIP protocol according to a first embodiment of the present invention;
fig. 2 is a flowchart of an internal and external network interworking method based on the SIP protocol in the second embodiment of the present invention;
fig. 3 is a signaling interaction diagram of an internal and external network interworking method based on the SIP protocol in the third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an internal and external network interworking apparatus based on the SIP protocol in the fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an internal and external network interworking apparatus based on the SIP protocol in the fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device in a sixth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of an internal and external network interworking method based on the SIP protocol in an embodiment of the present invention, which is applicable to a case where an SIP client obtains a media stream from an external network of an SIP server by using an intranet IP address, and the method can be performed by an internal and external network interworking apparatus based on the SIP protocol, which can be implemented by software and/or hardware, and can be generally integrated in an electronic device, for example, in an SIP client, and used in cooperation with the SIP server. With reference to fig. 1, the method is applied to an SIP client deployed in an intranet, and specifically includes the following steps:
step 110, responding to the pull operation of the target media stream, and sending a first call request to a signaling control service unit of the SIP server.
The SIP server is deployed in a target external network server, and the first call request comprises an internal network IP address and an internal network port number of the SIP client, and an external network IP address and an external network port number which are matched with the internal network IP address and the internal network port number.
In this embodiment, the SIP client is deployed in an intranet, and mainly includes a user interaction interface and a decoding unit, and the SIP server is deployed in a target extranet server, and mainly includes an application service unit, a signaling control service unit, and a media processing service unit. When a user carries out on-demand operation on a user interaction interface provided by the SIP client, the decoding unit can determine a target media stream corresponding to on-demand service, further generate a first call request corresponding to the target media stream and send the first call request to the signaling control service unit of the SIP server, so that media connection is established between the decoding unit and the media processing service unit in the SIP server through the signaling control service unit, and the target media stream is obtained.
The intranet IP address is also called a private address and is a non-registered address, is not distributed by the Internet and is not allowed to appear in the Internet, and a user cannot see the intranet IP address in the Internet. Therefore, the internet cannot be accessed directly using the intranet address. The extranet IP address, also known as a public address, is assigned to an organization that registers and applies for on the internet. Public addresses are globally unique, and it is unlikely that there will be two identical IP addresses in a public network. The intranet IP address of the SIP client in this embodiment may be an IP address allocated by the client in an enterprise intranet, and may be used only inside an enterprise, and the intranet port is a port used when accessing the enterprise intranet; the external network IP address of the SIP client can be a public address applied by an enterprise to the Internet and used for the client in the enterprise to access the Internet, and the external network port is a port used when accessing the Internet.
Optionally, before sending the first call request to the signaling control service unit of the SIP server in response to the pull operation on the target media stream, the method may further include: and adding an NAT function in a media library source code file of the SIP client.
In this embodiment, in order to ensure the transmission of the intranet and extranet messages, an NAT traversal function may be added to the SIP client, and the intranet and extranet IP address conversion processing is performed on the IP address in the Session Description Protocol (SDP) message in the call request sent by the client, so that the call request may carry both the IP address and port number of the intranet and the extranet of the enterprise, and thus, the message intercommunication between the intranet and extranet of the enterprise may be achieved.
In this embodiment, the media library source code file and the NAT function code of the SIP client may be obtained in advance, then the NAT function code is written into a corresponding position in the media library source code file, the modified media library source code file is compiled, and the DLL file related to the modified media library source code file is compiled and replaced at the same time, so that the client has a network address translation function.
The NAT function is used for converting an internal network address into an external network address in the router to be connected with the external Internet. Because the public external network IP address in the router is used for connecting the Internet, the client in the internal network displays the public external network IP address of the router in the Internet, thereby not only providing a certain degree of safety, but also effectively relieving the problem of exhaustion of the available IP address space.
Among them, there are three ways to implement NAT, i.e., static translation, dynamic translation, and port multiplexing. Static conversion means that an internal network IP address is converted into an external network IP address one to one, and a certain internal network IP address is only converted into a certain external network IP address. By means of static conversion, access of the external network to certain specific devices (e.g. servers) in the internal network can be achieved. Dynamic translation means that all intranet addresses authorized to access the internet can be randomly translated into any specified legal extranet address. When the IP address of the external network is slightly less than the number of computers in the network, a dynamic conversion mode can be adopted. Port multiplexing refers to changing the source port of an outgoing data packet and performing port conversion, and all hosts of an internal network can share a legal external network IP address to realize access to the Internet.
Optionally, sending the first call request to the signaling control service unit of the SIP server in response to the pull operation on the target media stream, where the sending may include: responding to the pulling operation of the target media stream, and generating a call request corresponding to the target media stream; writing an intranet IP address and an intranet port number of the SIP client, and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number in the call request; and sending the call request as a first call request to a signaling control service unit.
In this embodiment, when the user performs the on-demand operation on the user interaction interface, the decoding unit may determine the target media stream corresponding to the on-demand service, and generate the call request corresponding to the target media stream according to the signaling format of the call request. The calling request carries SDP message body with one-way media receiving attribute, the message header field carries Subject field to indicate the initial initiator of the session, the s field in SDP message body is 'Play' to represent real-time on-demand. Then, the intranet IP address and the intranet port number of the SIP client are obtained, and the Via header field in the call request is written. And converting the internal network IP address according to the NAT function, and determining an external network IP address and an external network port number which are matched with the internal network IP address and the internal network port number. And writing the external network IP address and the external network port number into a Contact header field and a Subject header field in the call request to obtain a first call request. And sending the first call request to a signaling control service unit of the SIP server so as to establish media connection with a media processing service unit by taking the signaling control service unit as a decoding unit.
And step 120, receiving a first response message corresponding to the first call request forwarded by the signaling control service unit.
Wherein, the first response message includes: the media processing service unit sends the target external network IP address used by the target media stream to the SIP client.
In this embodiment, after sending the first call request to the signaling control service unit, the decoding unit receives a first response message forwarded by the signaling control service unit, and determines, according to the first response message, a target extranet IP address used by the media processing service unit to send the target media stream to the client.
The process of the signaling control service unit acquiring the first response message is as follows: after receiving the first call request, the signaling control service unit sends a corresponding call request to the media processing service unit, and after receiving the request, the media processing service unit replies a 200OK response carrying an SDP message body, wherein the SDP message body describes the contents of an IP address, a port, a media format and the like of a target media stream sent by the media processing service unit. Because the IP address in the response message is the target intranet IP address, and the client cannot identify the target intranet IP address, the signaling control service unit converts the target intranet IP address in the 200OK response message returned by the media processing service unit into the target extranet IP address, and then forwards the response message to the client.
Step 130, receiving a target media stream sent by the media processing service unit through the target external network IP address through the external network IP address and the external network port in the first call request, and sending the target media stream to the internal network IP address and the internal network port in the first call request.
In this embodiment, after receiving the first response message returned by the signaling control service unit and completing establishing the connection between the decoding unit and the media processing service unit, the media processing service unit transmits the target media stream to the client. Because the SIP server can only access the extranet of the enterprise, the client receives the target media stream sent by the media processing service unit through the target extranet IP address through the extranet IP address and the extranet port of the enterprise, and then sends the target media stream to the intranet IP address and the intranet port corresponding to the extranet IP address, and the target media stream is displayed to the on-demand user, so that the on-demand task of the user is completed.
According to the technical scheme of the embodiment of the invention, the SIP client deployed in an enterprise intranet responds to the pulling operation of a target media stream and sends a first call request to a signaling control service unit of an SIP server; the SIP server is deployed in a target external network server, and the first call request comprises an internal network IP address and an internal network port number of the SIP client, and an external network IP address and an external network port number which are matched with the internal network IP address and the internal network port number; receiving a first response message corresponding to the first call request forwarded by the signaling control service unit; the first response message includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client; through the outer network IP address and the outer network port in the first call request, the target media stream sent by the media processing service unit through the target outer network IP address is received, and the target media stream is sent to the inner network IP address and the inner network port in the first call request.
Specifically, by converting the target intranet IP in the response message fed back by the media processing service unit for the first call request into the corresponding target extranet IP, the IP address used by the media processing service unit of the SIP server to transmit the target media stream can be determined even if the client cannot recognize the target intranet IP address. The target media stream is received by the extranet IP and the port in the first call request and then sent to the intranet IP and the port, so that the target media stream can be pushed to the intranet IP address and the port even if the SIP server only can access the extranet, intercommunication of the intranet and the extranet based on the SIP protocol is realized, and message transmission and media stream pushing between the intranet and the extranet are ensured.
Example two
Fig. 2 is a flowchart of an internal and external network interworking method based on the SIP protocol in the second embodiment of the present invention, which is applicable to a case where the SIP server sends media stream data to an internal network of the SIP client by using a target external network IP address, and the method can be executed by an internal and external network interworking device based on the SIP protocol, which can be implemented by software and/or hardware, and can be generally integrated in an electronic device, for example, in the SIP server, and used in cooperation with the SIP client. With reference to fig. 2, the method is applied to an SIP server deployed in a target extranet server, and specifically includes the following steps:
step 210, the signaling control service unit receives a first call request corresponding to the target media stream sent by the SIP client, and sends a second call request corresponding to the target media stream to the media processing service unit in the SIP server.
The SIP client is deployed in an enterprise intranet, and the first call request comprises an intranet IP address and an intranet port number of the SIP client, and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number.
In this embodiment, the SIP client is deployed in an intranet, and mainly includes a user interaction interface and a decoding unit, and the SIP server is deployed in a target extranet server, and mainly includes an application service unit, a signaling control service unit, and a media processing service unit, where the target extranet server may be an ari cloud server, a Baidu cloud server, or the like. When a user carries out on-demand operation on a user interaction interface provided by the SIP client, the decoding unit generates a first call request corresponding to the target media stream and sends the first call request to the signaling control service unit of the SIP server. The signaling control service unit sends a second call request corresponding to the target media stream to the media processing service unit to establish a media connection between the coding unit and the media processing service unit, wherein the request does not carry an SDP message body.
The intranet IP address of the SIP client included in the first call request can be an IP address allocated by the client in an enterprise intranet and can be used only in an enterprise, and an intranet port is a port used when the intranet is accessed; the external network IP address of the SIP client can be a public address applied by an enterprise to the Internet and used for the client in the enterprise to access the Internet, and the external network port is a port used when accessing the Internet.
Optionally, before the receiving, by the signaling control service unit, the first call request corresponding to the target media stream sent by the SIP client, the method may further include: the method for creating the listening point in the SIP protocol stack in the source code file of the SIP server is modified into the method for binding the target IP address forcibly.
In the prior art, the flow of creating a listening point by an SIP protocol stack in an SIP server is as follows: and transmitting the monitoring IP address and port by a createListeningPoint method of the SipStack, further calling a createMessageprocessor method to transmit the monitoring IP address and port, and creating a message processor to realize the monitoring of the transmitted IP address. However, in this way, since an incoming IP address is either an intranet IP address or an extranet IP address, only one of the intranet IP and the extranet IP can be monitored, the intranet and the extranet cannot be monitored simultaneously, and the SIP client and the SIP server cannot interact with each other.
In this embodiment, in order to guarantee monitoring of the access to the internal and external networks without being restricted by the IP access of the internal and external networks, the JAIN SIP API source code file in the SIP server may be modified in advance, and the internal flow of the createliseningpoint method in the SIP protocol stack is modified to be bound by 0.0.0.0. Wherein, the address 0.0.0.0 represents all the IP addresses in the local computer, including the internal network IP address and the external network IP address. Compiling the modified JAIN SIP API source code file, compiling and replacing a JAR file related to the modified JAIN SIP API source code file, realizing that the SIP server monitors 0.0.0.0 address, the target server normally starts processes such as application service, signaling service, media processing service and the like, completing SIP initialization, ensuring monitoring internal and external network access, and the SIP client and the SIP server can also interact with each other.
Step 220, the signaling control service unit receives a second response message corresponding to the second call request returned by the media processing service unit and sends the second response message to the encoding unit.
Wherein, the second response message sent by the signaling control service unit to the coding unit includes: and the media processing service unit receives the target external network IP address used by the target media stream sent by the coding unit.
In this embodiment, after sending the second call request corresponding to the target media stream to the media processing service unit, the signaling control service unit receives a 200OK response message corresponding to the second call request, where the response message carries an SDP body that describes contents of an IP, a port, a media format, and the like of the media stream received by the media processing service unit.
Optionally, the signaling control service unit, receiving a second response message corresponding to the second call request and returned by the media processing service unit, and sending the second response message to the encoding unit, may include: the signaling control service unit receives a second response message which is returned by the media processing service unit and corresponds to the second call request; and modifying the target intranet IP address in the second response message into a corresponding target extranet IP address, and sending the target intranet IP address to the coding unit.
In this embodiment, since the IP address in the response message returned by the media processing service unit is the target intranet IP address, and the coding unit cannot identify the target intranet IP address, in order to ensure that the intranet and intranet audio/video streams are pushed, the signaling control service unit converts the field value of the Connection field carrying the SDP information in the response message from the target intranet IP address to the target extranet IP address, and then forwards the response message to the coding unit.
Step 230, the signaling control service unit receives a first response message corresponding to the first call request returned by the media processing service unit and sends the first response message to the SIP client.
The first response message sent by the signaling control service unit to the SIP client includes: the media processing service unit sends the target external network IP address used by the target media stream to the SIP client.
In this embodiment, after the coding unit establishes the media connection with the media processing service unit, the signaling control service unit sends a call request corresponding to the target media stream to the media processing service unit, where the call request carries an SDP body in the first call request. And then receiving a 200OK response message which is returned by the media processing service unit and carries an SDP message body, wherein the message body describes the contents of IP address, port, media format and the like of the target media stream sent by the media processing service unit.
Optionally, the signaling control service unit receives a first response message corresponding to the first call request and sent by the media processing service unit to the SIP client, and may include: the signaling control service unit receives a first response message which is returned by the media processing service unit and corresponds to the first call request; and modifying the target intranet IP address in the first response message into a corresponding target extranet IP address, and sending the target intranet IP address to the SIP client.
In this embodiment, since the IP address in the response message returned by the media processing service unit is the target intranet IP address, and the SIP client cannot identify the target intranet IP address, in order to ensure that the intranet and intranet audio and video streams are pushed, the signaling control service unit converts the field value of the Connection field carrying the SDP information in the response message from the target intranet IP address to the target extranet IP address, and then forwards the response message to the decoding unit of the SIP client for interaction.
Step 240, the media processing service unit sends the target media stream to the external network IP address and the external network port in the first call request, so as to send the target media stream to the internal network IP address and the internal network port in the first call request through the external network IP address and the external network port.
In this embodiment, after the connection between the decoding unit and the media processing service unit is established, the target media stream is transmitted to the client through the media processing service unit. Because the SIP server can only access the extranet of the enterprise, the media processing service unit sends the target media stream to the extranet IP address and the extranet port in the first call request through the target extranet IP address, so that the target media stream is sent to the intranet IP address and the intranet port corresponding to the extranet IP address through the extranet IP address and the extranet port of the client enterprise, and is displayed to the on-demand user, and the on-demand task of the user is completed.
In this embodiment, the internal flow of the createliseningpoint method in the SIP protocol stack is modified to be bound to 0.0.0.0, so that the SIP server can monitor both the intranet IP address and the extranet IP address, and the SIP client interacts with the SIP server. And then, the internal and external network IP addresses are converted in the message interaction process, including the mutual conversion between the target external network IP address and the target internal network IP address and the mutual conversion between the enterprise external network IP address and the enterprise internal network IP address, so that the internal and external network intercommunication based on the SIP protocol is realized.
The technical scheme of the embodiment of the invention comprises that an SIP server deployed in a target external network server receives a first call request corresponding to a target media stream sent by an SIP client through a signaling control service unit and sends a second call request corresponding to the target media stream to a media processing service unit in the SIP server; the SIP client is deployed in an enterprise intranet, and the first call request comprises an intranet IP address and an intranet port number of the SIP client and a matched extranet IP address and an extranet port number; receiving a second response message corresponding to the second call request returned by the media processing service unit and sending the second response message to the encoding unit; the second response message includes: the media processing service unit receives a target external network IP address used by the target media stream sent by the coding unit; sending a first response message corresponding to the first call request returned by the media processing service unit to the SIP client; the first response message includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client; the target media stream is sent to the outer network IP address and the outer network port in the first call request through the media processing service unit, and the target media stream is sent to the inner network IP address and the inner network port in the first call request through the outer network IP address and the outer network port, so that the problem that information intercommunication cannot be carried out between inner and outer network equipment in the prior art is solved, and the inner and outer network intercommunication is realized by converting the inner and outer network IP addresses in the information interaction process.
Specifically, by converting the target intranet IP in the response message fed back by the media processing service unit for the second call request into the target extranet IP, the IP address used by the media processing service unit to receive the target media stream can be determined even if the encoding unit cannot identify the target intranet IP address. By converting the target intranet IP in the response message fed back by the media processing service unit for the first call request into the corresponding target extranet IP, the IP address used by the media processing service unit of the SIP server for sending the target media stream can be determined even if the client cannot identify the target intranet IP address. The target media stream is received by the extranet IP and the port in the first call request and then sent to the intranet IP and the port, so that the target media stream can be pushed to the intranet IP address and the port even if the SIP server only can access the extranet, the intercommunication of the intranet and the extranet based on the SIP protocol is realized, the access limitation of the intranet and the extranet is avoided, and the message transmission and the media stream pushing between the intranet and the extranet are ensured.
EXAMPLE III
Fig. 3 is a signaling interaction diagram of an internal and external network interworking method based on the SIP protocol in the third embodiment of the present invention, which may be combined with various alternatives in the foregoing embodiments to provide a complete signaling interaction process between the SIP client and the SIP server. Specifically, the implementation of the inter-network and inter-network interworking may include two stages, one of which is a preparation stage for performing source code modification on the SIP client and the SIP server, respectively, so as to provide a basis for signaling interaction between the SIP client and the SIP server, and facilitate the implementation of the inter-network and inter-network interworking. And the second step, the interaction stage is used for realizing the intercommunication between the SIP client and the SIP server.
In the preparation stage, 1) modifying a media library source code file on the client side, adding an NAT (network Address translation) penetrating function, compiling and replacing a DLL (dynamic link library) file related to the modified media library source code file, wherein the IP address and the port of an intranet are reserved in an SDP (service description protocol) message body carried by a call request sent by an SIP (session initiation protocol) client, the IP address and the port of the extranet are also reserved in an SDP message body, and the transmission of the extranet and the extranet is ensured. 2) And the SIP server modifies JAIN SIP API source codes and compiles and replaces related dependent JAR files to finish monitoring 0.0.0.0 address by the SIP server, normally starts processes such as application service, signaling service, media processing service and the like, finishes SIP initialization and ensures monitoring internal and external network access.
For the interaction stage, referring to fig. 3, a left dashed-line frame portion in fig. 3 is an SIP client deployed in an intranet, and mainly includes a user interaction interface and a decoding unit. The application service unit, the signaling control service unit and the media processing service unit are all deployed on the SIP server, the SIP server is deployed on the target extranet server, and the coding unit is external equipment registered on the SIP server. Wherein, 1, 11, 12, 13, 14, 15, after receiving the call request of the decoding unit, the signaling control service unit establishes the media stream signaling process between the decoding unit and the media processing service unit in a B2BUA manner, 2 to 9, establish the media stream signaling process between the encoding unit and the media processing service unit through the signaling control service unit, 24 to 27, disconnect the media stream signaling process between the decoding unit and the media processing service unit, and 28 to 32, disconnect the media stream signaling process between the media processing service unit and the encoding unit through the signaling control service unit.
Referring to fig. 3, the specific signaling interaction process is as follows:
in response to a pull operation on a target media stream, a decoding unit of a SIP client sends an INVITE request (i.e., a first call request) to a signaling control service unit of a SIP server.
The INVITE request contains a destination address, carries an SDP body, and has a one-way media receiving attribute (revonly), a Subject field carried in a message header field indicates an initial initiator of a session, and a field value of an s field in the SDP body is 'Play', which represents real-time on-demand. In the embodiment of the invention, in order to realize message intercommunication between the intranet and the extranet, the Via header field of the SDP message body comprises the intranet IP address and the port information of the SIP client, and the Contact header field and the Subject header field comprise the IP address and the port information of the extranet.
After receiving the INVITE request (i.e. the first call request), the signaling control service unit shall establish the media connection between the media processing service unit and the encoding unit of the SIP server. An INVITE request (i.e., a second call request) is sent to the media processing service, which does not carry the SDP body.
And 3, after receiving the INVITE request (namely the second call request) of the signaling control service unit, the media processing service unit replies a 200OK response carrying an SDP message body, wherein the SDP message body describes the contents of a target intranet IP address, a port, a media format and the like used by the media processing service unit for receiving the target media stream sent by the coding unit, and the media has a bidirectional media transceiving attribute (sendrecv) which contains a rtpid attribute.
After receiving the 200OK response message (i.e. the second response message) returned by the media processing service unit, the signaling control service unit performs intranet-extranet IP conversion on the 200OK response message, generates an INVITE request, and sends the INVITE request to the encoding unit, where the request should carry a Subject field indicating the initial initiator of the session, and the request should carry the SDP body of the 200OK response replied by the media processing service unit in the message 3. Wherein, the field value of the s field should be "Play" to represent real-time on-demand, and the media attribute may not contain rtpid attribute.
In the embodiment of the invention, after receiving the 200OK response returned by the media processing service unit, the signaling control service unit changes the Connection field carrying the SDP information in the response from the target intranet IP to the target extranet IP, and then forwards the target extranet IP to the coding unit for interaction. Therefore, even if the encoding unit cannot identify the target intranet IP address, the media processing service unit can determine the IP address used for receiving the target media stream.
And 5, after the coding unit receives the INVITE request of the signaling control service unit, the coding unit returns a 180Ringing response. Wherein, the 180Ringing response message may or may not be returned.
And 6, after receiving the 180Ringing response of the coding unit, the signaling control service unit returns the 180Ringing response to the decoding unit.
And 7, after receiving the INVITE request of the signaling control service unit, the coding unit replies a 200OK response and carries an SDP message body which describes the contents of IP (Internet protocol), ports, media formats and the like of the media stream sent by the coding unit, and the media has a one-way media sending attribute (sendonly).
8, after receiving the 200OK response returned by the coding unit, the signaling control service unit sends an ACK request to the media service unit, wherein the request carries the SDP message body in the 200OK response replied by the coding unit in the message 7, and the process of establishing the INVITE session with the media service unit is completed.
And 9, after receiving the 200OK response returned by the coding unit, the signaling control service unit sends an ACK request to the coding unit, wherein the request does not carry a message body, and the process of establishing the INVITE session with the coding unit is completed.
And 10, after the coding unit establishes media connection with the media processing service unit, the signaling control service unit sends a device state notification (the device is in a session and has media connection) to the application service unit.
11, after the coding unit establishes media connection with the media processing service unit, the media processing service unit will receive the target media stream sent by the coding unit, and the signaling control service unit sends an INVITE request to the media processing service unit, where the INVITE request carries the SDP body in the message 1.
12, after receiving the INVITE request, the media processing service unit replies a 200OK response, and carries an SDP message body, where the message body describes the content of the media stream sent by the media processing service unit, such as IP, port, and media format, and the media has a one-way media sending attribute (sendonly), and the media attribute should include rtpid attribute.
After receiving the 200OK response (i.e. the first response message) replied by the media service unit, the signaling control service unit forwards the message 12 to the decoding unit 13. In the embodiment of the invention, after the signaling control service unit receives the 200OK response returned by the media processing service unit, considering that the IP address in the response message returned by the media processing service unit is the target intranet IP address, and the SIP client cannot identify the target intranet IP address, therefore, in order to ensure the push of the internal and external network audio and video streams, the signaling control service unit changes the Connection field carrying the SDP information in the response from the target intranet IP to the target external network IP, and then forwards the Connection field to the decoding unit of the SIP client for interaction.
And 14, the decoding unit sends an ACK request (not carrying an SDP message body) to the signaling control service unit to complete the establishment process of the INVITE session with the signaling control service unit.
The signalling control service unit forwards the message 14 to the media processing service unit and completes the INVITE session establishment procedure with the media processing service unit 15.
And 16, after the decoding unit establishes media connection with the media processing service unit, the signaling control service unit sends the state of the decoding equipment (the equipment is in a session and has media connection) to the application service unit.
And 17, the signaling control service unit sends an exchange command (media forwarding) to the media processing service unit to realize video on demand viewing.
And 18, after receiving the media forwarding command, the media processing service unit processes the forwarding command, and sends an operation response to the signaling control service unit according to the processing result.
And 19, the two parties successfully establish the one-way target media stream forwarded by the media processing service unit, namely the media processing service unit sends the target media stream to a decoding unit of the SIP client through the enterprise external network IP address and the external network port so as to send the target media stream to the enterprise internal network IP address and the internal network port through the enterprise external network IP address and the external network port for on-demand display. And, the media processing service unit sends a channel state notification that the media transmission has been established to the signaling control service unit.
And 20, the decoding unit sends an UPDATE request to the signaling control service unit to UPDATE the session duration.
And 21, after receiving the UPDATE request, the signaling control service unit needs to UPDATE the session duration and reply a 200OK response.
The encoding unit sends an UPDATE request to the signaling control service unit to UPDATE the session duration 22.
23, after receiving the UPDATE request, the signaling control service unit shall UPDATE the session duration and reply 200OK response.
And 24, the user finishes the on-demand, the decoding unit sends a BYE message to the signaling control service unit, and the INVITE session established by the messages 1, 13 and 14 and the decoding unit is disconnected.
25, the signaling control service unit replies a 200OK response after receiving the BYE message, and the session is disconnected.
The signalling control service sends a BYE message to the media processing service disconnecting the INVITE session established with the media processing service in messages 11, 12, 15 26.
27, the media processing service unit replies 200OK response after receiving the BYE message, and the session is disconnected.
And 28, after the decoding unit and the media processing service unit are disconnected from the media, the signaling control service unit sends a device state notice (device on-line) to the application service unit.
And 29, the signaling control service unit sends a BYE message to the media processing service unit, and disconnects the INVITE session established by the media processing service unit 2, 3 and 8.
30, the media processing service unit replies 200OK response after receiving the BYE message, and the session is disconnected.
The media processing service unit sends a channel status notification of media transmission termination to the signaling control service unit 31.
And 32, the signaling control service unit sends a BYE message to the coding unit and disconnects the INVITE session established by the messages 4, 7 and 9 and the coding unit.
And 33, after receiving the BYE message, the coding unit replies a 200OK response and disconnects the session.
34, after the coding unit and the media processing service unit disconnect the media connection, the signaling control service unit sends a device state notice (device on-line) to the application service unit.
Example four
Fig. 4 is a schematic structural diagram of an internal and external network interworking apparatus based on the SIP protocol in the fourth embodiment of the present invention. The embodiment can be applied to the condition that the SIP client side obtains the media stream from the external network of the SIP server by using the IP address of the enterprise internal network. The apparatus may be implemented in software and/or hardware, and may generally be integrated in an electronic device, such as a SIP client, for use with a SIP server. As shown in fig. 4, the internal and external network interworking apparatus based on the SIP protocol is applied to a SIP client deployed in an intranet, and includes:
a first call request sending module 410, configured to send a first call request to a signaling control service unit of the SIP server in response to a pull operation on a target media stream;
the SIP server is deployed in a target external network server, and the first call request comprises an internal network IP address and an internal network port number of the SIP client, and an external network IP address and an external network port number which are matched with the internal network IP address and the internal network port number;
a first response receiving module 420, configured to receive a first response message corresponding to the first call request, where the first response message is forwarded by the signaling control service unit; the first response message includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client;
the media stream receiving module 430 is configured to receive, through the external network IP address and the external network port in the first call request, a target media stream sent by the media processing service unit through the target external network IP address, and send the target media stream to the internal network IP address and the internal network port in the first call request.
According to the technical scheme of the embodiment of the invention, the SIP client deployed in an enterprise intranet responds to the pulling operation of a target media stream and sends a first call request to a signaling control service unit of an SIP server; the SIP server is deployed in a target external network server, and the first call request comprises an internal network IP address and an internal network port number of the SIP client, and an external network IP address and an external network port number which are matched with the internal network IP address and the internal network port number; receiving a first response message corresponding to the first call request forwarded by the signaling control service unit; the first response message includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client; through the outer network IP address and the outer network port in the first call request, the target media stream sent by the media processing service unit through the target outer network IP address is received, and the target media stream is sent to the inner network IP address and the inner network port in the first call request.
Specifically, by converting the target intranet IP in the response message fed back by the media processing service unit for the first call request into the corresponding target extranet IP, the IP address used by the media processing service unit of the SIP server to transmit the target media stream can be determined even if the client cannot recognize the target intranet IP address. The target media stream is received by the extranet IP and the port in the first call request and then sent to the intranet IP and the port, so that the target media stream can be pushed to the intranet IP address and the port even if the SIP server only can access the extranet, intercommunication of the intranet and the extranet based on the SIP protocol is realized, and message transmission and media stream pushing between the intranet and the extranet are ensured.
Optionally, the method further includes:
and the source code modification module is used for adding a Network Address Translation (NAT) function in a media library source code file of the SIP client before responding to the pulling operation of the target media stream and sending a first call request to a signaling control service unit of the SIP server.
Optionally, the first call request sending module 410 is configured to:
responding to the pulling operation of the target media stream, and generating a call request corresponding to the target media stream;
writing an intranet IP address and an intranet port number of the SIP client, and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number in the call request;
and sending the call request as a first call request to a signaling control service unit.
The internal and external network intercommunication device based on the SIP protocol provided by the embodiment of the invention can execute the internal and external network intercommunication method based on the SIP protocol provided by any embodiment of the invention and applied to the SIP client deployed in the enterprise intranet, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an intranet and extranet interworking apparatus based on the SIP protocol in the fifth embodiment of the present invention, which is applicable to a case where the SIP server sends media stream data to the intranet of the SIP client by using the IP address of the target extranet. The apparatus may be implemented in software and/or hardware and may generally be integrated in an electronic device, such as a SIP server, for use with a SIP client. As shown in fig. 5, the apparatus is applied to a SIP server deployed in a target extranet server, and includes:
a first call request receiving module 510, configured to receive, through a signaling control service unit, a first call request corresponding to a target media stream sent by an SIP client, and send a second call request corresponding to the target media stream to a media processing service unit in an SIP server;
the SIP client is deployed in an enterprise intranet, and the first call request comprises an intranet IP address and an intranet port number of the SIP client and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number;
a second response receiving module 520, configured to receive, by the signaling control service unit, a second response message corresponding to the second call request and returned by the media processing service unit, and send the second response message to the coding unit, where the second response message sent by the signaling control service unit to the coding unit includes: the media processing service unit receives a target external network IP address used by the target media stream sent by the coding unit;
a first response sending module 530, configured to receive, through the signaling control service unit, a first response message corresponding to the first call request and returned by the media processing service unit, and send the first response message to the SIP client; the first response message sent by the signaling control service unit to the SIP client includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client;
the media stream sending module 540 is configured to send the target media stream to the external network IP address and the external network port in the first call request through the media processing service unit, so as to send the target media stream to the internal network IP address and the internal network port in the first call request through the external network IP address and the external network port.
According to the technical scheme of the embodiment of the invention, an SIP server deployed in a target external network server receives a first call request corresponding to a target media stream sent by an SIP client through a signaling control service unit and sends a second call request corresponding to the target media stream to a media processing service unit in the SIP server; the SIP client is deployed in an enterprise intranet, and the first call request comprises an intranet IP address and an intranet port number of the SIP client and a matched extranet IP address and an extranet port number; receiving a second response message corresponding to the second call request returned by the media processing service unit and sending the second response message to the encoding unit; the second response message includes: the media processing service unit receives a target external network IP address used by the target media stream sent by the coding unit; sending a first response message corresponding to the first call request returned by the media processing service unit to the SIP client; the first response message includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client; the target media stream is sent to the outer network IP address and the outer network port in the first call request through the media processing service unit, and the target media stream is sent to the inner network IP address and the inner network port in the first call request through the outer network IP address and the outer network port, so that the problem that information intercommunication cannot be carried out between inner and outer network equipment in the prior art is solved, and the inner and outer network intercommunication is realized by converting the inner and outer network IP addresses in the information interaction process.
Specifically, by converting the target intranet IP in the response message fed back by the media processing service unit for the second call request into the target extranet IP, the IP address used by the media processing service unit to receive the target media stream can be determined even if the encoding unit cannot identify the target intranet IP address. By converting the target intranet IP in the response message fed back by the media processing service unit for the first call request into the corresponding target extranet IP, the IP address used by the media processing service unit of the SIP server for sending the target media stream can be determined even if the client cannot identify the target intranet IP address. The target media stream is received by the extranet IP and the port in the first call request and then sent to the intranet IP and the port, so that the target media stream can be pushed to the intranet IP address and the port even if the SIP server only can access the extranet, the intercommunication of the intranet and the extranet based on the SIP protocol is realized, the access limitation of the intranet and the extranet is avoided, and the message transmission and the media stream pushing between the intranet and the extranet are ensured.
Optionally, the method further includes:
and the modification module is used for modifying a method for creating a listening point in an SIP protocol stack in a source code file of the SIP server into a method for binding a target IP address forcibly before receiving a first call request corresponding to a target media stream, which is sent by the SIP client, through the signaling control service unit.
Optionally, the second response receiving module 520 is configured to:
receiving a second response message corresponding to the second call request, which is returned by the media processing service unit, through the signaling control service unit;
modifying the target intranet IP address in the second response message into a corresponding target extranet IP address, and sending the target intranet IP address to the coding unit; and the number of the first and second groups,
a first response sending module 530, configured to:
receiving a first response message corresponding to the first call request returned by the media processing service unit through the signaling control service unit;
and modifying the target intranet IP address in the first response message into a corresponding target extranet IP address, and sending the target intranet IP address to the SIP client.
The internal and external network intercommunication device based on the SIP protocol provided by the embodiment of the invention can execute the internal and external network intercommunication method based on the SIP protocol, which is provided by any embodiment of the invention and is applied to the SIP server deployed in the target external network server, and has corresponding functional modules and beneficial effects of the execution method.
EXAMPLE six
Fig. 6 is a schematic structural diagram of an electronic device in a sixth embodiment of the present invention. Fig. 6 illustrates a block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention. The device 12 shown in fig. 6 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present invention.
As shown in FIG. 6, device 12 is in the form of a general purpose computing device. The components of device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, and commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with the other modules of the device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing an internal and external network interworking method based on the SIP protocol provided by the embodiment of the present invention.
Namely: an internal and external network intercommunication method based on SIP protocol is applied to a session initiation protocol SIP client deployed in an enterprise intranet, and comprises the following steps:
responding to the pulling operation of the target media stream, and sending a first call request to a signaling control service unit of the SIP server;
the SIP server is deployed in a target external network server, and the first call request comprises an internal network IP address and an internal network port number of the SIP client, and an external network IP address and an external network port number which are matched with the internal network IP address and the internal network port number;
receiving a first response message corresponding to the first call request forwarded by the signaling control service unit; the first response message includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client;
and receiving a target media stream sent by the media processing service unit through the target external network IP address through the external network IP address and the external network port in the first call request, and sending the target media stream to the internal network IP address and the internal network port in the first call request.
Or, the method for realizing intercommunication between internal and external networks based on SIP protocol is applied to the SIP server deployed in the target external network server, and comprises the following steps:
the signaling control service unit receives a first call request which is sent by the SIP client and corresponds to the target media stream, and sends a second call request which corresponds to the target media stream to the media processing service unit in the SIP server;
the SIP client is deployed in an enterprise intranet, and the first call request comprises an intranet IP address and an intranet port number of the SIP client and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number;
the signaling control service unit receives a second response message corresponding to the second call request returned by the media processing service unit and sends the second response message to the coding unit, and the second response message sent by the signaling control service unit to the coding unit includes: the media processing service unit receives a target external network IP address used by the target media stream sent by the coding unit;
the signaling control service unit receives a first response message corresponding to the first call request returned by the media processing service unit and sends the first response message to the SIP client; the first response message sent by the signaling control service unit to the SIP client includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client;
and the media processing service unit is used for sending the target media stream to the external network IP address and the external network port in the first call request so as to send the target media stream to the internal network IP address and the internal network port in the first call request through the external network IP address and the external network port.
EXAMPLE seven
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is used to execute an internal and external network interworking method based on an SIP protocol when being executed by a computer processor.
Namely: an internal and external network intercommunication method based on SIP protocol is applied to a session initiation protocol SIP client deployed in an enterprise intranet, and comprises the following steps:
responding to the pulling operation of the target media stream, and sending a first call request to a signaling control service unit of the SIP server;
the SIP server is deployed in a target external network server, and the first call request comprises an internal network IP address and an internal network port number of the SIP client, and an external network IP address and an external network port number which are matched with the internal network IP address and the internal network port number;
receiving a first response message corresponding to the first call request forwarded by the signaling control service unit; the first response message includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client;
and receiving a target media stream sent by the media processing service unit through the target external network IP address through the external network IP address and the external network port in the first call request, and sending the target media stream to the internal network IP address and the internal network port in the first call request.
Or, the method for realizing intercommunication between internal and external networks based on SIP protocol is applied to the SIP server deployed in the target external network server, and comprises the following steps:
the signaling control service unit receives a first call request which is sent by the SIP client and corresponds to the target media stream, and sends a second call request which corresponds to the target media stream to the media processing service unit in the SIP server;
the SIP client is deployed in an enterprise intranet, and the first call request comprises an intranet IP address and an intranet port number of the SIP client and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number;
the signaling control service unit receives a second response message corresponding to the second call request returned by the media processing service unit and sends the second response message to the coding unit, and the second response message sent by the signaling control service unit to the coding unit includes: the media processing service unit receives a target external network IP address used by the target media stream sent by the coding unit;
the signaling control service unit receives a first response message corresponding to the first call request returned by the media processing service unit and sends the first response message to the SIP client; the first response message sent by the signaling control service unit to the SIP client includes: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client;
and the media processing service unit is used for sending the target media stream to the external network IP address and the external network port in the first call request so as to send the target media stream to the internal network IP address and the internal network port in the first call request through the external network IP address and the external network port.
Of course, the computer readable storage medium provided in the embodiments of the present invention may execute the computer instructions, which are not limited to the above method operations, and may also execute the related operations in the internal and external network interworking method based on the SIP protocol provided in any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods of the embodiments of the present invention.
It should be noted that, in the embodiment of the internal and external network interworking apparatus based on the SIP protocol, each included unit and module are only divided according to functional logic, but are not limited to the above division, as long as the corresponding function can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. An intercommunication method for internal and external networks based on SIP protocol is characterized in that the method is applied to a session initiation protocol SIP client deployed in an intranet and comprises the following steps:
responding to the pulling operation of the target media stream, and sending a first call request to a signaling control service unit of the SIP server;
the SIP server is deployed in a target extranet server, and the first call request comprises an intranet IP address and an intranet port number of the SIP client, and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number;
receiving a first response message corresponding to the first call request forwarded by the signaling control service unit; the first response message comprises: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client;
and receiving a target media stream sent by the media processing service unit through the target external network IP address through the external network IP address and the external network port in the first call request, and sending the target media stream to the internal network IP address and the internal network port in the first call request.
2. The method of claim 1, prior to sending the first call request to a signaling control service element of the SIP server in response to the pull operation on the target media stream, further comprising:
and adding a Network Address Translation (NAT) function in the media library source code file of the SIP client.
3. The method of claim 1, wherein sending the first call request to a signaling control service element of the SIP server in response to the pull operation on the target media stream comprises:
responding to a pulling operation of a target media stream, and generating a call request corresponding to the target media stream;
writing an intranet IP address and an intranet port number of the SIP client, and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number in the call request;
and sending the call request as a first call request to the signaling control service unit.
4. An intercommunication method for internal and external networks based on SIP protocol is characterized in that the method is applied to an SIP server deployed in a target external network server and comprises the following steps:
the signaling control service unit receives a first call request which is sent by an SIP client and corresponds to a target media stream, and sends a second call request which corresponds to the target media stream to a media processing service unit in the SIP server;
the SIP client is deployed in an enterprise intranet, and the first call request comprises an intranet IP address and an intranet port number of the SIP client and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number;
the signaling control service unit receives a second response message corresponding to the second call request returned by the media processing service unit and sends the second response message to the encoding unit, and the second response message sent by the signaling control service unit to the encoding unit includes: the media processing service unit receives a target external network IP address used by the target media stream sent by the coding unit;
the signaling control service unit receives a first response message corresponding to the first call request returned by the media processing service unit and sends the first response message to the SIP client; the first response message sent by the signaling control service unit to the SIP client includes: the media processing service unit sends a target external network IP address used by a target media stream to the SIP client;
and the media processing service unit sends the target media stream to the external network IP address and the external network port in the first call request, so that the target media stream is sent to the internal network IP address and the internal network port in the first call request through the external network IP address and the external network port.
5. The method of claim 4, before receiving, by the signaling control service unit, the first call request corresponding to the target media stream sent by the SIP client, further comprising:
and modifying the method for creating the listening point in the SIP protocol stack in the source code file of the SIP server into a mandatory binding target IP address.
6. The method of claim 4, wherein the signaling control service unit receives a second response message corresponding to the second call request returned by the media processing service unit and sends the second response message to the coding unit, and comprises:
the signaling control service unit receives a second response message corresponding to the second call request, which is returned by the media processing service unit;
modifying the target intranet IP address in the second response message into a corresponding target extranet IP address, and sending the target intranet IP address to a coding unit; and the number of the first and second groups,
the signaling control service unit receives a first response message corresponding to the first call request returned by the media processing service unit and sends the first response message to the SIP client, and the signaling control service unit includes:
the signaling control service unit receives a first response message corresponding to the first call request, which is returned by the media processing service unit;
and modifying the target intranet IP address in the first response message into a corresponding target extranet IP address, and sending the target intranet IP address to the SIP client.
7. The utility model provides an intranet and extranet intercommunication device based on SIP protocol which characterized in that, is applied to the SIP client who deploys at intranet, includes:
a first call request sending module, configured to send a first call request to a signaling control service unit of an SIP server in response to a pull operation on a target media stream;
the SIP server is deployed in a target extranet server, and the first call request comprises an intranet IP address and an intranet port number of the SIP client, and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number;
a first response receiving module, configured to receive a first response message corresponding to the first call request and forwarded by the signaling control service unit; the first response message comprises: the media processing service unit sends a target external network IP address used by the target media stream to the SIP client;
and the media stream receiving module is used for receiving a target media stream sent by the media processing service unit through the target external network IP address through the external network IP address and the external network port in the first call request, and sending the target media stream to the internal network IP address and the internal network port in the first call request.
8. An internal and external network intercommunication device based on SIP protocol, which is applied to the SIP server deployed in the target external network server, comprising:
a first call request receiving module, configured to receive, through a signaling control service unit, a first call request corresponding to a target media stream sent by an SIP client, and send, to a media processing service unit in the SIP server, a second call request corresponding to the target media stream;
the SIP client is deployed in an enterprise intranet, and the first call request comprises an intranet IP address and an intranet port number of the SIP client and an extranet IP address and an extranet port number which are matched with the intranet IP address and the intranet port number;
a second response receiving module, configured to receive, by the signaling control service unit, a second response message corresponding to the second call request and returned by the media processing service unit, and send the second response message to the encoding unit, where the second response message sent by the signaling control service unit to the encoding unit includes: the media processing service unit receives a target external network IP address used by the target media stream sent by the coding unit;
a first response sending module, configured to receive, by the signaling control service unit, a first response message corresponding to the first call request and returned by the media processing service unit, and send the first response message to the SIP client; the first response message sent by the signaling control service unit to the SIP client includes: the media processing service unit sends a target external network IP address used by a target media stream to the SIP client;
and the media stream sending module is used for sending the target media stream to the external network IP address and the external network port in the first call request through the media processing service unit so as to send the target media stream to the internal network IP address and the internal network port in the first call request through the external network IP address and the external network port.
9. An electronic device, characterized in that the device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the SIP protocol-based extranet interworking method according to any one of claims 1 to 3, or the SIP protocol-based extranet interworking method according to any one of claims 4 to 6.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the SIP protocol-based intranet and extranet interworking method according to any one of claims 1 to 3, or implements the SIP protocol-based intranet and extranet interworking method according to any one of claims 4 to 6.
CN202110750044.6A 2021-07-02 2021-07-02 Internal and external network intercommunication method, device, equipment and storage medium based on SIP protocol Pending CN113489717A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110750044.6A CN113489717A (en) 2021-07-02 2021-07-02 Internal and external network intercommunication method, device, equipment and storage medium based on SIP protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110750044.6A CN113489717A (en) 2021-07-02 2021-07-02 Internal and external network intercommunication method, device, equipment and storage medium based on SIP protocol

Publications (1)

Publication Number Publication Date
CN113489717A true CN113489717A (en) 2021-10-08

Family

ID=77939632

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110750044.6A Pending CN113489717A (en) 2021-07-02 2021-07-02 Internal and external network intercommunication method, device, equipment and storage medium based on SIP protocol

Country Status (1)

Country Link
CN (1) CN113489717A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114553414A (en) * 2022-03-03 2022-05-27 合肥浩瀚深度信息技术有限公司 Intranet penetration method and system based on HTTPS service
CN117615023A (en) * 2024-01-24 2024-02-27 浙江大华技术股份有限公司 Transmission method crossing network boundary, electronic device and computer readable storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040160985A1 (en) * 2003-02-14 2004-08-19 Sung-Woon Kang System and method for network address translation and session management
US20050033985A1 (en) * 2003-07-26 2005-02-10 Innomedia Pte Ltd. Firewall penetration system and method for real time media communications
US20070217407A1 (en) * 2003-12-24 2007-09-20 Huawei Technologies Co., Ltd. Method and System for Implementing Traversal Through Network Address Translation
US20090313376A1 (en) * 2006-06-02 2009-12-17 Mats Cedervall Method and apparatuses for establishing a session between a client terminal and a media supply system to transport a unicast media stream over an ip network
CN108234511A (en) * 2018-01-18 2018-06-29 携程旅游信息技术(上海)有限公司 Method, system, equipment, storage medium and the gateway of multi-medium data transmission
CN108989488A (en) * 2018-09-06 2018-12-11 腾讯科技(深圳)有限公司 Traversing method, device and the storage medium of network address translation apparatus
CN110971873A (en) * 2019-11-20 2020-04-07 武汉虹信技术服务有限责任公司 Real-time monitoring method, monitoring system and storage medium
CN111787026A (en) * 2020-07-27 2020-10-16 北京飞讯数码科技有限公司 Method, device and equipment for transmitting media data and storage medium
WO2021026509A1 (en) * 2019-08-08 2021-02-11 Intel Corporation Link performance prediction and media streaming technologies
CN112788348A (en) * 2020-12-30 2021-05-11 北京飞讯数码科技有限公司 On-demand method, device, equipment, system and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040160985A1 (en) * 2003-02-14 2004-08-19 Sung-Woon Kang System and method for network address translation and session management
US20050033985A1 (en) * 2003-07-26 2005-02-10 Innomedia Pte Ltd. Firewall penetration system and method for real time media communications
US20070217407A1 (en) * 2003-12-24 2007-09-20 Huawei Technologies Co., Ltd. Method and System for Implementing Traversal Through Network Address Translation
US20090313376A1 (en) * 2006-06-02 2009-12-17 Mats Cedervall Method and apparatuses for establishing a session between a client terminal and a media supply system to transport a unicast media stream over an ip network
CN108234511A (en) * 2018-01-18 2018-06-29 携程旅游信息技术(上海)有限公司 Method, system, equipment, storage medium and the gateway of multi-medium data transmission
CN108989488A (en) * 2018-09-06 2018-12-11 腾讯科技(深圳)有限公司 Traversing method, device and the storage medium of network address translation apparatus
WO2021026509A1 (en) * 2019-08-08 2021-02-11 Intel Corporation Link performance prediction and media streaming technologies
CN110971873A (en) * 2019-11-20 2020-04-07 武汉虹信技术服务有限责任公司 Real-time monitoring method, monitoring system and storage medium
CN111787026A (en) * 2020-07-27 2020-10-16 北京飞讯数码科技有限公司 Method, device and equipment for transmitting media data and storage medium
CN112788348A (en) * 2020-12-30 2021-05-11 北京飞讯数码科技有限公司 On-demand method, device, equipment, system and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
桂海源: "《IP电话技术与软交换》", vol. 2, 北京邮电大学出版社, pages: 281 - 283 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114553414A (en) * 2022-03-03 2022-05-27 合肥浩瀚深度信息技术有限公司 Intranet penetration method and system based on HTTPS service
CN114553414B (en) * 2022-03-03 2024-04-05 合肥浩瀚深度信息技术有限公司 Intranet penetration method and system based on HTTPS service
CN117615023A (en) * 2024-01-24 2024-02-27 浙江大华技术股份有限公司 Transmission method crossing network boundary, electronic device and computer readable storage medium
CN117615023B (en) * 2024-01-24 2024-04-12 浙江大华技术股份有限公司 Transmission method crossing network boundary, electronic device and computer readable storage medium

Similar Documents

Publication Publication Date Title
AU2008202684B2 (en) Session initiation protocol adaptor
US7505574B2 (en) Method and system for providing an improved communications channel for telephone conference initiation and management
CN102025718B (en) SIP endpoint enhancer
US20200259875A1 (en) Snap-in invocation for call reconstruction
WO2002003217A1 (en) System, method, and computer program product for resolving addressing in a network including a network address translator
MXPA05011167A (en) Mixed massaging mode for multiple points of presence.
CN110933180A (en) Communication establishing method and device, load equipment and storage medium
CN113489717A (en) Internal and external network intercommunication method, device, equipment and storage medium based on SIP protocol
JP4934148B2 (en) SIP multi-user media client with user agent shared by multiple user applications
US10601880B2 (en) Conference reconstruction in SIP networks
EP1895741B1 (en) Providing communications including an extended protocol header
JP2006067579A (en) System and method of collecting and distributing participant identifying data
RU2665303C2 (en) Multimedia subsystem on basis of internet protocol (ims) and method and device for configuring service in ims
US20090049087A1 (en) Methods, systems, and computer program products for providing a universal uniform resource identifier (UURI)
CN108234511B (en) Method, system, equipment, storage medium and gateway for multimedia data transmission
CN109040009B (en) IP tolerance and signaling interworking
US20170288904A1 (en) System and method for enabling use of a single user identifier across incompatible networks for ucc functionality
CN111371913B (en) Method for acquiring media IP MAC address and intelligent terminal
JP2009272668A (en) GATEWAY APPARATUS, VoIP NETWORK MUTUAL CONNECTION SYSTEM, COMMUNICATION METHOD, AND PROGRAM
CN113301060B (en) Data transmission method, device, server and storage medium
CN102546644B (en) Method, equipment and system for implementing SIP (Session Initiation Protocol) calling
US7720974B2 (en) Global routable and grid identification for audio provider in media session
JP6183881B2 (en) Codec conversion gateway, codec conversion method, and codec conversion program
WO2009023569A2 (en) Methods, systems, and computer program products for providing a universal uniform resource identifier (uuri)
Femminella et al. Introduction of Media Gateway Control functions in Java Call Control

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination