Module: sip-router Branch: carstenbock/ims Commit: 2dbadcadd64c3b434d1119ed37b35d677e5feb58 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2dbadcad...
Author: Carsten Bock carsten@bock.info Committer: Carsten Bock carsten@bock.info Date: Thu Mar 10 11:50:32 2011 +0100
- Add avps to the ucontact_info structure
---
modules_k/usrloc/ucontact.c | 8 ++++++++ modules_k/usrloc/ucontact.h | 6 ++++++ 2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/modules_k/usrloc/ucontact.c b/modules_k/usrloc/ucontact.c index ec177c7..c8f9a1b 100644 --- a/modules_k/usrloc/ucontact.c +++ b/modules_k/usrloc/ucontact.c @@ -47,6 +47,7 @@ #include "urecord.h" #include "ucontact.h" #include "reg_avps_db.h" +#include "../../parser/parse_uri.h"
/*! * \brief Create a new contact structure @@ -68,11 +69,17 @@ ucontact_t* new_ucontact(str* _dom, str* _aor, str* _contact, ucontact_info_t* _ memset(c, 0, sizeof(ucontact_t));
if (shm_str_dup( &c->c, _contact) < 0) goto error; + if (parse_uri(c->c.s, c->c.len, &c->parsed_c) < 0) + LM_ERR("Error while parsing Contact URI\n"); + if (shm_str_dup( &c->callid, _ci->callid) < 0) goto error; if (shm_str_dup( &c->user_agent, _ci->user_agent) < 0) goto error;
if (_ci->received.s && _ci->received.len) { if (shm_str_dup( &c->received, &_ci->received) < 0) goto error; + if (parse_uri(c->received.s, c->received.len, &c->parsed_received) < 0) + LM_ERR("Error while parsing Contact URI\n"); + } if (_ci->path && _ci->path->len) { if (shm_str_dup( &c->path, _ci->path) < 0) goto error; @@ -89,6 +96,7 @@ ucontact_t* new_ucontact(str* _dom, str* _aor, str* _contact, ucontact_info_t* _ c->cflags = _ci->cflags; c->methods = _ci->methods; c->last_modified = _ci->last_modified; + c->avps = _ci->avps;
return c; error: diff --git a/modules_k/usrloc/ucontact.h b/modules_k/usrloc/ucontact.h index 0269719..75f7207 100644 --- a/modules_k/usrloc/ucontact.h +++ b/modules_k/usrloc/ucontact.h @@ -41,6 +41,7 @@ #include "../../qvalue.h" #include "../../str.h" #include "../../usr_avp.h" +#include "../../parser/msg_parser.h"
/*! @@ -66,7 +67,11 @@ typedef struct ucontact { str* domain; /*!< Pointer to domain name (NULL terminated) */ str* aor; /*!< Pointer to the AOR string in record structure*/ str c; /*!< Contact address */ + struct sip_uri parsed_c; + /*!< Parsed Contact-address */ str received; /*!< IP+port+protocol we received the REGISTER from */ + struct sip_uri parsed_received; + /*!< received socket */ str path; /*!< Path header */ time_t expires; /*!< Expires parameter */ qvalue_t q; /*!< q parameter */ @@ -99,6 +104,7 @@ typedef struct ucontact_info { struct socket_info *sock; /*!< socket informations */ unsigned int methods; /*!< supported methods */ time_t last_modified; /*!< last modified */ + avp_t *avps; } ucontact_info_t;
/*! \brief ancient time used for marking the contacts forced to expired */