register(k): pack contact info based on header for searching existing ul records
[sip-router] / sip_msg_clone.c
index 620094f..28933b2 100644 (file)
  *  2009-07-22  initial version: functions moved from tm/sip_msg.c (andrei)
 */
 
+/** SIP-router core :: sip message shared memory cloner.
+ * @file
+ * @ingroup core
+ * Module: @ref core
+ */
+
 #include "sip_msg_clone.h"
 
 
@@ -457,7 +463,6 @@ struct sip_msg*  sip_msg_shm_clone( struct sip_msg *org_msg, int *sip_msg_len,
                case HDR_SUBJECT_T:
                case HDR_USERAGENT_T:
                case HDR_SERVER_T:
-               case HDR_ACCEPTDISPOSITION_T:
                case HDR_CONTENTDISPOSITION_T:
                case HDR_DIVERSION_T:
                case HDR_RPID_T:
@@ -481,6 +486,7 @@ struct sip_msg*  sip_msg_shm_clone( struct sip_msg *org_msg, int *sip_msg_len,
                case HDR_PAI_T:
                case HDR_PATH_T:
                case HDR_PRIVACY_T:
+               case HDR_REASON_T:
                        /* we ignore them for now even if they have something parsed*/
                        break;
                }/*switch*/
@@ -513,6 +519,9 @@ struct sip_msg*  sip_msg_shm_clone( struct sip_msg *org_msg, int *sip_msg_len,
        new_msg->add_rm = 0;
        new_msg->body_lumps = 0;
        new_msg->reply_lump = 0;
+       /* zero *uri.s, in case len is 0 but org_msg->*uris!=0 (just to be safe)*/
+       new_msg->new_uri.s = 0;
+       new_msg->dst_uri.s = 0;
        /* new_uri */
        if (org_msg->new_uri.s && org_msg->new_uri.len)
        {
@@ -527,6 +536,9 @@ struct sip_msg*  sip_msg_shm_clone( struct sip_msg *org_msg, int *sip_msg_len,
                memcpy( p , org_msg->dst_uri.s , org_msg->dst_uri.len);
                p += ROUND4(org_msg->dst_uri.len);
        }
+       /* path_vec is not cloned (it's reset instead) */
+       new_msg->path_vec.s=0;
+       new_msg->path_vec.len=0;
        /* message buffers(org and scratch pad) */
        memcpy( p , org_msg->buf, org_msg->len);
        /* ZT to be safer */
@@ -607,6 +619,7 @@ struct sip_msg*  sip_msg_shm_clone( struct sip_msg *org_msg, int *sip_msg_len,
                case HDR_IDENTITY_T:
                case HDR_IDENTITY_INFO_T:
                case HDR_RETRY_AFTER_T:
+               case HDR_REASON_T:
                        break;
 
                case HDR_VIA_T:
@@ -822,11 +835,6 @@ struct sip_msg*  sip_msg_shm_clone( struct sip_msg *org_msg, int *sip_msg_len,
                                new_msg->server = new_hdr;
                        }
                        break;
-               case HDR_ACCEPTDISPOSITION_T:
-                       if (!HOOK_SET(accept_disposition)) {
-                               new_msg->accept_disposition = new_hdr;
-                       }
-                       break;
                case HDR_CONTENTDISPOSITION_T:
                        if (!HOOK_SET(content_disposition)) {
                                new_msg->content_disposition = new_hdr;