Module: sip-router
Branch: master
Commit: 885a468af97b4de25256d3c193a61890f616c128
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=885a468…
Author: Richard Good <richard.good(a)smilecoms.com>
Committer: Richard Good <richard.good(a)smilecoms.com>
Date: Thu Oct 9 14:22:23 2014 +0200
modules/ims_charging: updated ims_charging documentation for new trunk parameter
---
modules/ims_charging/doc/ims_charging_admin.xml | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/modules/ims_charging/doc/ims_charging_admin.xml b/modules/ims_charging/doc/ims_charging_admin.xml
index a77f03d..4bdf9b4 100644
--- a/modules/ims_charging/doc/ims_charging_admin.xml
+++ b/modules/ims_charging/doc/ims_charging_admin.xml
@@ -737,7 +737,7 @@ modparam("ims_charging", "service_context_id_release", "262")
<section>
<title><function moreinfo="none">Ro_CCR(route_name, direction,
- charge_type, unit_type, reservation_units, domain</function></title>
+ charge_type, unit_type, reservation_units, domain, trunk_id</function></title>
<para>Perform a CCR on Diameter Ro interface for Charging</para>
@@ -745,17 +745,17 @@ modparam("ims_charging", "service_context_id_release", "262")
<itemizedlist>
<listitem>
- <para><emphasis>route_name</emphasis>route to be executed upon
+ <para><emphasis>route_name</emphasis> route to be executed upon
reception of charging requests</para>
</listitem>
<listitem>
- <para><emphasis>direction</emphasis>"orig"inating or
+ <para><emphasis>direction</emphasis> "orig"inating or
"term"inating</para>
</listitem>
<listitem>
- <para><emphasis>charge_type</emphasis>"IEC" = Immediate Event
+ <para><emphasis>charge_type</emphasis> "IEC" = Immediate Event
Charging, "ECUR" - Event Charging with Unit Reservation or "SCUR" -
Session Charging with Unit Reservation.</para>
@@ -763,21 +763,26 @@ modparam("ims_charging", "service_context_id_release", "262")
</listitem>
<listitem>
- <para><emphasis>unit_type</emphasis>Types of the unit to be
+ <para><emphasis>unit_type</emphasis> Types of the unit to be
requested</para>
<emphasis>(unused at the moment)</emphasis>
</listitem>
<listitem>
- <para><emphasis>reservation_units</emphasis>how many units (at the
+ <para><emphasis>reservation_units</emphasis> how many units (at the
moment seconds) should be reservated at the moment.</para>
</listitem>
<listitem>
- <para><emphasis>domain</emphasis>- Logical domain within
+ <para><emphasis>domain</emphasis> Logical domain within
registrar.</para>
</listitem>
+
+ <listitem>
+ <para><emphasis>trunk_id</emphasis> Identifies to trunk group from
+ which this originates or terminates.</para>
+ </listitem>
</itemizedlist>
<para>This function can be used from REQUEST_ROUTE.</para>
@@ -791,7 +796,7 @@ modparam("ims_charging", "service_context_id_release", "262")
<programlisting format="linespecific">
...
xlog("L_DBG","Sending initial CCR Request for call\n");
- Ro_CCR("CHARGING_CCR_REPLY", "orig", "SCUR", "", "30");
+ Ro_CCR("CHARGING_CCR_REPLY", "orig", "SCUR", "", "30","1");
}
route[CHARGING_CCR_REPLY]
@@ -914,4 +919,4 @@ route[CHARGING_CCR_REPLY]
<para>Number of calls that were killed due to lack of credit.</para>
</section>
</section>
-</chapter>
+</chapter>
\ No newline at end of file
Module: sip-router
Branch: master
Commit: 35fe10d9a88d3c3f9a42d1ec891f7f62a2fc26a9
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=35fe10d…
Author: Richard Good <richard.good(a)smilecoms.com>
Committer: Richard Good <richard.good(a)smilecoms.com>
Date: Thu Oct 9 11:59:59 2014 +0200
modules/ims_qos: Rx_reg use received IP for framed_ip_address AVP
Previous reg_reg used contact IP for framed_ip_address AVP but NAT breaks this
Using received IP instead works for NAT and non-NAT scenarios
---
modules/ims_qos/mod.c | 30 +++++++++++++-----------------
1 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/modules/ims_qos/mod.c b/modules/ims_qos/mod.c
index 3dc9496..a3923e6 100644
--- a/modules/ims_qos/mod.c
+++ b/modules/ims_qos/mod.c
@@ -374,7 +374,7 @@ void callback_dialog(struct dlg_cell* dlg, int type, struct dlg_cb_params * para
//getting auth session
auth = cdpb.AAAGetAuthSession(*rx_session_id);
if (!auth) {
- LM_DBG("Could not get Auth Session for session id: [%.*s] - this is fine as this might have been started by already sending an STR\n", rx_session_id->len, rx_session_id->s);
+ LM_DBG("Could not get Auth Session for session id: [%.*s]\n", rx_session_id->len, rx_session_id->s);
goto error;
}
@@ -414,7 +414,7 @@ void callback_dialog(struct dlg_cell* dlg, int type, struct dlg_cb_params * para
//getting auth session
auth = cdpb.AAAGetAuthSession(*rx_session_id);
if (!auth) {
- LM_DBG("Could not get Auth Session for session id: [%.*s] - this is fine as this might have been started by already sending an STR\n", rx_session_id->len, rx_session_id->s);
+ LM_DBG("Could not get Auth Session for session id: [%.*s]\n", rx_session_id->len, rx_session_id->s);
goto error;
}
@@ -848,6 +848,7 @@ static int w_rx_aar_register(struct sip_msg *msg, char* route, char* str1, char*
int aar_sent = 0;
saved_transaction_local_t* local_data = 0; //data to be shared across all async calls
saved_transaction_t* saved_t_data = 0; //data specific to each contact's AAR async call
+ str ip;
if (fixup_get_svalue(msg, (gparam_t*) route, &route_name) != 0) {
LM_ERR("no async route block for assign_server_unreg\n");
@@ -977,25 +978,20 @@ static int w_rx_aar_register(struct sip_msg *msg, char* route, char* str1, char*
LM_DBG("Contact [%.*s] exists and is in state PCONTACT_REG_PENDING or PCONTACT_REGISTERED\n"
, pcontact->aor.len, pcontact->aor.s);
- //get IP address from contact
- struct sip_uri puri;
- if (parse_uri(c->uri.s, c->uri.len, &puri) < 0) {
- LM_ERR("failed to parse Contact\n");
- ul.unlock_udomain(domain_t, &c->uri);
- lock_release(saved_t_data->lock);
- goto error;
-
- }
- LM_DBG("Parsed URI of from host is [%.*s]\n", puri.host.len, puri.host.s);
- uint16_t ip_version = AF_INET; //TODO IPv6!!!?
+ //we use the received IP address for the framed_ip_address
+ ip.s = ip_addr2a(&msg->rcv.src_ip);
+ ip.len = strlen(ip_addr2a(&msg->rcv.src_ip));
+ LM_DBG("Message received IP address is: [%.*s]\n", ip.len, ip.s);
+ uint16_t ip_version = AF_INET; //TODO IPv6!!!?
+
//check for existing Rx session
if (pcontact->rx_session_id.len > 0
&& pcontact->rx_session_id.s
&& (auth = cdpb.AAAGetAuthSession(pcontact->rx_session_id))) {
LM_DBG("Rx session already exists for this user\n");
if (memcmp(pcontact->rx_session_id.s, auth->id.s, auth->id.len) != 0) {
- LM_ERR("Rx session mismatch when URI is [%.*s].......Aborting\n", puri.host.len, puri.host.s);
+ LM_ERR("Rx session mismatch for rx_session_id [%.*s].......Aborting\n", pcontact->rx_session_id.len, pcontact->rx_session_id.s);
if (auth) cdpb.AAASessionsUnlock(auth->hash);
lock_release(saved_t_data->lock);
goto error;
@@ -1007,7 +1003,7 @@ static int w_rx_aar_register(struct sip_msg *msg, char* route, char* str1, char*
LM_DBG("Creating new Rx session for contact <%.*s>\n", pcontact->aor.len, pcontact->aor.s);
int ret = create_new_regsessiondata(domain_t->name, &pcontact->aor, &rx_regsession_data_p);
if (!ret) {
- LM_ERR("Unable to create regsession data parcel when URI is [%.*s]...Aborting\n", puri.host.len, puri.host.s);
+ LM_ERR("Unable to create regsession data parcel for rx_session_id [%.*s]...Aborting\n", pcontact->rx_session_id.len, pcontact->rx_session_id.s);
ul.unlock_udomain(domain_t, &c->uri);
if (rx_regsession_data_p) {
shm_free(rx_regsession_data_p);
@@ -1018,7 +1014,7 @@ static int w_rx_aar_register(struct sip_msg *msg, char* route, char* str1, char*
}
auth = cdpb.AAACreateClientAuthSession(1, callback_for_cdp_session, rx_regsession_data_p); //returns with a lock
if (!auth) {
- LM_ERR("Rx: unable to create new Rx Reg Session when URI is [%.*s]\n", puri.host.len, puri.host.s);
+ LM_ERR("Rx: unable to create new Rx Reg Session for rx_session_id is [%.*s]\n", pcontact->rx_session_id.len, pcontact->rx_session_id.s);
if (rx_regsession_data_p) {
shm_free(rx_regsession_data_p);
rx_regsession_data_p = 0;
@@ -1068,7 +1064,7 @@ static int w_rx_aar_register(struct sip_msg *msg, char* route, char* str1, char*
//TODOD remove - no longer user AOR parm
//ret = rx_send_aar_register(msg, auth, &puri.host, &ip_version, &c->uri, local_data); //returns a locked rx auth object
- ret = rx_send_aar_register(msg, auth, &puri.host, &ip_version, local_data); //returns a locked rx auth object
+ ret = rx_send_aar_register(msg, auth, &ip, &ip_version, local_data); //returns a locked rx auth object
ul.unlock_udomain(domain_t, &c->uri);
Module: sip-router
Branch: master
Commit: 2e821613a2fac7b3a6b7ec28a314b462f18f5bc2
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=2e82161…
Author: Richard Good <richard.good(a)smilecoms.com>
Committer: Richard Good <richard.good(a)smilecoms.com>
Date: Thu Oct 9 11:57:56 2014 +0200
modules/ims_qos: Added feature to Rx_reg check if session has been opened before acting on termination
When Rx signalling session is terminated only remove user from user loc if rx signalling session was successfully opened
---
modules/ims_qos/cdpeventprocessor.c | 37 ++++++++++++++++++----------------
modules/ims_qos/rx_aar.c | 27 ++++++++++++++++++++++--
modules/ims_qos/rx_authdata.c | 2 +
modules/ims_qos/rx_authdata.h | 1 +
4 files changed, 47 insertions(+), 20 deletions(-)
diff --git a/modules/ims_qos/cdpeventprocessor.c b/modules/ims_qos/cdpeventprocessor.c
index 409009e..1cf322e 100644
--- a/modules/ims_qos/cdpeventprocessor.c
+++ b/modules/ims_qos/cdpeventprocessor.c
@@ -230,23 +230,26 @@ void cdp_cb_event_process() {
LM_DBG("This is a subscription to signalling bearer session");
//instead of removing the contact from usrloc_pcscf we just change the state of the contact to TERMINATE_PENDING_NOTIFY
//pcscf_registrar sees this, sends a SIP PUBLISH and on SIP NOTIFY the contact is deleted
-
- if (ul.register_udomain(p_session_data->domain.s, &domain)
- < 0) {
- LM_DBG("Unable to register usrloc domain....aborting\n");
- return;
- }
- ul.lock_udomain(domain, &p_session_data->registration_aor);
- if (ul.get_pcontact(domain, &p_session_data->registration_aor,
- &pcontact) != 0) {
- LM_DBG("no contact found for terminated Rx reg session..... ignoring\n");
- } else {
- LM_DBG("Updating contact [%.*s] after Rx reg session terminated, setting state to PCONTACT_DEREG_PENDING_PUBLISH\n", pcontact->aor.len, pcontact->aor.s);
- ci.reg_state = PCONTACT_DEREG_PENDING_PUBLISH;
- ci.num_service_routes = 0;
- ul.update_pcontact(domain, &ci, pcontact);
- }
- ul.unlock_udomain(domain, &p_session_data->registration_aor);
+ //note we only send SIP PUBLISH if the session has been successfully opened
+
+ if(p_session_data->session_has_been_opened) {
+ if (ul.register_udomain(p_session_data->domain.s, &domain)
+ < 0) {
+ LM_DBG("Unable to register usrloc domain....aborting\n");
+ return;
+ }
+ ul.lock_udomain(domain, &p_session_data->registration_aor);
+ if (ul.get_pcontact(domain, &p_session_data->registration_aor,
+ &pcontact) != 0) {
+ LM_DBG("no contact found for terminated Rx reg session..... ignoring\n");
+ } else {
+ LM_DBG("Updating contact [%.*s] after Rx reg session terminated, setting state to PCONTACT_DEREG_PENDING_PUBLISH\n", pcontact->aor.len, pcontact->aor.s);
+ ci.reg_state = PCONTACT_DEREG_PENDING_PUBLISH;
+ ci.num_service_routes = 0;
+ ul.update_pcontact(domain, &ci, pcontact);
+ }
+ ul.unlock_udomain(domain, &p_session_data->registration_aor);
+ }
} else {
LM_DBG("This is a media bearer session session");
diff --git a/modules/ims_qos/rx_aar.c b/modules/ims_qos/rx_aar.c
index 028d6cd..c3482fc 100644
--- a/modules/ims_qos/rx_aar.c
+++ b/modules/ims_qos/rx_aar.c
@@ -94,7 +94,7 @@ void async_aar_callback(int is_timeout, void *param, AAAMessage *aaa, long elaps
struct cell *t = 0;
unsigned int cdp_result;
int result = CSCF_RETURN_ERROR;
-
+
LM_DBG("Received AAR callback\n");
saved_transaction_t* data = (saved_transaction_t*) param;
@@ -135,9 +135,9 @@ void async_aar_callback(int is_timeout, void *param, AAAMessage *aaa, long elaps
if (cdp_result >= 2000 && cdp_result < 3000) {
LM_DBG("Success, received code: [%i] from PCRF for AAR request\n", cdp_result);
-
- LM_DBG("Auth session ID [%.*s]", aaa->sessionId->data.len, aaa->sessionId->data.s);
+ LM_DBG("Auth session ID [%.*s]", aaa->sessionId->data.len, aaa->sessionId->data.s);
+
if(!data->aar_update) {
LM_DBG("This is an AAA response to an initial AAR");
str * passed_rx_session_id = shm_malloc(sizeof (struct _str));
@@ -181,6 +181,8 @@ void async_aar_reg_callback(int is_timeout, void *param, AAAMessage *aaa, long e
struct pcontact_info ci;
udomain_t* domain_t;
int finalReply = 0;
+ AAASession *auth = 0;
+ rx_authsessiondata_t* p_session_data = 0;
int result = CSCF_RETURN_ERROR;
LM_DBG("Received AAR callback\n");
@@ -245,6 +247,25 @@ void async_aar_reg_callback(int is_timeout, void *param, AAAMessage *aaa, long e
create_return_code(result);
goto done;
}
+ //need to set Rx auth data to say this session has been successfully opened
+ //This is used elsewhere to prevent acting on termination events when the session has not been opened
+ //getting auth session
+ auth = cdpb.AAAGetAuthSession(aaa->sessionId->data);
+ if (!auth) {
+ LM_DBG("Could not get Auth Session for session id: [%.*s]\n", aaa->sessionId->data.len, aaa->sessionId->data.s);
+ goto error;
+ }
+ //getting session data
+ p_session_data = (rx_authsessiondata_t*) auth->u.auth.generic_data;
+ if (!p_session_data) {
+ LM_DBG("Could not get session data on Auth Session for session id: [%.*s]\n", aaa->sessionId->data.len, aaa->sessionId->data.s);
+ if (auth) cdpb.AAASessionsUnlock(auth->hash);
+ goto error;
+ }
+ p_session_data->session_has_been_opened = 1;
+ if (auth) cdpb.AAASessionsUnlock(auth->hash);
+
+
LM_DBG("Success, received code: [%i] from PCRF for AAR request (contact: [%.*s]), (auth session id: %.*s)\n",
cdp_result, local_data->contact.len, local_data->contact.s,
local_data->auth_session_id.len, local_data->auth_session_id.s);
diff --git a/modules/ims_qos/rx_authdata.c b/modules/ims_qos/rx_authdata.c
index 1de9b40..86e8fca 100644
--- a/modules/ims_qos/rx_authdata.c
+++ b/modules/ims_qos/rx_authdata.c
@@ -81,6 +81,8 @@ int create_new_regsessiondata(str* domain, str* aor, rx_authsessiondata_t** sess
p_session_data->subscribed_to_signaling_path_status = 1;
p_session_data->must_terminate_dialog = 0; /*irrelevent for reg session data this will always be 0 */
+ p_session_data->session_has_been_opened = 0; /*0 has not been opened 1 has been opened*/
+
char* p = (char*)(p_session_data + 1);
p_session_data->domain.s = p;
memcpy(p, domain->s, domain->len);
diff --git a/modules/ims_qos/rx_authdata.h b/modules/ims_qos/rx_authdata.h
index 3332997..2264664 100644
--- a/modules/ims_qos/rx_authdata.h
+++ b/modules/ims_qos/rx_authdata.h
@@ -84,6 +84,7 @@ typedef struct rx_authsessiondata {
int ip_version;
//for registration session
int subscribed_to_signaling_path_status; // 0 not subscribed 1 is subscribed
+ int session_has_been_opened; // 0 has not been opened 1 has been opened
str domain; //the domain the registration aor belongs to (for registration)
str registration_aor; //the aor if this rx session is a subscription to signalling status
int must_terminate_dialog; //0 means when this session terminates it must not terminate the relevant dialog, 1 means it must terminate the dialog
Module: sip-router
Branch: master
Commit: d2b06ddb70ee8edfd0456fb0697167560d608f44
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=d2b06dd…
Author: Richard Good <richard.good(a)smilecoms.com>
Committer: Richard Good <richard.good(a)smilecoms.com>
Date: Thu Oct 9 11:52:15 2014 +0200
modules/ims_registrar_scscf: fixed asserted identity comparison to path to not include "sip:"
---
modules/ims_registrar_scscf/registrar_notify.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/ims_registrar_scscf/registrar_notify.c b/modules/ims_registrar_scscf/registrar_notify.c
index 8e80bcf..09e83ef 100644
--- a/modules/ims_registrar_scscf/registrar_notify.c
+++ b/modules/ims_registrar_scscf/registrar_notify.c
@@ -371,9 +371,9 @@ int can_subscribe_to_reg(struct sip_msg *msg, char *_t, char *str2) {
while (c) {
if (c->path.len) {
- for (i = 0; i < c->path.len - asserted_id.len; i++)
- LM_DBG("Path: <%.*s>.\n",
+ LM_DBG("Path: <%.*s>.\n",
c->path.len, c->path.s);
+ for (i = 0; i < c->path.len - (asserted_id.len-4); i++)
//we compare the asserted_id without "sip:" to the path
if (strncasecmp(c->path.s + i, asserted_id.s+4, asserted_id.len-4) == 0) {
LM_DBG("Identity found in Path <%.*s>\n",