<p>I just notice that cxdx_avp.[c|h] are (almost) duplicated</p>

<pre><code>--- modules/ims_auth/cxdx_avp.h 2016-06-06 09:21:19.924637959 +0200
+++ modules/ims_registrar_scscf/cxdx_avp.h  2016-04-26 11:02:03.508105795 +0200
@@ -53,6 +53,7 @@
 struct AAA_AVP;
 struct sip_msg;

+inline int cxdx_add_call_id(AAAMessage *msg, str data);
 /**
  * Creates and adds a Destination-Realm AVP.
  * @param msg - the Diameter message to add to.
@@ -62,14 +63,6 @@
 inline int cxdx_add_destination_realm(AAAMessage *msg, str data);

 /**
- * Creates and adds a Destination-Host AVP.
- * @param msg - the Diameter message to add to.
- * @param data - the value for the AVP payload
- * @returns 1 on success or 0 on error
- */
-inline int cxdx_add_destination_host(AAAMessage *msg,str data);
-
-/**
  * Creates and adds a Vendor-Specifig-Application-ID AVP.
  * @param msg - the Diameter message to add to.
  * @param vendor_id - the value of the vendor_id,
</code></pre>

<pre><code>--- modules/ims_auth/cxdx_avp.c 2016-06-06 11:04:40.971522168 +0200
+++ modules/ims_registrar_scscf/cxdx_avp.c  2016-04-26 11:02:03.508105795 +0200
@@ -44,7 +44,6 @@
  */


-
 #include "../cdp/cdp_load.h"
 #include "../../modules/tm/tm_load.h"
 #include "cxdx_avp.h"
@@ -136,47 +135,42 @@

    avp = cdpb.AAAFindMatchingAVP(msg,0,avp_code,vendor_id,0);
    if (avp==0){
-       LM_INFO("%s: Failed finding avp (avp_code = %d, vendor_id = %d)\n",func, avp_code, vendor_id);
+       LM_INFO("%s: Failed finding avp\n",func);
        return r;
    }
    else 
        return avp->data;
 }

-/**
- * Creates and adds a Destination-Realm AVP.
- * @param msg - the Diameter message to add to.
- * @param data - the value for the AVP payload
- * @returns 1 on success or 0 on error
- */
-inline int cxdx_add_destination_realm(AAAMessage *msg,str data)
+inline int cxdx_add_call_id(AAAMessage *msg, str data) 
 {
-   return 
+    return 
    cxdx_add_avp(msg,data.s,data.len,
-       AVP_Destination_Realm,
-       AAA_AVP_FLAG_MANDATORY,
-       0,
+       AVP_Call_Id,
+       AAA_AVP_FLAG_VENDOR_SPECIFIC,
+       50,
        AVP_DUPLICATE_DATA,
        __FUNCTION__);
 }

 /**
- * Creates and adds a Destination-Host AVP.
+ * Creates and adds a Destination-Realm AVP.
  * @param msg - the Diameter message to add to.
  * @param data - the value for the AVP payload
  * @returns 1 on success or 0 on error
  */
-inline int cxdx_add_destination_host(AAAMessage *msg,str data)
+inline int cxdx_add_destination_realm(AAAMessage *msg,str data)
 {
    return 
    cxdx_add_avp(msg,data.s,data.len,
-       AVP_Destination_Host,
+       AVP_Destination_Realm,
        AAA_AVP_FLAG_MANDATORY,
        0,
        AVP_DUPLICATE_DATA,
        __FUNCTION__);
 }

+
 /**
  * Creates and adds a Vendor-Specifig-Application-ID AVP.
  * @param msg - the Diameter message to add to.
@@ -658,7 +652,7 @@

    avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Item_Number,
        IMS_vendor_id_3GPP,0);
-   if (!avp||avp->data.len!=4) *item_number=0;
+   if (!avp||!avp->data.len==4) *item_number=0;
    else *item_number = get_4bytes(avp->data.s);

    avp = cdpb.AAAFindMatchingAVPList(list,0,AVP_IMS_SIP_Authentication_Scheme,
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/658#issuecomment-223908702">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AF36ZQ1VzVdR0PLvsBM1cycvOpvmzHUZks5qI-a7gaJpZM4Ius6y">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36ZQYigHt3Qz9FJgvoU1Jqs_Ag4ZTxks5qI-a7gaJpZM4Ius6y.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/658#issuecomment-223908702"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>