Browse code

- added remote_cseq and local_cseq fileds instead of cseq in subs_t structure for more clarity

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@2583 689a6050-402a-0410-94f2-e92a70836424

Anca Vamanu authored on 08/08/2007 11:33:25
Showing 5 changed files
... ...
@@ -415,8 +415,7 @@ error:
415 415
 	return NULL;
416 416
 
417 417
 }
418
-str* get_p_notify_body(str user, str host, ev_t* event, str* etag,
419
-		subs_t* subs)
418
+str* get_p_notify_body(str user, str host, ev_t* event, str* etag)
420 419
 {
421 420
 	db_key_t query_cols[6];
422 421
 	db_val_t query_vals[6];
... ...
@@ -438,15 +437,13 @@ str* get_p_notify_body(str user, str host, ev_t* event, str* etag,
438 438
 	query_cols[n_query_cols] = "domain";
439 439
 	query_vals[n_query_cols].type = DB_STR;
440 440
 	query_vals[n_query_cols].nul = 0;
441
-	query_vals[n_query_cols].val.str_val.s = host.s;
442
-	query_vals[n_query_cols].val.str_val.len = host.len;
441
+	query_vals[n_query_cols].val.str_val = host;
443 442
 	n_query_cols++;
444 443
 
445 444
 	query_cols[n_query_cols] = "username";
446 445
 	query_vals[n_query_cols].type = DB_STR;
447 446
 	query_vals[n_query_cols].nul = 0;
448
-	query_vals[n_query_cols].val.str_val.s = user.s;
449
-	query_vals[n_query_cols].val.str_val.len = user.len;
447
+	query_vals[n_query_cols].val.str_val = user;
450 448
 	n_query_cols++;
451 449
 
452 450
 	query_cols[n_query_cols] = "event";
... ...
@@ -684,7 +681,7 @@ dlg_t* build_dlg_t (str p_uri, subs_t* subs)
684 684
 	}
685 685
 	memset(td, 0, sizeof(dlg_t));
686 686
 
687
-	td->loc_seq.value = subs->cseq++;
687
+	td->loc_seq.value = subs->local_cseq++;
688 688
 	td->loc_seq.is_set = 1;
689 689
 
690 690
 	td->id.call_id = subs->callid;
... ...
@@ -1021,7 +1018,7 @@ int get_subs_dialog(str* p_user, str* p_domain, ev_t* event,str* sender,
1021 1021
 		subs->local_contact.len = local_contact.len;
1022 1022
 		size+= local_contact.len;
1023 1023
 
1024
-		subs->cseq = row_vals[cseq_col].val.int_val;
1024
+		subs->local_cseq = row_vals[cseq_col].val.int_val;
1025 1025
 		subs->expires = row_vals[expires_col].val.int_val - 
1026 1026
 			(int)time(NULL);
1027 1027
 		subs->version = row_vals[version_col].val.int_val;
... ...
@@ -1074,7 +1071,7 @@ int publ_notify(presentity_t* p, str* body, str* offline_etag)
1074 1074
 	if(p->event->agg_nbody)
1075 1075
 	{	
1076 1076
 		notify_body = get_p_notify_body(p->user, p->domain,
1077
-				p->event , offline_etag, NULL);
1077
+				p->event , offline_etag);
1078 1078
 		if(notify_body == NULL)
1079 1079
 		{
1080 1080
 			DBG( "PRESENCE: publ_notify: Could not get the"
... ...
@@ -1168,7 +1165,7 @@ int query_db_notify(str* p_user, str* p_domain, ev_t* event,
1168 1168
 	if(event->type & PUBL_TYPE)
1169 1169
 	{
1170 1170
 		notify_body = get_p_notify_body(*p_user, *p_domain, event,
1171
-				NULL, NULL);
1171
+				NULL);
1172 1172
 		if(notify_body == NULL)
1173 1173
 		{
1174 1174
 			DBG( "PRESENCE:query_db_notify: Could not get the"
... ...
@@ -1305,7 +1302,7 @@ int notify(subs_t* subs, subs_t * watcher_subs,str* n_body,int force_null_body)
1305 1305
 			else
1306 1306
 			{
1307 1307
 				notify_body = get_p_notify_body(subs->pres_user,
1308
-						subs->pres_domain, subs->event, NULL, subs);
1308
+						subs->pres_domain, subs->event, NULL);
1309 1309
 				if(notify_body == NULL || notify_body->s== NULL)
1310 1310
 				{
1311 1311
 					DBG("PRESENCE:notify: Could not get the notify_body\n");
... ...
@@ -1405,7 +1402,7 @@ jump_over_body:
1405 1405
 	update_keys[n_update_keys] = "local_cseq";
1406 1406
 	update_vals[n_update_keys].type = DB_INT;
1407 1407
 	update_vals[n_update_keys].nul = 0;
1408
-	update_vals[n_update_keys].val.int_val = subs->cseq;
1408
+	update_vals[n_update_keys].val.int_val = subs->local_cseq;
1409 1409
 	n_update_keys++;
1410 1410
 
1411 1411
 	update_keys[n_update_keys] = "status";
... ...
@@ -1670,7 +1667,7 @@ c_back_param* shm_dup_subs(subs_t* subs, str to_tag)
1670 1670
 	cb_param->wi_subs->callid.len = subs->callid.len;
1671 1671
 	size+= subs->callid.len;
1672 1672
 
1673
-	cb_param->wi_subs->cseq = subs->cseq;
1673
+	cb_param->wi_subs->local_cseq = subs->local_cseq;
1674 1674
 	
1675 1675
 	cb_param->wi_subs->contact.s = (char*)cb_param + size;
1676 1676
 	strncpy(cb_param->wi_subs->contact.s, subs->contact.s, subs->contact.len);
... ...
@@ -54,7 +54,7 @@ char* generate_ETag(int publ_count)
54 54
 {
55 55
 	char* etag;
56 56
 	int size = 0;
57
-	etag = (char*)pkg_malloc(60*sizeof(char));
57
+	etag = (char*)pkg_malloc(128*sizeof(char));
58 58
 	if(etag ==NULL)
59 59
 	{
60 60
 		LOG(L_ERR, "PRESENCE:generate_ETag:Error while allocating memory \n");
... ...
@@ -65,8 +65,16 @@ char* generate_ETag(int publ_count)
65 65
 	if( size <0 )
66 66
 	{
67 67
 		LOG(L_ERR, "PRESENCE: generate_ETag: ERROR unsuccessfull sprintf\n ");
68
+		pkg_free(etag);
68 69
 		return NULL;
69 70
 	}
71
+	if(size> 128)
72
+	{
73
+		LOG(L_ERR, "PRESENCE: generate_ETag: ERROR buffer size overflown\n");
74
+		pkg_free(etag);
75
+		return NULL;
76
+	}
77
+
70 78
 	etag[size] = '\0';
71 79
 	DBG("PRESENCE: generate_ETag: etag= %s / %d\n ",etag, size);
72 80
 	return etag;
... ...
@@ -74,65 +82,78 @@ char* generate_ETag(int publ_count)
74 74
 
75 75
 int publ_send200ok(struct sip_msg *msg, int lexpire, str etag)
76 76
 {
77
-	str hdr_append, hdr_append2 ;
77
+	char buf[128];
78
+	int buf_len= 128, size;
79
+	str hdr_append= {0, 0}, hdr_append2= {0, 0} ;
78 80
 
79 81
 	DBG("PRESENCE:publ_send200ok: send 200OK reply\n");	
80 82
 	DBG("PRESENCE:publ_send200ok: etag= %s - len= %d\n", etag.s, etag.len);
83
+	
81 84
 	/* ??? should we use static allocated buffer */
82
-	hdr_append.s = (char *)pkg_malloc( sizeof(char)*100);
83
-	if(hdr_append.s == NULL)
84
-	{
85
-		LOG(L_ERR,"ERROR:publ_send200ok: ERROR no more memory\n");
86
-		return -1;
87
-	}
85
+	
86
+	hdr_append.s = buf;
88 87
 	hdr_append.s[0]='\0';
89 88
 	hdr_append.len = sprintf(hdr_append.s, "Expires: %d\r\n",lexpire -
90 89
 			expires_offset);
91 90
 	if(hdr_append.len < 0)
92 91
 	{
93 92
 		LOG(L_ERR, "PRESENCE:publ_send200ok: ERROR unsuccessful sprintf\n");
94
-		pkg_free(hdr_append.s);
95
-			return -1;
93
+		goto error;
94
+	}
95
+	if(hdr_append.len > buf_len)
96
+	{
97
+		LOG(L_ERR, "PRESENCE:publ_send200ok: ERROR buffer size overflown\n");
98
+		goto error;
96 99
 	}
97 100
 	hdr_append.s[hdr_append.len]= '\0';
98 101
 		
99 102
 	if (add_lump_rpl( msg, hdr_append.s, hdr_append.len, LUMP_RPL_HDR)==0 )
100 103
 	{
101 104
 		LOG(L_ERR,"PRESENCE: publ_send200ok:ERROR unable to add lump_rl\n");
102
-		pkg_free(hdr_append.s);
103
-		return -1;
105
+		goto error;
104 106
 	}
105
-	pkg_free(hdr_append.s);
106 107
 
107
-	hdr_append2.s = (char *)pkg_malloc( sizeof(char)*(16+etag.len) );
108
+	size= sizeof(char)*(20+etag.len) ;
109
+	hdr_append2.s = (char *)pkg_malloc(size);
108 110
 	if(hdr_append2.s == NULL)
109 111
 	{
110 112
 		LOG(L_ERR,"PRESENCE:publ_send200ok:ERROR no more memory\n");
111
-		return -1;
113
+		goto error;
112 114
 	}
113 115
 	hdr_append2.s[0]='\0';
114 116
 	hdr_append2.len = sprintf(hdr_append2.s, "SIP-ETag: %s\r\n", etag.s);
115 117
 	if(hdr_append2.len < 0)
116 118
 	{
117 119
 		LOG(L_ERR, "PRESENCE:publ_send200ok:ERROR unsuccessful sprintf\n ");
118
-		pkg_free(hdr_append2.s);
119
-		return -1;
120
+		goto error;
121
+	}
122
+	if(hdr_append2.len > size)
123
+	{
124
+		LOG(L_ERR, "PRESENCE:publ_send200ok: ERROR buffer size overflown\n");
125
+		goto error;
120 126
 	}
127
+
121 128
 	hdr_append2.s[hdr_append2.len]= '\0';
122 129
 	if (add_lump_rpl(msg, hdr_append2.s, hdr_append2.len, LUMP_RPL_HDR)==0 )
123 130
 	{
124 131
 		LOG(L_ERR,"PRESENCE:publ_send200ok: unable to add lump_rl\n");
125
-		pkg_free(hdr_append2.s);
126
-		return -1;
132
+		goto error;
127 133
 	}
128
-	pkg_free(hdr_append2.s);
129 134
 
130 135
 	if( slb.reply( msg, 200, &pu_200_rpl)== -1)
131 136
 	{
132 137
 		LOG(L_ERR,"PRESENCE: publ_send200ok: ERORR while sending reply\n");
133
-		return -1;
138
+		goto error;
134 139
 	}
135 140
 
141
+	pkg_free(hdr_append2.s);
142
+	return 0;
143
+
144
+error:
145
+
146
+	if(hdr_append2.s)
147
+		pkg_free(hdr_append2.s);
148
+
136 149
 	return 0;
137 150
 
138 151
 }	
... ...
@@ -140,13 +161,16 @@ presentity_t* new_presentity( str* domain,str* user,int expires,
140 140
 		ev_t* event, str* etag, str* sender)
141 141
 {
142 142
 	presentity_t *presentity;
143
-	int size;
143
+	int size, init_len;
144 144
 	
145
-	/* alocating memory for presentity */
146
-	size = sizeof(presentity_t)+ domain->len+ user->len+ etag->len + 1;
145
+	/* allocating memory for presentity */
146
+	size = sizeof(presentity_t)+ (domain->len+ user->len+ etag->len + 50)
147
+		* sizeof(char);
147 148
 	if(sender)
148 149
 		size+= sizeof(str)+ sender->len* sizeof(char);
149 150
 	
151
+	init_len= size;
152
+
150 153
 	presentity = (presentity_t*)pkg_malloc(size);
151 154
 	if(presentity == NULL)
152 155
 	{
... ...
@@ -156,20 +180,19 @@ presentity_t* new_presentity( str* domain,str* user,int expires,
156 156
 	memset(presentity, 0, size);
157 157
 	size= sizeof(presentity_t);
158 158
 
159
-	presentity->domain.s = (char*)((char*)presentity+ size);
159
+	presentity->domain.s = (char*)presentity+ size;
160 160
 	strncpy(presentity->domain.s, domain->s, domain->len);
161 161
 	presentity->domain.len = domain->len;
162 162
 	size+= domain->len;	
163 163
 	
164
-	presentity->user.s = (char*)((char*)presentity+size);
164
+	presentity->user.s = (char*)presentity+size;
165 165
 	strncpy(presentity->user.s, user->s, user->len);
166 166
 	presentity->user.len = user->len;
167 167
 	size+= user->len;
168 168
 
169
-	presentity->etag.s = ((char*)presentity)+ size;
169
+	presentity->etag.s = (char*)presentity+ size;
170 170
 	strcpy(presentity->etag.s, etag->s);
171 171
 	presentity->etag.s[etag->len]= '\0';
172
-	presentity->etag.len = etag->len;
173 172
 
174 173
 	size+= etag->len+1;
175 174
 	
... ...
@@ -183,6 +206,14 @@ presentity_t* new_presentity( str* domain,str* user,int expires,
183 183
 		size+= sender->len;
184 184
 	}
185 185
 
186
+	if(size> init_len)
187
+	{
188
+		LOG(L_ERR, "PRESENCE: new_presentity: ERROR"
189
+			" buffer size overflow init_len= %d, size= %d\n", init_len, size);
190
+		pkg_free(presentity);
191
+		return NULL;
192
+	}
193
+	DBG("PRESENCE: new_presentity:init_len= %d size= %d\n", init_len, size);
186 194
 	presentity->event= event;
187 195
 	presentity->expires = expires;
188 196
 	presentity->received_time= (int)time(NULL);
... ...
@@ -190,12 +221,13 @@ presentity_t* new_presentity( str* domain,str* user,int expires,
190 190
     
191 191
 }
192 192
 
193
-int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body, int new_t)
193
+int update_presentity(struct sip_msg* msg, presentity_t* presentity, str* body,
194
+		int new_t)
194 195
 {
195
-	db_key_t query_cols[8], result_cols[1];
196
-	db_op_t  query_ops[8];
197
-	db_val_t query_vals[8], update_vals[5];
198
-	db_key_t update_keys[5];
196
+	db_key_t query_cols[11], result_cols[5];
197
+	db_op_t  query_ops[11];
198
+	db_val_t query_vals[11], update_vals[7];
199
+	db_key_t update_keys[7];
199 200
 	db_res_t *result= NULL;
200 201
 	int n_query_cols = 0;
201 202
 	int n_update_cols = 0;
... ...
@@ -379,7 +379,15 @@ int handle_publish(struct sip_msg* msg, char* sender_uri, char* str2)
379 379
 	else
380 380
 	{
381 381
 		DBG("PRESENCE:handle_publish: SIP-If-Match found\n");
382
-		etag = hdr->body;
382
+		etag.s = (char*)pkg_malloc(sizeof(char)*hdr->body.len);
383
+		if(etag.s== NULL)
384
+		{
385
+			LOG(L_ERR, "PRESENCE:handle_publish: ERROR No more memory\n");
386
+			goto error;
387
+		}
388
+		memcpy(etag.s, hdr->body.s, hdr->body.len );
389
+		etag.len = hdr->body.len; 	 
390
+		etag.s[ etag.len] = '\0';
383 391
 		DBG("PRESENCE:handle_publish: existing etag  = %.*s \n", etag.len,
384 392
 				etag.s);
385 393
 	}
... ...
@@ -508,7 +516,7 @@ int handle_publish(struct sip_msg* msg, char* sender_uri, char* str2)
508 508
 
509 509
 	if(presentity)
510 510
 		pkg_free(presentity);
511
-	if(etag_gen && etag.s)
511
+	if(etag.s)
512 512
 		pkg_free(etag.s);
513 513
 	if(sender)
514 514
 		pkg_free(sender);
... ...
@@ -520,7 +528,7 @@ error:
520 520
 	
521 521
 	if(presentity)
522 522
 		pkg_free(presentity);
523
-	if(etag_gen && etag.s)
523
+	if(etag.s)
524 524
 		pkg_free(etag.s);
525 525
 	if(sender)
526 526
 		pkg_free(sender);
... ...
@@ -39,7 +39,7 @@
39 39
 #include "notify.h"
40 40
 #include "../../ip_addr.h"
41 41
 
42
-int get_database_info(struct sip_msg* msg, subs_t* subs, unsigned int* remote_cseq, int* error_ret);
42
+int get_database_info(struct sip_msg* msg, subs_t* subs, int* error_ret);
43 43
 
44 44
 static str su_200_rpl  = str_init("OK");
45 45
 static str pu_481_rpl  = str_init("Subscription does not exist");
... ...
@@ -132,7 +132,7 @@ error:
132 132
 }
133 133
 
134 134
 int update_subscription(struct sip_msg* msg, subs_t* subs, str *rtag,
135
-		int to_tag_gen, unsigned int remote_cseq)
135
+		int to_tag_gen)
136 136
 {	
137 137
 	db_key_t query_cols[22];
138 138
 	db_val_t query_vals[22], update_vals[5];
... ...
@@ -279,7 +279,7 @@ int update_subscription(struct sip_msg* msg, subs_t* subs, str *rtag,
279 279
 		update_keys[n_update_cols] = "remote_cseq";
280 280
 		update_vals[n_update_cols].type = DB_INT;
281 281
 		update_vals[n_update_cols].nul = 0;
282
-		update_vals[n_update_cols].val.int_val = remote_cseq ; // the last cseq in dialog
282
+		update_vals[n_update_cols].val.int_val = subs->remote_cseq ; // the last cseq in dialog
283 283
 		n_update_cols++;
284 284
 
285 285
 		update_keys[n_update_cols] = "status";
... ...
@@ -329,7 +329,7 @@ int update_subscription(struct sip_msg* msg, subs_t* subs, str *rtag,
329 329
 			query_cols[n_query_cols] = "remote_cseq";
330 330
 			query_vals[n_query_cols].type = DB_INT;
331 331
 			query_vals[n_query_cols].nul = 0;
332
-			query_vals[n_query_cols].val.int_val = subs->cseq; 
332
+			query_vals[n_query_cols].val.int_val = subs->remote_cseq; 
333 333
 			n_query_cols++;
334 334
 
335 335
 
... ...
@@ -338,7 +338,7 @@ int update_subscription(struct sip_msg* msg, subs_t* subs, str *rtag,
338 338
 			query_vals[n_query_cols].nul = 0;
339 339
 			query_vals[n_query_cols].val.int_val = 0; // initialise with 0
340 340
 			n_query_cols++;
341
-			subs->cseq= 0;
341
+			subs->local_cseq= 0;
342 342
 
343 343
 			DBG("PRESENCE: update_subscription: expires: %d\n", subs->expires);
344 344
 			query_cols[n_query_cols] = "expires";
... ...
@@ -815,7 +815,7 @@ void msg_active_watchers_clean(unsigned int ticks,void *param)
815 815
 
816 816
 		
817 817
 		subs->expires = 0;
818
-		subs->cseq= cseq;
818
+		subs->local_cseq= cseq;
819 819
 		subs->reason.len = 7;
820 820
 
821 821
 		subs_array[i]= subs;
... ...
@@ -884,7 +884,6 @@ int handle_subscribe(struct sip_msg* msg, char* str1, char* str2)
884 884
 	db_val_t db_vals[10];
885 885
 	db_key_t update_keys[5];
886 886
 	db_val_t update_vals[5];
887
-	unsigned int remote_cseq;
888 887
 	int n_query_cols= 0; 
889 888
 	db_key_t result_cols[2];
890 889
 	db_res_t *result = NULL;
... ...
@@ -1114,7 +1113,7 @@ int handle_subscribe(struct sip_msg* msg, char* str1, char* str2)
1114 1114
 				" header\n");
1115 1115
 		goto error;
1116 1116
 	}
1117
-	if (str2int( &(get_cseq(msg)->number), &subs.cseq)!=0 )
1117
+	if (str2int( &(get_cseq(msg)->number), &subs.remote_cseq)!=0 )
1118 1118
 	{
1119 1119
 		LOG(L_ERR, "PRESENCE: handle_subscribe: ERROR cannot parse cseq"
1120 1120
 				" number\n");
... ...
@@ -1201,7 +1200,7 @@ int handle_subscribe(struct sip_msg* msg, char* str1, char* str2)
1201 1201
 	}
1202 1202
 	else
1203 1203
 	{
1204
-		if(get_database_info(msg, &subs, &remote_cseq, &error_ret )< 0)
1204
+		if(get_database_info(msg, &subs, &error_ret )< 0)
1205 1205
 		{
1206 1206
 			LOG(L_ERR, "PRESENCE: handle_subscribe:error while getting info"
1207 1207
 					" from database\n");
... ...
@@ -1457,7 +1456,7 @@ int handle_subscribe(struct sip_msg* msg, char* str1, char* str2)
1457 1457
 
1458 1458
 after_status:
1459 1459
 
1460
-	if( update_subscription(msg, &subs, &rtag_value, to_tag_gen, remote_cseq) <0 )
1460
+	if( update_subscription(msg, &subs, &rtag_value, to_tag_gen) <0 )
1461 1461
 	{	
1462 1462
 		LOG(L_ERR,"PRESENCE:handle_subscribe: ERROR while updating database\n");
1463 1463
 		goto error;
... ...
@@ -1524,14 +1523,12 @@ error:
1524 1524
 
1525 1525
 }
1526 1526
 
1527
-int get_database_info(struct sip_msg* msg, subs_t* subs,
1528
-		unsigned int* rem_cseq, int* error_ret)
1527
+int get_database_info(struct sip_msg* msg, subs_t* subs, int* error_ret)
1529 1528
 {	
1530 1529
 	db_key_t query_cols[10];
1531 1530
 	db_val_t query_vals[10];
1532 1531
 	db_key_t result_cols[5];
1533 1532
 	db_res_t *result= NULL;
1534
-	unsigned int local_cseq;
1535 1533
 	db_row_t *row ;	
1536 1534
 	db_val_t *row_vals ;
1537 1535
 	int n_query_cols = 0;
... ...
@@ -1647,13 +1644,13 @@ int get_database_info(struct sip_msg* msg, subs_t* subs,
1647 1647
 
1648 1648
 	row = &result->rows[0];
1649 1649
 	row_vals = ROW_VALUES(row);
1650
-	local_cseq= row_vals[local_cseq_col].val.int_val;
1650
+	subs->local_cseq= row_vals[local_cseq_col].val.int_val;
1651 1651
 	remote_cseq= row_vals[remote_cseq_col].val.int_val;
1652 1652
 	
1653
-	if(subs->cseq<= remote_cseq)
1653
+	if(subs->remote_cseq<= remote_cseq)
1654 1654
 	{
1655 1655
 		LOG(L_ERR, "PRESENCE: get_database_info: ERROR wrong sequence number"
1656
-				" received: %d -  stored: %d\n",subs->cseq, remote_cseq);
1656
+				" received: %d -  stored: %d\n",subs->remote_cseq, remote_cseq);
1657 1657
 		if (slb.reply(msg, 400, &pu_400_rpl) == -1)
1658 1658
 		{
1659 1659
 			LOG(L_ERR, "PRESENCE: get_database_info: ERROR while"
... ...
@@ -1664,8 +1661,6 @@ int get_database_info(struct sip_msg* msg, subs_t* subs,
1664 1664
 		return -1;
1665 1665
 	}
1666 1666
 	
1667
-	*rem_cseq= subs->cseq;
1668
-	
1669 1667
 	pres_user.s= (char*)row_vals[pres_user_col].val.string_val;
1670 1668
 	pres_user.len= strlen(pres_user.s);
1671 1669
 	subs->pres_user.s= (char*)pkg_malloc(pres_user.len);
... ...
@@ -1680,10 +1675,6 @@ int get_database_info(struct sip_msg* msg, subs_t* subs,
1680 1680
 
1681 1681
 	pa_dbf.free_result(pa_db, result);
1682 1682
 	result= NULL;
1683
-	// from this point on the subs.cseq field will store 
1684
-	// the local_cseq used for Notify
1685
-	subs->cseq= local_cseq;
1686
-
1687 1683
 
1688 1684
 	return 0;
1689 1685
 
... ...
@@ -50,9 +50,10 @@ struct subscription
50 50
 	str from_tag;
51 51
 	str callid;
52 52
 	str sockinfo_str;
53
-	str local_contact;
54
-	unsigned int cseq; 
53
+	unsigned int remote_cseq; 
54
+	unsigned int local_cseq; 
55 55
 	str contact;
56
+	str local_contact;
56 57
 	str record_route;
57 58
 	unsigned int expires;
58 59
 	str status;