Index: extensions/dbg_interactive/dbg_interactive.i
===================================================================
--- extensions/dbg_interactive/dbg_interactive.i	(revision 662)
+++ extensions/dbg_interactive/dbg_interactive.i	(revision 706)
@@ -152,5 +152,5 @@
 
 /* Overwrite declaration to apply typemaps */
-int fd_sess_fromsid ( char * STRING, size_t LENGTH, struct session ** OUTPUT, int * BOOL_OUT);
+int fd_sess_fromsid ( unsigned char * STRING, size_t LENGTH, struct session ** OUTPUT, int * BOOL_OUT);
 
 
Index: extensions/dbg_interactive/messages.i
===================================================================
--- extensions/dbg_interactive/messages.i	(revision 688)
+++ extensions/dbg_interactive/messages.i	(revision 706)
@@ -341,12 +341,12 @@
 	
 	/* Get the source */
-	char *source() {
-		char * s = NULL;
-		int ret = fd_msg_source_get($self, &s);
-		if (ret != 0) {
-			DI_ERROR(ret, NULL, NULL);
-			return NULL;
-		}
-		return s;
+	%cstring_output_allocate_size(char ** outid, size_t * outlen, /* do not free */);
+	void source(char ** outid, size_t * outlen) {
+		int ret = fd_msg_source_get($self, outid, outlen);
+		if (ret != 0) {
+			DI_ERROR(ret, NULL, NULL);
+			return;
+		}
+		return;
 	}
 	
Index: extensions/dbg_interactive/peers.i
===================================================================
--- extensions/dbg_interactive/peers.i	(revision 640)
+++ extensions/dbg_interactive/peers.i	(revision 706)
@@ -97,7 +97,7 @@
 
 %inline %{
-static struct peer_hdr * peer_search(char *diamid) {
+static struct peer_hdr * peer_search(char *STRING, size_t LENGTH) {
 	struct peer_hdr *r = NULL;
-	int ret = fd_peer_getbyid( diamid, &r );
+	int ret = fd_peer_getbyid( STRING, LENGTH, 0, &r );
 	if (ret) {
 		DI_ERROR(ret, NULL, NULL);
Index: extensions/dbg_interactive/routing.i
===================================================================
--- extensions/dbg_interactive/routing.i	(revision 640)
+++ extensions/dbg_interactive/routing.i	(revision 706)
@@ -55,6 +55,8 @@
 		fd_rtd_free(&r);
 	}
-	void add(char * peerid, char * realm) {
-		int ret = fd_rtd_candidate_add($self, peerid, realm);
+	%apply (char *STRING, int LENGTH) { (char * peerid, size_t peeridlen) };
+	%apply (char *STRING, int LENGTH) { (char * realm, size_t realmlen) };
+	void add(char * peerid, size_t peeridlen, char * realm, size_t realmlen) {
+		int ret = fd_rtd_candidate_add($self, peerid, peeridlen, realm, realmlen);
 		if (ret != 0) {
 			DI_ERROR(ret, NULL, NULL);
@@ -62,8 +64,8 @@
 	}
 	void remove(char * STRING, size_t LENGTH) {
-		fd_rtd_candidate_del($self, STRING, LENGTH);
-	}
-	void error(char * dest, char * STRING, size_t LENGTH, uint32_t rcode) {
-		int ret =  fd_rtd_error_add($self, dest, (uint8_t *)STRING, LENGTH, rcode);
+		fd_rtd_candidate_del($self, (os0_t)STRING, LENGTH);
+	}
+	void error(char * peerid, size_t peeridlen, char * STRING, size_t LENGTH, uint32_t rcode) {
+		int ret =  fd_rtd_error_add($self, peerid, peeridlen, (os0_t)STRING, LENGTH, rcode);
 		if (ret != 0) {
 			DI_ERROR(ret, NULL, NULL);
Index: extensions/dbg_interactive/sessions.i
===================================================================
--- extensions/dbg_interactive/sessions.i	(revision 639)
+++ extensions/dbg_interactive/sessions.i	(revision 706)
@@ -40,5 +40,5 @@
 %{
 /* call it (might be called from a different thread than the interpreter, when session times out) */
-static void call_the_python_cleanup_callback(session_state * state, char * sid, void * cb) {
+static void call_the_python_cleanup_callback(session_state * state, os0_t sid, void * cb) {
 	PyObject *result;
 	if (!cb) {
@@ -100,5 +100,5 @@
 		int ret;
 		struct session * s = NULL;
-		ret = fd_sess_new(&s, fd_g_config->cnf_diamid, "dbg_interactive", sizeof("dbg_interactive"));
+		ret = fd_sess_new(&s, fd_g_config->cnf_diamid, fd_g_config->cnf_diamid_len, (os0_t)"dbg_interactive", CONSTSTRLEN("dbg_interactive"));
 		if (ret != 0) {
 			DI_ERROR(ret, NULL, NULL);
@@ -110,5 +110,5 @@
 		int ret;
 		struct session * s = NULL;
-		ret = fd_sess_new(&s, diamid, STRING, LENGTH);
+		ret = fd_sess_new(&s, diamid, 0, (os0_t)STRING, LENGTH);
 		if (ret != 0) {
 			DI_ERROR(ret, NULL, NULL);
@@ -120,5 +120,5 @@
 		int ret, n;
 		struct session * s = NULL;
-		ret = fd_sess_fromsid(STRING, LENGTH, &s, &n);
+		ret = fd_sess_fromsid((os0_t)STRING, LENGTH, &s, &n);
 		if (ret != 0) {
 			DI_ERROR(ret, NULL, NULL);
@@ -144,13 +144,14 @@
 		return;
 	}
-	char * getsid() {
+	
+	%cstring_output_allocate_size(char ** outsid, size_t * sidlen, /* do not free */);
+	void getsid(char ** outsid, size_t * sidlen) {
 		int ret;
-		char * sid = NULL;
-		ret = fd_sess_getsid( $self, &sid);
+		ret = fd_sess_getsid( $self, (void *)outsid, sidlen);
 		if (ret != 0) {
 			DI_ERROR(ret, NULL, NULL);
-			return NULL;
+			return;
 		}
-		return sid;
+		return;
 	}
 	void settimeout(long seconds) {
