Hi devs,

so, after many months, finally I found the time (and courage ;-) ) to do the necessary changes so that the Open IMS Core modules would also be runnable under sip-router. And well, kudos for the work that you've done so far! Adapting was really much more easy then I expected, due to the backwards compatibility that is still there. I was actually able so far to modify my modules so that they would be compilable under both sip-router/master and our ser_ims.

Until now I have managed to have the Diameter module and the I-CSCF working, with the rest hopefully coming in the next days. These fixes are already commited on our svn tree, but they are not really usable without some sip-router patches that I will talk about a bit later.

But first of all, let me tell you the overall picture of what we have changed and added to SER 2.1.0 (I know it's an ancient version, but it was more than enough for what we wanted to get).


Modules:
  * cdp - The CDiameterPeer
  * icscf - I-CSCF functions
  * isc - IMS Service Control - AS triggering and forwarding
  * mgcf - some helpers for making some MGCF nodes attached to
    softswitches (this is just an experimental collection of hacks)
  * pcscf - P-CSCF functions
  * scscf - S-CSCF functions

Other patches:
  * dialog - small typos
  * enum - support for query on the originating side, useful in PSTN
    inbound processing
  * ratelimit - a much extended ratelimit module, with multiple
    queues, dynamic limiting capabilities based on internal/external
    indicators, random retry-after capabilities, etc; which although
    sent towards the SER trunk, never made it
  * tls - some hashing functions
  * tm - not really sure for now, but I hope we can reconcile without
    changes on the sip-router side
  * Core - support for emergency URI, some mem logging improvements, etc.

I hope that we could integrate as much as possible from the changes that we did as really we would like to converge rather than go our own separate path. Sure, many parts are crazy-experimental and they would probably stay like that unless someone would like to do a serious re-implementation, but others I think would benefit outside of the IMS targets that we had.

And here comes my first issue then. Whether you guys would be open to host this in the same git repository or should we still maintain our own separate svn tree? I started by adding a modules_osims directory and putting there the differences. And so far it seems to be working for me locally. Sure that the crazy-experimental parts won't make it to master, but hopefully the Open IMS Core could leave entirely as just one modules directory inside sip-router tree.

If we'd stay separated, I would then try and find a way to link the git repository as external in our svn one and overwrite with our changes.


Then I am attaching some small patches for now, with more to come in the next days as I will progress:

- sip-router_modules_s_dialog.diff - just some typos in logging
- sip-router_pt.diff
- added a drop_my_process() function - in the cdp module (Diameter) we do have dynamic processes, which fork and exit distinctly from the ser ones, so we need this to clean-up. Without it, such usages would not be possible as the process table would fill and then new forks would be denied - I have commented the pt.c <mailbox:///root/private/_mail/Mail/common/Sent?number=587016624#pt.c> line 210. I am not sure if this is a bug or I just used the fork_process wrongly, but my process which was forked from a mod_init() not a mod_child_init() opens some sockets, which are mistakenly closed on fork_process() by the close_extra_socks(), which uses the pt[].unix_sock values from other processes, which overlap. So please advise on what would the best way be to still allow for the forked processes to open some sockets without them being closed on fork.

Both these patches are required in order to get the Diameter stack working.

Then there is this one that we use quite a lot for tracking memory leaks: http://tracker.iptel.org/browse/SER-224 . It's not there yet I guess, so should I resubmit it or forget about it? ;-)

I am looking forward to your feedback on how to proceed and on the attached patches.


Cheers,
-Dragos



--
Best Regards,
Dragos Vingarzan

diff --git a/modules_s/dialog/dlg_request.c b/modules_s/dialog/dlg_request.c
index ed7438e..12f20bd 100644
--- a/modules_s/dialog/dlg_request.c
+++ b/modules_s/dialog/dlg_request.c
@@ -53,12 +53,12 @@ int request_inside(str* method, str* headers, str* body, dlg_t* dialog, transact
 	uac_req_t	uac_r;
 
 	if (!method || !dialog) {
-		LOG(L_ERR, "req_within: Invalid parameter value\n");
+		LOG(L_ERR, "req_inside: Invalid parameter value\n");
 		goto err;
 	}
 
 	if (dialog->state != DLG_CONFIRMED) {
-		LOG(L_ERR, "req_within: Dialog is not confirmed yet\n");
+		LOG(L_ERR, "req_inside: Dialog is not confirmed yet\n");
 		goto err;
 	}
 
diff --git a/pt.c b/pt.c
index 757785e..a501a0d 100644
--- a/pt.c
+++ b/pt.c
@@ -206,8 +206,8 @@ int close_extra_socks(int child_id, int proc_no)
 		for (r=0; r<proc_no; r++){
 			if (pt[r].unix_sock>=0){
 				/* we can't change the value in pt[] because it's
-				 * shared so we only close it */
-				close(pt[r].unix_sock);
+				 * shared so we only close it */				
+				/*close(pt[r].unix_sock);*/
 			}
 		}
 		/* close all listen sockets (needed only in tcp_main */
@@ -368,6 +368,25 @@ end:
 }
 
 /**
+ * Drops one process out of the process table, on exit for example
+ */
+void drop_my_process()
+{
+	int pid = getpid();
+	int i,j;
+	lock_get(process_lock);
+		for(i=0;i<*process_count;i++)
+        	if (pt[i].pid==pid){
+        		for(j=i;j<(*process_count)-1;j++)
+        			pt[j] = pt[j+1];
+        		//free(pt[i].desc);
+        		(*process_count) = (*process_count)-1;
+        		break;
+        	}
+	lock_release(process_lock);
+}
+
+/**
  * Forks a new TCP process.
  * @param desc - text description for the process table
  * @param r - index in the tcp_children array
@@ -564,3 +583,5 @@ int mem_dump_shm_fixup(void *handle, str *gname, str *name, void **val)
 	return 0;
 }
 #endif
+
+
diff --git a/pt.h b/pt.h
index 525c078..a9bf407 100644
--- a/pt.h
+++ b/pt.h
@@ -90,6 +90,11 @@ int my_pid();
 int fork_process(int child_id,char *desc,int make_sock);
 
 /**
+ * Drops one process out of the process table, on exit for example
+ */
+void drop_my_process();
+
+/**
  * Forks a new TCP process.
  * @param desc - text description for the process table
  * @param r - index in the tcp_children array
_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to