Mercurial > hg > freeDiameter
diff extensions/app_sip/registrationtermination.c @ 706:4ffbc9f1e922
Large UNTESTED commit with the following changes:
* Improved DiameterIdentity handling (esp. interationalization issues),
and improve efficiency of some string operations in peers, sessions,
and dictionary modules (closes #7)
* Cleanup in the session module to free only unreferenced sessions (#16)
* Removed fd_cpu_flush_cache(), replaced by more robust alternatives.
* Improved peer state machine algorithm to counter SCTP multistream race
condition.
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Wed, 09 Feb 2011 15:26:58 +0900 |
parents | 95a784729cac |
children | 877592751fee |
line wrap: on
line diff
--- a/extensions/app_sip/registrationtermination.c Mon Jan 31 17:22:21 2011 +0900 +++ b/extensions/app_sip/registrationtermination.c Wed Feb 09 15:26:58 2011 +0900 @@ -146,12 +146,14 @@ // Create a new session { - CHECK_FCT( fd_sess_new( &sess, fd_g_config->cnf_diamid, "app_sip", 7 )); - char * sid; - CHECK_FCT( fd_sess_getsid ( sess, &sid )); + #define APP_SIP_SID_OPT "app_sip" + CHECK_FCT( fd_sess_new( &sess, fd_g_config->cnf_diamid, fd_g_config->cnf_diamid_len, (os0_t)APP_SIP_SID_OPT, CONSTSTRLEN(APP_SIP_SID_OPT) )); + os0_t sid; + size_t sidlen; + CHECK_FCT( fd_sess_getsid ( sess, &sid, &sidlen )); CHECK_FCT( fd_msg_avp_new ( sip_dict.Session_Id, 0, &avp )); - value.os.data = (uint8_t *)sid; - value.os.len = strlen(sid); + value.os.data = sid; + value.os.len = sidlen; CHECK_FCT( fd_msg_avp_setvalue( avp, &value )); CHECK_FCT( fd_msg_avp_add( message, MSG_BRW_FIRST_CHILD, avp )); }