diff --git a/tinyDEMO/common.c b/tinyDEMO/common.c index 92e19c72..2e33c6d7 100755 --- a/tinyDEMO/common.c +++ b/tinyDEMO/common.c @@ -153,6 +153,9 @@ static tsk_object_t* ctx_ctor(tsk_object_t * self, va_list * app) /* stack */ ctx->stack = tsip_stack_create(stack_callback, DEFAULT_REALM, DEFAULT_IMPI, DEFAULT_IMPU, /* Mandatory parameters */ TSIP_STACK_SET_LOCAL_IP(DEFAULT_LOCAL_IP), /* local IP */ + TSIP_STACK_SET_SECAGREE_IPSEC_2("TCP", tsk_true), + TSIP_STACK_SET_IMS_AKA_OPERATOR_ID("22b3156098e11e177e93711d6cb0e688"), + TSIP_STACK_SET_IMS_AKA_AMF(0x8000), TSIP_STACK_SET_NULL() /* Mandatory */); /* SIP Sessions */ diff --git a/tinySIP/src/dialogs/tsip_dialog_register.c b/tinySIP/src/dialogs/tsip_dialog_register.c index 7a20cad7..d2c46dbc 100755 --- a/tinySIP/src/dialogs/tsip_dialog_register.c +++ b/tinySIP/src/dialogs/tsip_dialog_register.c @@ -348,7 +348,7 @@ int tsip_dialog_register_send_REGISTER(tsip_dialog_register_t *self, tsk_bool_t 1) if GRUU is supported, the option-tag "gruu"; and 2) if multiple registrations is supported, the option-tag "outbound". */ - TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_SUPPORTED_VA_ARGS("path")); + TSIP_MESSAGE_ADD_HEADER(request, TSIP_HEADER_SUPPORTED_VA_ARGS("path,sec-agree")); //if(1==2/* gruu*/){ //} //else if(2 == 3 /* multiple registrations */){ diff --git a/tinySIP/src/transports/tsip_transport_ipsec.c b/tinySIP/src/transports/tsip_transport_ipsec.c index 2afb2b04..73028831 100755 --- a/tinySIP/src/transports/tsip_transport_ipsec.c +++ b/tinySIP/src/transports/tsip_transport_ipsec.c @@ -257,6 +257,11 @@ int tsip_transport_ipsec_updateMSG(tsip_transport_ipsec_t* self, tsip_message_t if (!asso || !asso->ctx) { TSK_DEBUG_ERROR("No IPSec association found."); ret = -2; + if (TSIP_REQUEST_IS_REGISTER(msg)) { + TSIP_MESSAGE_ADD_HEADER(msg, TSIP_HEADER_REQUIRE_VA_ARGS("sec-agree")); + TSIP_MESSAGE_ADD_HEADER(msg, TSIP_HEADER_PROXY_REQUIRE_VA_ARGS("sec-agree")); + ret = 0; + } goto bail; } diff --git a/tinySIP/src/tsip.c b/tinySIP/src/tsip.c index 3e1a9c64..a8f470da 100755 --- a/tinySIP/src/tsip.c +++ b/tinySIP/src/tsip.c @@ -689,6 +689,9 @@ int tsip_stack_start(tsip_stack_handle_t *self) } } + TSK_DEBUG_INFO("secagree_mech=%s\n", stack->security.secagree_mech); + stack->security.enable_secagree_ipsec = tsk_true; + TSK_DEBUG_INFO("enable_secagree_ipsec=%d\n", stack->security.enable_secagree_ipsec); /* === Transport type === */ if(!tsk_strnullORempty(stack->security.secagree_mech)) { if(tsk_striequals(stack->security.secagree_mech, "ipsec-3gpp") && stack->security.enable_secagree_ipsec) {