Module: sip-router
Branch: master
Commit: bbcb7da488b7844ab7c64e800895c60cab0dc601
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bbcb7da…
Author: Richard Good <richard.good(a)smilecoms.com>
Committer: Richard Good <richard.good(a)smilecoms.com>
Date: Fri Mar 7 11:07:11 2014 +0200
lib/ims/ims_getters: Changed cscf_get_called_party_id to cscf_get_public_identity_from_called_party_id
Changed function to get identity from called part id header instead of full header
Fixes clients that attach extra info (e.g. phone-context)
Changed references to this method in ims_charging and ims_registrar_pcscf
---
lib/ims/ims_getters.c | 20 ++++++++++++++++++--
lib/ims/ims_getters.h | 4 ++--
modules/ims_charging/ims_ro.c | 2 +-
modules/ims_charging/mod.c | 2 +-
modules/ims_registrar_pcscf/service_routes.c | 2 +-
5 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/lib/ims/ims_getters.c b/lib/ims/ims_getters.c
index aa37c7d..eb266e8 100644
--- a/lib/ims/ims_getters.c
+++ b/lib/ims/ims_getters.c
@@ -1494,15 +1494,19 @@ int cscf_get_cseq(struct sip_msg *msg,struct hdr_field **hr)
static str s_called_party_id={"P-Called-Party-ID",17};
/**
- * Looks for the P-Called-Party-ID header and extracts its content.
+ * Looks for the P-Called-Party-ID header and extracts the public identity from it
* @param msg - the sip message
* @param hr - ptr to return the found hdr_field
* @returns the P-Called_Party-ID
*/
-str cscf_get_called_party_id(struct sip_msg *msg,struct hdr_field **hr)
+str cscf_get_public_identity_from_called_party_id(struct sip_msg *msg,struct hdr_field **hr)
{
str id={0,0};
struct hdr_field *h;
+ int after_semi_colon=0;
+ int len=0;
+ int i=0;
+
if (hr) *hr=0;
if (!msg) return id;
if (parse_headers(msg, HDR_EOH_F, 0)<0) {
@@ -1522,6 +1526,18 @@ str cscf_get_called_party_id(struct sip_msg *msg,struct hdr_field **hr)
while(id.len && (id.s[id.len-1]==' ' || id.s[id.len-1]=='\t' || id.s[id.len-1]=='>')){
id.len--;
}
+ //get only text in front of ';' there might not even be a semi-colon
+ //this caters for extra information after the public identity - e.g. phone-context
+ len= id.len;
+ for(i=0; i<len;i++) {
+ if(id.s[i]==';'){
+ //found semi-colon
+ after_semi_colon = 1;
+ }
+ if(after_semi_colon){
+ id.len--;
+ }
+ }
if (hr) *hr = h;
return id;
}
diff --git a/lib/ims/ims_getters.h b/lib/ims/ims_getters.h
index 2217ddc..aeeb591 100644
--- a/lib/ims/ims_getters.h
+++ b/lib/ims/ims_getters.h
@@ -420,12 +420,12 @@ int cscf_add_header_rpl(struct sip_msg *msg, str *hdr);
int cscf_get_cseq(struct sip_msg *msg,struct hdr_field **hr);
/**
- * Looks for the P-Called-Party-ID header and extracts its content.
+ * Looks for the P-Called-Party-ID header and extracts the public identity from it
* @param msg - the sip message
* @param hr - ptr to return the found hdr_field
* @returns the P-Called_Party-ID
*/
-str cscf_get_called_party_id(struct sip_msg *msg,struct hdr_field **hr);
+str cscf_get_public_identity_from_called_party_id(struct sip_msg *msg,struct hdr_field **hr);
#endif
diff --git a/modules/ims_charging/ims_ro.c b/modules/ims_charging/ims_ro.c
index ae13389..f71dc98 100644
--- a/modules/ims_charging/ims_ro.c
+++ b/modules/ims_charging/ims_ro.c
@@ -954,7 +954,7 @@ int Ro_Send_CCR(struct sip_msg *msg, struct dlg_cell *dlg, int dir, str* charge_
//getting called asserted identity
- if ((called_asserted_identity = cscf_get_called_party_id(msg, &h)).len == 0) {
+ if ((called_asserted_identity = cscf_get_public_identity_from_called_party_id(msg, &h)).len == 0) {
LM_DBG("No P-Called-Identity hdr found. Using request URI for called_asserted_identity");
called_asserted_identity = cscf_get_public_identity_from_requri(msg);
free_called_asserted_identity = 1;
diff --git a/modules/ims_charging/mod.c b/modules/ims_charging/mod.c
index 4fb423f..bbc2708 100644
--- a/modules/ims_charging/mod.c
+++ b/modules/ims_charging/mod.c
@@ -362,7 +362,7 @@ static int w_ro_ccr(struct sip_msg *msg, str* route_name, str* direction, str* c
} else if (dir == RO_TERM_DIRECTION){
//get callee IMPU from called part id - if not present then skip this
- if ((identity = cscf_get_called_party_id(msg, &h)).len == 0) {
+ if ((identity = cscf_get_public_identity_from_called_party_id(msg, &h)).len == 0) {
LM_WARN("No P-Called-Identity hdr found - will not get callbacks if this IMPU is removed to terminate call");
goto send_ccr;
}
diff --git a/modules/ims_registrar_pcscf/service_routes.c b/modules/ims_registrar_pcscf/service_routes.c
index 6360aab..cafed54 100644
--- a/modules/ims_registrar_pcscf/service_routes.c
+++ b/modules/ims_registrar_pcscf/service_routes.c
@@ -481,7 +481,7 @@ int assert_called_identity(struct sip_msg* _m, udomain_t* _d) {
goto error;
}
- called_party_id = cscf_get_called_party_id(req, &h);
+ called_party_id = cscf_get_public_identity_from_called_party_id(req, &h);
if (!called_party_id.len){
Module: sip-router
Branch: master
Commit: 02edf111af9d13e5bed1de768ca9f206a3537483
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=02edf11…
Author: Richard Good <richard.good(a)smilecoms.com>
Committer: Richard Good <richard.good(a)smilecoms.com>
Date: Fri Mar 7 11:08:51 2014 +0200
modules/ims_registrar_scscf: updated documentation
---
.../doc/ims_registrar_scscf_admin.xml | 78 +++++++++++++++++++-
1 files changed, 77 insertions(+), 1 deletions(-)
diff --git a/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml b/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml
index 00b9b5c..26de7fc 100644
--- a/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml
+++ b/modules/ims_registrar_scscf/doc/ims_registrar_scscf_admin.xml
@@ -686,7 +686,83 @@ if (can_subscribe_to_reg("location")){
</programlisting>
</example>
</section>
- </section>
+
+ <section>
+ <title><function
+ moreinfo="none">can_publish_reg(domain)</function></title>
+
+ <para>This function checks to see that a PUBLISH request is authorised
+ to publish for a particular identity. Only 3 entities can
+ publish:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>The user agent to it's own state</emphasis></para>
+ </listitem>
+
+ <listitem>
+ <para>The P-CSCF specified in the path header for that user</para>
+ </listitem>
+
+ <listitem>
+ <para>Application Server (AS) not yet implemented</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Meaning of the parameters is as follows:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>domain - Logical domain within
+ registrar.</emphasis></para>
+ </listitem>
+ </itemizedlist>
+
+ <para>This function can be used in REQUEST_ROUTE</para>
+
+ <example>
+ <title><function>can_publish_reg</function> usage</title>
+
+ <programlisting format="linespecific">...
+if (can_publish_reg("location")){
+ $var(ret)= publish_reg("location");
+}
+...
+</programlisting>
+ </example>
+ </section>
+
+ <section>
+ <title><function
+ moreinfo="none">publish_reg(domain)</function></title>
+
+ <para>Save the publish to the REG event for the UAC or the
+ appropriate P-CSCF (in the path to the UAC).</para>
+
+ <para>Meaning of the parameters is as follows:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>domain - Logical domain within
+ registrar.</emphasis></para>
+ </listitem>
+ </itemizedlist>
+
+ <para>This function can be used in REQUEST_ROUTE</para>
+
+ <example>
+ <title><function>publish_reg</function> usage</title>
+
+ <programlisting format="linespecific">...
+if (can_publish_reg("location")){
+ $var(ret)= publish_reg("location");
+}
+...
+</programlisting>
+ </example>
+ </section>
+
+ </section>
<section>
<title>RPC Commands</title>
Hello,
Kamailio SIP Server v4.1.2 stable release is out.
This is a maintenance release of the latest stable branch, 4.1, that
includes fixes since release of v4.1.1. There is no change to database
schema or configuration language structure that you have to do on
installations of v4.1.x. Deployments running previous v4.x.x versions
are strongly recommended to be upgraded to v4.1.2.
For more details about version 4.1.2 (including links and guidelines to
download the tarball or from GIT repository), visit:
* http://www.kamailio.org/w/2014/03/kamailio-v4-1-2-released/
RPM, Debian/Ubuntu packages will be available soon as well.
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Hello,
Kamailio SIP Server v4.0.6 stable release is out.
This is a maintenance release of the stable branch 4.0, that includes
fixes since release of v4.0.5. There is no change to database schema or
configuration language structure that you have to do on installations of
v4.0.x. Deployments running previous v4.0.x versions are strongly
recommended to be upgraded to v4.0.6.
For more details about version 4.0.6 (including links and guidelines to
download the tarball or from GIT repository), visit:
* http://www.kamailio.org/w/2014/03/kamailio-v4-0-6-released/
Note that 4.0.x is previous stable release series, the latest one is now
4.1.x, with v4.1.2 released today as well.
In addition, 3.3.7 was packaged in order to have it included in the new
APT repository and make transition to newer versions easier for those
still on branch 3.3.
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda