pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36757?usp=email )


Change subject: SIP_Emulation: Handle SIP REGISTER from peer
......................................................................

SIP_Emulation: Handle SIP REGISTER from peer

This is needed when emulating an IMS core.

Change-Id: I49dfe54434113eb8b75306a3a8ddda940fa14743
---
M library/SIP_Emulation.ttcn
1 file changed, 27 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/57/36757/1

diff --git a/library/SIP_Emulation.ttcn b/library/SIP_Emulation.ttcn
index a5ebcfb..3de7169 100644
--- a/library/SIP_Emulation.ttcn
+++ b/library/SIP_Emulation.ttcn
@@ -249,6 +249,19 @@
                var SipUrl sip_to;

                alt {
+               /* SIP REGISTER was received on SIP socket/port */
+               [] SIP.receive(tr_SIP_REGISTER) -> value sip_req {
+                       var CallidString call_id := 
sip_req.msgHeader.callId.callid;
+                       if (f_call_id_known(call_id)) {
+                               /* re-register? */
+                               vc_conn := f_comp_by_call_id(call_id);
+                       } else {
+                               /* new REGISTER: check expect */
+                               vc_conn := ops.create_cb.apply(sip_req, id);
+                               f_call_table_add(vc_conn, call_id);
+                       }
+                       CLIENT.send(sip_req) to vc_conn;
+                       }
                /* SIP INVITE was received on SIP socket/port */
                [] SIP.receive(tr_SIP_INVITE) -> value sip_req {
                        var CallidString call_id := 
sip_req.msgHeader.callId.callid;
@@ -355,8 +368,9 @@
        var SipUrl sip_to;
        var integer i;

-       if (sip_req.requestLine.method != INVITE_E) {
-               setverdict(fail, "SIP ExpectedCreateCallback needs INVITE");
+       if (sip_req.requestLine.method != INVITE_E and
+           sip_req.requestLine.method != REGISTER_E) {
+               setverdict(fail, "SIP ExpectedCreateCallback needs 
REGISTER/INVITE");
                mtc.stop
                return ret;
        }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36757?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I49dfe54434113eb8b75306a3a8ddda940fa14743
Gerrit-Change-Number: 36757
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to