-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from lunasaw/dev_1.1.5
release 1.1.5
- Loading branch information
Showing
112 changed files
with
1,601 additions
and
526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
...java/io/github/lunasaw/gbproxy/client/transmit/request/ack/AckRequestProcessorClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
package io.github.lunasaw.gbproxy.client.transmit.request.ack; | ||
|
||
import io.github.lunasaw.sip.common.service.SipUserGenerate; | ||
|
||
/** | ||
* @author luna | ||
* @date 2023/11/7 | ||
*/ | ||
public interface AckRequestProcessorClient extends SipUserGenerate { | ||
|
||
public interface AckRequestProcessorClient { | ||
|
||
} |
39 changes: 20 additions & 19 deletions
39
...java/io/github/lunasaw/gbproxy/client/transmit/request/ack/ClientAckRequestProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,60 @@ | ||
package io.github.lunasaw.gbproxy.client.transmit.request.ack; | ||
|
||
import javax.annotation.Resource; | ||
import javax.sip.Dialog; | ||
import javax.sip.DialogState; | ||
import javax.sip.RequestEvent; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
import gov.nist.javax.sip.message.SIPRequest; | ||
import io.github.lunasaw.gbproxy.client.user.SipUserGenerateClient; | ||
import io.github.lunasaw.sip.common.entity.FromDevice; | ||
import io.github.lunasaw.sip.common.transmit.event.SipSubscribe; | ||
import io.github.lunasaw.sip.common.transmit.event.request.SipRequestProcessorAbstract; | ||
import io.github.lunasaw.sip.common.utils.SipUtils; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Component; | ||
|
||
import javax.annotation.Resource; | ||
import javax.sip.Dialog; | ||
import javax.sip.DialogState; | ||
import javax.sip.RequestEvent; | ||
|
||
/** | ||
* SIP命令类型: ACK请求 | ||
* | ||
* @author weidian | ||
*/ | ||
@Component | ||
@Getter | ||
@Setter | ||
@Slf4j | ||
public class ClientAckRequestProcessor extends SipRequestProcessorAbstract { | ||
|
||
private final String METHOD = "ACK"; | ||
private final String METHOD = "ACK"; | ||
|
||
private String method = METHOD; | ||
private String method = METHOD; | ||
|
||
@Resource | ||
private AckRequestProcessorClient ackRequestProcessorClient; | ||
|
||
@Resource | ||
private SipUserGenerateClient sipUserGenerate; | ||
|
||
/** | ||
* 处理 ACK请求 | ||
* 处理 ACK请求 | ||
* | ||
* @param evt | ||
*/ | ||
@Override | ||
public void process(RequestEvent evt) { | ||
SIPRequest request = (SIPRequest) evt.getRequest(); | ||
|
||
// 在客户端看来 收到请求的时候fromHeader还是服务端的 toHeader才是自己的,这里是要查询自己的信息 | ||
String userId = SipUtils.getUserIdFromToHeader(request); | ||
|
||
// 获取设备 | ||
FromDevice fromDevice = (FromDevice) ackRequestProcessorClient.getFromDevice(); | ||
|
||
if (!userId.equals(fromDevice.getUserId())) { | ||
if (!sipUserGenerate.checkDevice(evt)) { | ||
return; | ||
} | ||
Dialog dialog = evt.getDialog(); | ||
if (dialog == null) return; | ||
if (dialog == null) { | ||
return; | ||
} | ||
if (dialog.getState() == DialogState.CONFIRMED) { | ||
SipSubscribe.publishAckEvent(evt); | ||
} | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
...o/github/lunasaw/gbproxy/client/transmit/request/ack/CustomAckRequestProcessorClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package io.github.lunasaw.gbproxy.client.transmit.request.ack; | ||
|
||
/** | ||
* @author luna | ||
* @date 2023/12/29 | ||
*/ | ||
public class CustomAckRequestProcessorClient implements AckRequestProcessorClient {} |
4 changes: 1 addition & 3 deletions
4
...c/main/java/io/github/lunasaw/gbproxy/client/transmit/request/bye/ByeProcessorClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
package io.github.lunasaw.gbproxy.client.transmit.request.bye; | ||
|
||
import io.github.lunasaw.sip.common.service.SipUserGenerate; | ||
|
||
/** | ||
* @author luna | ||
* @date 2023/11/14 | ||
*/ | ||
public interface ByeProcessorClient extends SipUserGenerate { | ||
public interface ByeProcessorClient { | ||
|
||
void closeStream(String callId); | ||
} |
12 changes: 12 additions & 0 deletions
12
.../java/io/github/lunasaw/gbproxy/client/transmit/request/bye/CustomByeProcessorClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.lunasaw.gbproxy.client.transmit.request.bye; | ||
|
||
/** | ||
* @author luna | ||
* @date 2023/12/29 | ||
*/ | ||
public class CustomByeProcessorClient implements ByeProcessorClient { | ||
@Override | ||
public void closeStream(String callId) { | ||
|
||
} | ||
} |
Oops, something went wrong.