pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36757?usp=email )
(
2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )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(-)
Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve
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; }