Discussion:
[SR-Users] New Kamailio module Obfuscate
Muhammad Shahzad
2014-08-02 21:57:20 UTC
Permalink
Hi,

As already discussed in detail in following email thread,

https://www.mail-archive.com/sr-users-cR8azDVoa3IcDhw6gZKtMWD2FQJk+8+***@public.gmane.org/msg19922.html

The new Kamailio module obfuscate is ready for testing and can be
downloaded at,

http://webrtc.voip-demos.com/obfuscate.tbz2

It contains full code, with documentation and usage scenarios etc.

Adding Kamailio dev team, can you guys review the code and add this module
to Kamailio trunk if possible? I will be responsible for its maintenance
and bug fixes etc. if any.

Thank you.
Daniel-Constantin Mierla
2014-08-04 14:55:33 UTC
Permalink
Hello,

I looked at the code and my conclusion was that the name is a bit confusing.

While indeed you can do obfuscation using some embedded language or
other meanings from the config file, the module itself doesn't do
anything related. It executes an event route for network packet in/out.

Such functionaly is of course useful, just to remind the given example
with obfuscation. But I think a better name to reflect the behaviour
should be given.

Maybe obfuscate should be a module that implement some algorithms for
obfuscations, like you mentions:
- simply compressing (gz)
- compressing and encapsulation as body in a http request/reply
- itv

My proposal would be:
- either rename the module or embed in another module (e.g., corex) what
was developed for these event route execution. The event route name
should be related to network reception/transmission (e.g., network:msg).
Also the is_obfuscated_msg() should be something like is_incoming()
- have a new module obfuscate to implement some algorithm as proof of
concept (e.g., gzip -- i guess plenty of code from gzcompress module is
very useful just to take from there). Then others may contribute more,
as they have new ideas or from what you listed (http ecapsulation is at
least interesting, considering many allow port 80 and inspect for http).

Of course, these are my opinions, so the discussion can go on for
deciding on how to proceed.

Cheers,
Daniel
Post by Muhammad Shahzad
Hi,
As already discussed in detail in following email thread,
The new Kamailio module obfuscate is ready for testing and can be
downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation and usage scenarios etc.
Adding Kamailio dev team, can you guys review the code and add this
module to Kamailio trunk if possible? I will be responsible for its
maintenance and bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Muhammad Shahzad
2014-08-04 15:19:45 UTC
Permalink
Thank you for your valuable suggestions, i appreciate it.

I agree about module name, in fact a couple friends have already sent me
email privately suggesting the same. May be something like "nio_intercept"
would be better, since module only intercepts the network in/output and
leaves it to script writer what to do with it.

Regarding embedding in corex, that is interesting, however i need to go
through its code to understand it a bit and then attempt to embed it. Later
on, i will create separate module which import this functionality from
corex and do specific tasks such as compression and faking http etc.

There is a good progress on doubango SDK side as well and at least idoubs
would be ready soon (7 to 10 days approx). Then mobile voip developers can
fully test this functionality at both ends.

Anyways let me look at corex module and see if and how can i embed this. In
the meantime more suggestions and comments on this are warmly welcome from
everyone.

Thank you.
Post by Daniel-Constantin Mierla
Hello,
I looked at the code and my conclusion was that the name is a bit
confusing.
While indeed you can do obfuscation using some embedded language or other
meanings from the config file, the module itself doesn't do anything
related. It executes an event route for network packet in/out.
Such functionaly is of course useful, just to remind the given example
with obfuscation. But I think a better name to reflect the behaviour should
be given.
Maybe obfuscate should be a module that implement some algorithms for
- simply compressing (gz)
- compressing and encapsulation as body in a http request/reply
- itv
- either rename the module or embed in another module (e.g., corex) what
was developed for these event route execution. The event route name should
be related to network reception/transmission (e.g., network:msg). Also the
is_obfuscated_msg() should be something like is_incoming()
- have a new module obfuscate to implement some algorithm as proof of
concept (e.g., gzip -- i guess plenty of code from gzcompress module is
very useful just to take from there). Then others may contribute more, as
they have new ideas or from what you listed (http ecapsulation is at least
interesting, considering many allow port 80 and inspect for http).
Of course, these are my opinions, so the discussion can go on for deciding
on how to proceed.
Cheers,
Daniel
Post by Muhammad Shahzad
Hi,
As already discussed in detail in following email thread,
The new Kamailio module obfuscate is ready for testing and can be
downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation and usage scenarios etc.
Adding Kamailio dev team, can you guys review the code and add this
module to Kamailio trunk if possible? I will be responsible for its
maintenance and bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Muhammad Shahzad
2014-08-04 23:14:03 UTC
Permalink
Done all changes as you suggested.

1. The code is embedded in corex module. Two new files added named,
corex_nio.h and corex_nio.c. Some minor changes to corex_mod.c to call the
methods defined in corex_nio.h.
2. Event route name changed to event_route[network:msg].
3. function name changed from is_msg_obfuscated to is_incoming.
4. one additional module parameter is added, named network_io_intercept, to
enable disable the whole functionality. (default is disabled)
5. The README file and doc folder is updated with relevant documentation,
examples and use cases etc.

The code is available for review and download at,

http://webrtc.voip-demos.com/corex.tbz2

Regarding the actual encryption / compression etc., i am planning to add
some example PERL / LUA scripts later on.

Thank you.
Post by Muhammad Shahzad
Thank you for your valuable suggestions, i appreciate it.
I agree about module name, in fact a couple friends have already sent me
email privately suggesting the same. May be something like "nio_intercept"
would be better, since module only intercepts the network in/output and
leaves it to script writer what to do with it.
Regarding embedding in corex, that is interesting, however i need to go
through its code to understand it a bit and then attempt to embed it. Later
on, i will create separate module which import this functionality from
corex and do specific tasks such as compression and faking http etc.
There is a good progress on doubango SDK side as well and at least idoubs
would be ready soon (7 to 10 days approx). Then mobile voip developers can
fully test this functionality at both ends.
Anyways let me look at corex module and see if and how can i embed this.
In the meantime more suggestions and comments on this are warmly welcome
from everyone.
Thank you.
On Mon, Aug 4, 2014 at 7:55 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
Hello,
I looked at the code and my conclusion was that the name is a bit
confusing.
While indeed you can do obfuscation using some embedded language or other
meanings from the config file, the module itself doesn't do anything
related. It executes an event route for network packet in/out.
Such functionaly is of course useful, just to remind the given example
with obfuscation. But I think a better name to reflect the behaviour should
be given.
Maybe obfuscate should be a module that implement some algorithms for
- simply compressing (gz)
- compressing and encapsulation as body in a http request/reply
- itv
- either rename the module or embed in another module (e.g., corex) what
was developed for these event route execution. The event route name should
be related to network reception/transmission (e.g., network:msg). Also the
is_obfuscated_msg() should be something like is_incoming()
- have a new module obfuscate to implement some algorithm as proof of
concept (e.g., gzip -- i guess plenty of code from gzcompress module is
very useful just to take from there). Then others may contribute more, as
they have new ideas or from what you listed (http ecapsulation is at least
interesting, considering many allow port 80 and inspect for http).
Of course, these are my opinions, so the discussion can go on for
deciding on how to proceed.
Cheers,
Daniel
Post by Muhammad Shahzad
Hi,
As already discussed in detail in following email thread,
The new Kamailio module obfuscate is ready for testing and can be
downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation and usage scenarios etc.
Adding Kamailio dev team, can you guys review the code and add this
module to Kamailio trunk if possible? I will be responsible for its
maintenance and bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Daniel-Constantin Mierla
2014-08-05 08:26:46 UTC
Permalink
Can you do a commit on your local git clone and send the patch? It is
easier to review the changes. Practically use:

- git add -- to add new files
- git commit -- to commit changes
- git format-patch -- to get the commit in a file

Cheers,
Daniel
Post by Muhammad Shahzad
Done all changes as you suggested.
1. The code is embedded in corex module. Two new files added named,
corex_nio.h and corex_nio.c. Some minor changes to corex_mod.c to call
the methods defined in corex_nio.h.
2. Event route name changed to event_route[network:msg].
3. function name changed from is_msg_obfuscated to is_incoming.
4. one additional module parameter is added, named
network_io_intercept, to enable disable the whole functionality.
(default is disabled)
5. The README file and doc folder is updated with relevant
documentation, examples and use cases etc.
The code is available for review and download at,
http://webrtc.voip-demos.com/corex.tbz2
Regarding the actual encryption / compression etc., i am planning to
add some example PERL / LUA scripts later on.
Thank you.
On Mon, Aug 4, 2014 at 8:19 PM, Muhammad Shahzad
Thank you for your valuable suggestions, i appreciate it.
I agree about module name, in fact a couple friends have already
sent me email privately suggesting the same. May be something like
"nio_intercept" would be better, since module only intercepts the
network in/output and leaves it to script writer what to do with it.
Regarding embedding in corex, that is interesting, however i need
to go through its code to understand it a bit and then attempt to
embed it. Later on, i will create separate module which import
this functionality from corex and do specific tasks such as
compression and faking http etc.
There is a good progress on doubango SDK side as well and at least
idoubs would be ready soon (7 to 10 days approx). Then mobile voip
developers can fully test this functionality at both ends.
Anyways let me look at corex module and see if and how can i embed
this. In the meantime more suggestions and comments on this are
warmly welcome from everyone.
Thank you.
On Mon, Aug 4, 2014 at 7:55 PM, Daniel-Constantin Mierla
Hello,
I looked at the code and my conclusion was that the name is a
bit confusing.
While indeed you can do obfuscation using some embedded
language or other meanings from the config file, the module
itself doesn't do anything related. It executes an event route
for network packet in/out.
Such functionaly is of course useful, just to remind the given
example with obfuscation. But I think a better name to reflect
the behaviour should be given.
Maybe obfuscate should be a module that implement some
- simply compressing (gz)
- compressing and encapsulation as body in a http request/reply
- itv
- either rename the module or embed in another module (e.g.,
corex) what was developed for these event route execution. The
event route name should be related to network
reception/transmission (e.g., network:msg). Also the
is_obfuscated_msg() should be something like is_incoming()
- have a new module obfuscate to implement some algorithm as
proof of concept (e.g., gzip -- i guess plenty of code from
gzcompress module is very useful just to take from there).
Then others may contribute more, as they have new ideas or
from what you listed (http ecapsulation is at least
interesting, considering many allow port 80 and inspect for http).
Of course, these are my opinions, so the discussion can go on
for deciding on how to proceed.
Cheers,
Daniel
Hi,
As already discussed in detail in following email thread,
The new Kamailio module obfuscate is ready for testing and
can be downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation and usage
scenarios etc.
Adding Kamailio dev team, can you guys review the code and
add this module to Kamailio trunk if possible? I will be
responsible for its maintenance and bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda
<http://twitter.com/#%21/miconda> -
http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Muhammad Shahzad
2014-08-05 09:25:32 UTC
Permalink
These commands do not seem to work for me. Can you please do the patch?

1. adding files work,

git add modules/corex/corex_nio.c modules/corex/corex_nio.h

git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: modules/corex/corex_nio.c
# new file: modules/corex/corex_nio.h
#
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: modules/corex/README
# modified: modules/corex/corex_mod.c
# modified: modules/corex/doc/corex.xml
# modified: modules/corex/doc/corex_admin.xml
#

2. making commit seems to work,

git commit -m "added support for network io intercept."
[master f415b0c] added support for network io intercept.
2 files changed, 268 insertions(+)
create mode 100644 modules/corex/corex_nio.c
create mode 100644 modules/corex/corex_nio.h

3. git format-patch does not work,

git format-patch
[no-output]

4. Also tried,

git format-patch master --stdout
[no-output]

git format-patch master --stdout > /tmp/nio.patch
[no-output]


I don't know what is wrong, i have git version 1.7.10.4 on debian wheezy.

i miss subversion so badly...

Thank you.
Post by Daniel-Constantin Mierla
Can you do a commit on your local git clone and send the patch? It is
- git add -- to add new files
- git commit -- to commit changes
- git format-patch -- to get the commit in a file
Cheers,
Daniel
Done all changes as you suggested.
1. The code is embedded in corex module. Two new files added named,
corex_nio.h and corex_nio.c. Some minor changes to corex_mod.c to call the
methods defined in corex_nio.h.
2. Event route name changed to event_route[network:msg].
3. function name changed from is_msg_obfuscated to is_incoming.
4. one additional module parameter is added, named network_io_intercept,
to enable disable the whole functionality. (default is disabled)
5. The README file and doc folder is updated with relevant
documentation, examples and use cases etc.
The code is available for review and download at,
http://webrtc.voip-demos.com/corex.tbz2
Regarding the actual encryption / compression etc., i am planning to add
some example PERL / LUA scripts later on.
Thank you.
Post by Muhammad Shahzad
Thank you for your valuable suggestions, i appreciate it.
I agree about module name, in fact a couple friends have already sent me
email privately suggesting the same. May be something like "nio_intercept"
would be better, since module only intercepts the network in/output and
leaves it to script writer what to do with it.
Regarding embedding in corex, that is interesting, however i need to go
through its code to understand it a bit and then attempt to embed it. Later
on, i will create separate module which import this functionality from
corex and do specific tasks such as compression and faking http etc.
There is a good progress on doubango SDK side as well and at least
idoubs would be ready soon (7 to 10 days approx). Then mobile voip
developers can fully test this functionality at both ends.
Anyways let me look at corex module and see if and how can i embed this.
In the meantime more suggestions and comments on this are warmly welcome
from everyone.
Thank you.
On Mon, Aug 4, 2014 at 7:55 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
Hello,
I looked at the code and my conclusion was that the name is a bit
confusing.
While indeed you can do obfuscation using some embedded language or
other meanings from the config file, the module itself doesn't do anything
related. It executes an event route for network packet in/out.
Such functionaly is of course useful, just to remind the given example
with obfuscation. But I think a better name to reflect the behaviour should
be given.
Maybe obfuscate should be a module that implement some algorithms for
- simply compressing (gz)
- compressing and encapsulation as body in a http request/reply
- itv
- either rename the module or embed in another module (e.g., corex) what
was developed for these event route execution. The event route name should
be related to network reception/transmission (e.g., network:msg). Also the
is_obfuscated_msg() should be something like is_incoming()
- have a new module obfuscate to implement some algorithm as proof of
concept (e.g., gzip -- i guess plenty of code from gzcompress module is
very useful just to take from there). Then others may contribute more, as
they have new ideas or from what you listed (http ecapsulation is at least
interesting, considering many allow port 80 and inspect for http).
Of course, these are my opinions, so the discussion can go on for
deciding on how to proceed.
Cheers,
Daniel
Post by Muhammad Shahzad
Hi,
As already discussed in detail in following email thread,
The new Kamailio module obfuscate is ready for testing and can be
downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation and usage scenarios etc.
Adding Kamailio dev team, can you guys review the code and add this
module to Kamailio trunk if possible? I will be responsible for its
maintenance and bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Daniel-Constantin Mierla
2014-08-05 09:40:38 UTC
Permalink
You should use:

git format-patch -1 <sha>

The <sha> in your case appears to be f415b0c . If it is last commit,
should work with:

git format-patch -1 HEAD

Cheers,
Daniel
Post by Muhammad Shahzad
These commands do not seem to work for me. Can you please do the patch?
1. adding files work,
git add modules/corex/corex_nio.c modules/corex/corex_nio.h
git status
# On branch master
# (use "git reset HEAD <file>..." to unstage)
#
# new file: modules/corex/corex_nio.c
# new file: modules/corex/corex_nio.h
#
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: modules/corex/README
# modified: modules/corex/corex_mod.c
# modified: modules/corex/doc/corex.xml
# modified: modules/corex/doc/corex_admin.xml
#
2. making commit seems to work,
git commit -m "added support for network io intercept."
[master f415b0c] added support for network io intercept.
2 files changed, 268 insertions(+)
create mode 100644 modules/corex/corex_nio.c
create mode 100644 modules/corex/corex_nio.h
3. git format-patch does not work,
git format-patch
[no-output]
4. Also tried,
git format-patch master --stdout
[no-output]
git format-patch master --stdout > /tmp/nio.patch
[no-output]
I don't know what is wrong, i have git version 1.7.10.4 on debian wheezy.
i miss subversion so badly...
Thank you.
On Tue, Aug 5, 2014 at 1:26 PM, Daniel-Constantin Mierla
Can you do a commit on your local git clone and send the patch? It
- git add -- to add new files
- git commit -- to commit changes
- git format-patch -- to get the commit in a file
Cheers,
Daniel
Post by Muhammad Shahzad
Done all changes as you suggested.
1. The code is embedded in corex module. Two new files added
named, corex_nio.h and corex_nio.c. Some minor changes to
corex_mod.c to call the methods defined in corex_nio.h.
2. Event route name changed to event_route[network:msg].
3. function name changed from is_msg_obfuscated to is_incoming.
4. one additional module parameter is added, named
network_io_intercept, to enable disable the whole functionality.
(default is disabled)
5. The README file and doc folder is updated with relevant
documentation, examples and use cases etc.
The code is available for review and download at,
http://webrtc.voip-demos.com/corex.tbz2
Regarding the actual encryption / compression etc., i am planning
to add some example PERL / LUA scripts later on.
Thank you.
On Mon, Aug 4, 2014 at 8:19 PM, Muhammad Shahzad
Thank you for your valuable suggestions, i appreciate it.
I agree about module name, in fact a couple friends have
already sent me email privately suggesting the same. May be
something like "nio_intercept" would be better, since module
only intercepts the network in/output and leaves it to script
writer what to do with it.
Regarding embedding in corex, that is interesting, however i
need to go through its code to understand it a bit and then
attempt to embed it. Later on, i will create separate module
which import this functionality from corex and do specific
tasks such as compression and faking http etc.
There is a good progress on doubango SDK side as well and at
least idoubs would be ready soon (7 to 10 days approx). Then
mobile voip developers can fully test this functionality at
both ends.
Anyways let me look at corex module and see if and how can i
embed this. In the meantime more suggestions and comments on
this are warmly welcome from everyone.
Thank you.
On Mon, Aug 4, 2014 at 7:55 PM, Daniel-Constantin Mierla
Hello,
I looked at the code and my conclusion was that the name
is a bit confusing.
While indeed you can do obfuscation using some embedded
language or other meanings from the config file, the
module itself doesn't do anything related. It executes an
event route for network packet in/out.
Such functionaly is of course useful, just to remind the
given example with obfuscation. But I think a better name
to reflect the behaviour should be given.
Maybe obfuscate should be a module that implement some
- simply compressing (gz)
- compressing and encapsulation as body in a http
request/reply
- itv
- either rename the module or embed in another module
(e.g., corex) what was developed for these event route
execution. The event route name should be related to
network reception/transmission (e.g., network:msg). Also
the is_obfuscated_msg() should be something like
is_incoming()
- have a new module obfuscate to implement some algorithm
as proof of concept (e.g., gzip -- i guess plenty of code
from gzcompress module is very useful just to take from
there). Then others may contribute more, as they have new
ideas or from what you listed (http ecapsulation is at
least interesting, considering many allow port 80 and
inspect for http).
Of course, these are my opinions, so the discussion can
go on for deciding on how to proceed.
Cheers,
Daniel
Hi,
As already discussed in detail in following email thread,
The new Kamailio module obfuscate is ready for
testing and can be downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation and usage
scenarios etc.
Adding Kamailio dev team, can you guys review the
code and add this module to Kamailio trunk if
possible? I will be responsible for its maintenance
and bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda
<http://twitter.com/#%21/miconda> -
http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Muhammad Shahzad
2014-08-05 09:55:08 UTC
Permalink
OK, created the patch finally...

http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch

I had to add all file i wanted to include in the commit using "git add",
even the ones that are already included in git repo, e.g. corex.xml and
corex_mod.c.

I will just let you know i hit my head on wall just 17 times to make it
work. :-(

Thank you.
Post by Daniel-Constantin Mierla
git format-patch -1 <sha>
The <sha> in your case appears to be f415b0c . If it is last commit,
git format-patch -1 HEAD
Cheers,
Daniel
These commands do not seem to work for me. Can you please do the patch?
1. adding files work,
git add modules/corex/corex_nio.c modules/corex/corex_nio.h
git status
# On branch master
# (use "git reset HEAD <file>..." to unstage)
#
# new file: modules/corex/corex_nio.c
# new file: modules/corex/corex_nio.h
#
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: modules/corex/README
# modified: modules/corex/corex_mod.c
# modified: modules/corex/doc/corex.xml
# modified: modules/corex/doc/corex_admin.xml
#
2. making commit seems to work,
git commit -m "added support for network io intercept."
[master f415b0c] added support for network io intercept.
2 files changed, 268 insertions(+)
create mode 100644 modules/corex/corex_nio.c
create mode 100644 modules/corex/corex_nio.h
3. git format-patch does not work,
git format-patch
[no-output]
4. Also tried,
git format-patch master --stdout
[no-output]
git format-patch master --stdout > /tmp/nio.patch
[no-output]
I don't know what is wrong, i have git version 1.7.10.4 on debian wheezy.
i miss subversion so badly...
Thank you.
On Tue, Aug 5, 2014 at 1:26 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
Can you do a commit on your local git clone and send the patch? It is
- git add -- to add new files
- git commit -- to commit changes
- git format-patch -- to get the commit in a file
Cheers,
Daniel
Done all changes as you suggested.
1. The code is embedded in corex module. Two new files added named,
corex_nio.h and corex_nio.c. Some minor changes to corex_mod.c to call the
methods defined in corex_nio.h.
2. Event route name changed to event_route[network:msg].
3. function name changed from is_msg_obfuscated to is_incoming.
4. one additional module parameter is added, named
network_io_intercept, to enable disable the whole functionality. (default
is disabled)
5. The README file and doc folder is updated with relevant
documentation, examples and use cases etc.
The code is available for review and download at,
http://webrtc.voip-demos.com/corex.tbz2
Regarding the actual encryption / compression etc., i am planning to
add some example PERL / LUA scripts later on.
Thank you.
Post by Muhammad Shahzad
Thank you for your valuable suggestions, i appreciate it.
I agree about module name, in fact a couple friends have already sent me
email privately suggesting the same. May be something like "nio_intercept"
would be better, since module only intercepts the network in/output and
leaves it to script writer what to do with it.
Regarding embedding in corex, that is interesting, however i need to go
through its code to understand it a bit and then attempt to embed it. Later
on, i will create separate module which import this functionality from
corex and do specific tasks such as compression and faking http etc.
There is a good progress on doubango SDK side as well and at least
idoubs would be ready soon (7 to 10 days approx). Then mobile voip
developers can fully test this functionality at both ends.
Anyways let me look at corex module and see if and how can i embed
this. In the meantime more suggestions and comments on this are warmly
welcome from everyone.
Thank you.
On Mon, Aug 4, 2014 at 7:55 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
Hello,
I looked at the code and my conclusion was that the name is a bit
confusing.
While indeed you can do obfuscation using some embedded language or
other meanings from the config file, the module itself doesn't do anything
related. It executes an event route for network packet in/out.
Such functionaly is of course useful, just to remind the given example
with obfuscation. But I think a better name to reflect the behaviour should
be given.
Maybe obfuscate should be a module that implement some algorithms for
- simply compressing (gz)
- compressing and encapsulation as body in a http request/reply
- itv
- either rename the module or embed in another module (e.g., corex)
what was developed for these event route execution. The event route name
should be related to network reception/transmission (e.g., network:msg).
Also the is_obfuscated_msg() should be something like is_incoming()
- have a new module obfuscate to implement some algorithm as proof of
concept (e.g., gzip -- i guess plenty of code from gzcompress module is
very useful just to take from there). Then others may contribute more, as
they have new ideas or from what you listed (http ecapsulation is at least
interesting, considering many allow port 80 and inspect for http).
Of course, these are my opinions, so the discussion can go on for
deciding on how to proceed.
Cheers,
Daniel
Post by Muhammad Shahzad
Hi,
As already discussed in detail in following email thread,
The new Kamailio module obfuscate is ready for testing and can be
downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation and usage scenarios etc.
Adding Kamailio dev team, can you guys review the code and add this
module to Kamailio trunk if possible? I will be responsible for its
maintenance and bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Daniel-Constantin Mierla
2014-08-05 10:03:22 UTC
Permalink
Post by Muhammad Shahzad
OK, created the patch finally...
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
I will look over it and push it to the repository if everything is ok.
Post by Muhammad Shahzad
I had to add all file i wanted to include in the commit using "git
add", even the ones that are already included in git repo, e.g.
corex.xml and corex_mod.c.
Strange, I never had to do it -- did you clone the git repository from
sip-router.org?
Post by Muhammad Shahzad
I will just let you know i hit my head on wall just 17 times to make
it work. :-(
Hopefully it was facebook wall :-)

Daniel
Post by Muhammad Shahzad
Thank you.
On Tue, Aug 5, 2014 at 2:40 PM, Daniel-Constantin Mierla
git format-patch -1 <sha>
The <sha> in your case appears to be f415b0c . If it is last
git format-patch -1 HEAD
Cheers,
Daniel
Post by Muhammad Shahzad
These commands do not seem to work for me. Can you please do the patch?
1. adding files work,
git add modules/corex/corex_nio.c modules/corex/corex_nio.h
git status
# On branch master
# (use "git reset HEAD <file>..." to unstage)
#
# new file: modules/corex/corex_nio.c
# new file: modules/corex/corex_nio.h
#
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in
working directory)
#
# modified: modules/corex/README
# modified: modules/corex/corex_mod.c
# modified: modules/corex/doc/corex.xml
# modified: modules/corex/doc/corex_admin.xml
#
2. making commit seems to work,
git commit -m "added support for network io intercept."
[master f415b0c] added support for network io intercept.
2 files changed, 268 insertions(+)
create mode 100644 modules/corex/corex_nio.c
create mode 100644 modules/corex/corex_nio.h
3. git format-patch does not work,
git format-patch
[no-output]
4. Also tried,
git format-patch master --stdout
[no-output]
git format-patch master --stdout > /tmp/nio.patch
[no-output]
I don't know what is wrong, i have git version 1.7.10.4 on debian wheezy.
i miss subversion so badly...
Thank you.
On Tue, Aug 5, 2014 at 1:26 PM, Daniel-Constantin Mierla
Can you do a commit on your local git clone and send the
- git add -- to add new files
- git commit -- to commit changes
- git format-patch -- to get the commit in a file
Cheers,
Daniel
Post by Muhammad Shahzad
Done all changes as you suggested.
1. The code is embedded in corex module. Two new files added
named, corex_nio.h and corex_nio.c. Some minor changes to
corex_mod.c to call the methods defined in corex_nio.h.
2. Event route name changed to event_route[network:msg].
3. function name changed from is_msg_obfuscated to is_incoming.
4. one additional module parameter is added, named
network_io_intercept, to enable disable the whole
functionality. (default is disabled)
5. The README file and doc folder is updated with relevant
documentation, examples and use cases etc.
The code is available for review and download at,
http://webrtc.voip-demos.com/corex.tbz2
Regarding the actual encryption / compression etc., i am
planning to add some example PERL / LUA scripts later on.
Thank you.
On Mon, Aug 4, 2014 at 8:19 PM, Muhammad Shahzad
Thank you for your valuable suggestions, i appreciate it.
I agree about module name, in fact a couple friends have
already sent me email privately suggesting the same. May
be something like "nio_intercept" would be better, since
module only intercepts the network in/output and leaves
it to script writer what to do with it.
Regarding embedding in corex, that is interesting,
however i need to go through its code to understand it a
bit and then attempt to embed it. Later on, i will
create separate module which import this functionality
from corex and do specific tasks such as compression and
faking http etc.
There is a good progress on doubango SDK side as well
and at least idoubs would be ready soon (7 to 10 days
approx). Then mobile voip developers can fully test this
functionality at both ends.
Anyways let me look at corex module and see if and how
can i embed this. In the meantime more suggestions and
comments on this are warmly welcome from everyone.
Thank you.
On Mon, Aug 4, 2014 at 7:55 PM, Daniel-Constantin Mierla
Hello,
I looked at the code and my conclusion was that the
name is a bit confusing.
While indeed you can do obfuscation using some
embedded language or other meanings from the config
file, the module itself doesn't do anything related.
It executes an event route for network packet in/out.
Such functionaly is of course useful, just to remind
the given example with obfuscation. But I think a
better name to reflect the behaviour should be given.
Maybe obfuscate should be a module that implement
- simply compressing (gz)
- compressing and encapsulation as body in a http
request/reply
- itv
- either rename the module or embed in another
module (e.g., corex) what was developed for these
event route execution. The event route name should
be related to network reception/transmission (e.g.,
network:msg). Also the is_obfuscated_msg() should be
something like is_incoming()
- have a new module obfuscate to implement some
algorithm as proof of concept (e.g., gzip -- i guess
plenty of code from gzcompress module is very useful
just to take from there). Then others may contribute
more, as they have new ideas or from what you listed
(http ecapsulation is at least interesting,
considering many allow port 80 and inspect for http).
Of course, these are my opinions, so the discussion
can go on for deciding on how to proceed.
Cheers,
Daniel
Hi,
As already discussed in detail in following
email thread,
The new Kamailio module obfuscate is ready for
testing and can be downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation and
usage scenarios etc.
Adding Kamailio dev team, can you guys review
the code and add this module to Kamailio trunk
if possible? I will be responsible for its
maintenance and bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda
<http://twitter.com/#%21/miconda> -
http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Muhammad Shahzad
2014-08-05 10:06:47 UTC
Permalink
yup, i always download kamailio from official repo mentioned here,

http://www.kamailio.org/wiki/install/devel/git

Thank you.
Post by Muhammad Shahzad
OK, created the patch finally...
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
I will look over it and push it to the repository if everything is ok.
I had to add all file i wanted to include in the commit using "git add",
even the ones that are already included in git repo, e.g. corex.xml and
corex_mod.c.
Strange, I never had to do it -- did you clone the git repository from
sip-router.org?
I will just let you know i hit my head on wall just 17 times to make it
work. :-(
Hopefully it was facebook wall :-)
Daniel
Thank you.
On Tue, Aug 5, 2014 at 2:40 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
git format-patch -1 <sha>
The <sha> in your case appears to be f415b0c . If it is last commit,
git format-patch -1 HEAD
Cheers,
Daniel
These commands do not seem to work for me. Can you please do the patch?
1. adding files work,
git add modules/corex/corex_nio.c modules/corex/corex_nio.h
git status
# On branch master
# (use "git reset HEAD <file>..." to unstage)
#
# new file: modules/corex/corex_nio.c
# new file: modules/corex/corex_nio.h
#
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: modules/corex/README
# modified: modules/corex/corex_mod.c
# modified: modules/corex/doc/corex.xml
# modified: modules/corex/doc/corex_admin.xml
#
2. making commit seems to work,
git commit -m "added support for network io intercept."
[master f415b0c] added support for network io intercept.
2 files changed, 268 insertions(+)
create mode 100644 modules/corex/corex_nio.c
create mode 100644 modules/corex/corex_nio.h
3. git format-patch does not work,
git format-patch
[no-output]
4. Also tried,
git format-patch master --stdout
[no-output]
git format-patch master --stdout > /tmp/nio.patch
[no-output]
I don't know what is wrong, i have git version 1.7.10.4 on debian wheezy.
i miss subversion so badly...
Thank you.
On Tue, Aug 5, 2014 at 1:26 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
Can you do a commit on your local git clone and send the patch? It is
- git add -- to add new files
- git commit -- to commit changes
- git format-patch -- to get the commit in a file
Cheers,
Daniel
Done all changes as you suggested.
1. The code is embedded in corex module. Two new files added named,
corex_nio.h and corex_nio.c. Some minor changes to corex_mod.c to call the
methods defined in corex_nio.h.
2. Event route name changed to event_route[network:msg].
3. function name changed from is_msg_obfuscated to is_incoming.
4. one additional module parameter is added, named
network_io_intercept, to enable disable the whole functionality. (default
is disabled)
5. The README file and doc folder is updated with relevant
documentation, examples and use cases etc.
The code is available for review and download at,
http://webrtc.voip-demos.com/corex.tbz2
Regarding the actual encryption / compression etc., i am planning to
add some example PERL / LUA scripts later on.
Thank you.
Post by Muhammad Shahzad
Thank you for your valuable suggestions, i appreciate it.
I agree about module name, in fact a couple friends have already sent
me email privately suggesting the same. May be something like
"nio_intercept" would be better, since module only intercepts the network
in/output and leaves it to script writer what to do with it.
Regarding embedding in corex, that is interesting, however i need to
go through its code to understand it a bit and then attempt to embed it.
Later on, i will create separate module which import this functionality
from corex and do specific tasks such as compression and faking http etc.
There is a good progress on doubango SDK side as well and at least
idoubs would be ready soon (7 to 10 days approx). Then mobile voip
developers can fully test this functionality at both ends.
Anyways let me look at corex module and see if and how can i embed
this. In the meantime more suggestions and comments on this are warmly
welcome from everyone.
Thank you.
On Mon, Aug 4, 2014 at 7:55 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
Hello,
I looked at the code and my conclusion was that the name is a bit
confusing.
While indeed you can do obfuscation using some embedded language or
other meanings from the config file, the module itself doesn't do anything
related. It executes an event route for network packet in/out.
Such functionaly is of course useful, just to remind the given example
with obfuscation. But I think a better name to reflect the behaviour should
be given.
Maybe obfuscate should be a module that implement some algorithms for
- simply compressing (gz)
- compressing and encapsulation as body in a http request/reply
- itv
- either rename the module or embed in another module (e.g., corex)
what was developed for these event route execution. The event route name
should be related to network reception/transmission (e.g., network:msg).
Also the is_obfuscated_msg() should be something like is_incoming()
- have a new module obfuscate to implement some algorithm as proof of
concept (e.g., gzip -- i guess plenty of code from gzcompress module is
very useful just to take from there). Then others may contribute more, as
they have new ideas or from what you listed (http ecapsulation is at least
interesting, considering many allow port 80 and inspect for http).
Of course, these are my opinions, so the discussion can go on for
deciding on how to proceed.
Cheers,
Daniel
Post by Muhammad Shahzad
Hi,
As already discussed in detail in following email thread,
The new Kamailio module obfuscate is ready for testing and can be
downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation and usage scenarios etc.
Adding Kamailio dev team, can you guys review the code and add this
module to Kamailio trunk if possible? I will be responsible for its
maintenance and bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Daniel-Constantin Mierla
2014-08-08 06:07:57 UTC
Permalink
I see that the code introduces a new variable $raw_msg. It looks like
being message buffer which is returned by $mb, thus redundant.

Cheers,
Daniel
Post by Muhammad Shahzad
yup, i always download kamailio from official repo mentioned here,
http://www.kamailio.org/wiki/install/devel/git
Thank you.
On Tue, Aug 5, 2014 at 3:03 PM, Daniel-Constantin Mierla
Post by Muhammad Shahzad
OK, created the patch finally...
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
I will look over it and push it to the repository if everything is
ok.
Post by Muhammad Shahzad
I had to add all file i wanted to include in the commit using
"git add", even the ones that are already included in git repo,
e.g. corex.xml and corex_mod.c.
Strange, I never had to do it -- did you clone the git repository
from sip-router.org <http://sip-router.org>?
Post by Muhammad Shahzad
I will just let you know i hit my head on wall just 17 times to
make it work. :-(
Hopefully it was facebook wall :-)
Daniel
Post by Muhammad Shahzad
Thank you.
On Tue, Aug 5, 2014 at 2:40 PM, Daniel-Constantin Mierla
git format-patch -1 <sha>
The <sha> in your case appears to be f415b0c . If it is last
git format-patch -1 HEAD
Cheers,
Daniel
Post by Muhammad Shahzad
These commands do not seem to work for me. Can you please do the patch?
1. adding files work,
git add modules/corex/corex_nio.c modules/corex/corex_nio.h
git status
# On branch master
# (use "git reset HEAD <file>..." to unstage)
#
# new file: modules/corex/corex_nio.c
# new file: modules/corex/corex_nio.h
#
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in
working directory)
#
# modified: modules/corex/README
# modified: modules/corex/corex_mod.c
# modified: modules/corex/doc/corex.xml
# modified: modules/corex/doc/corex_admin.xml
#
2. making commit seems to work,
git commit -m "added support for network io intercept."
[master f415b0c] added support for network io intercept.
2 files changed, 268 insertions(+)
create mode 100644 modules/corex/corex_nio.c
create mode 100644 modules/corex/corex_nio.h
3. git format-patch does not work,
git format-patch
[no-output]
4. Also tried,
git format-patch master --stdout
[no-output]
git format-patch master --stdout > /tmp/nio.patch
[no-output]
I don't know what is wrong, i have git version 1.7.10.4 on
debian wheezy.
i miss subversion so badly...
Thank you.
On Tue, Aug 5, 2014 at 1:26 PM, Daniel-Constantin Mierla
Can you do a commit on your local git clone and send the
- git add -- to add new files
- git commit -- to commit changes
- git format-patch -- to get the commit in a file
Cheers,
Daniel
Post by Muhammad Shahzad
Done all changes as you suggested.
1. The code is embedded in corex module. Two new files
added named, corex_nio.h and corex_nio.c. Some minor
changes to corex_mod.c to call the methods defined in
corex_nio.h.
2. Event route name changed to event_route[network:msg].
3. function name changed from is_msg_obfuscated to
is_incoming.
4. one additional module parameter is added, named
network_io_intercept, to enable disable the whole
functionality. (default is disabled)
5. The README file and doc folder is updated with
relevant documentation, examples and use cases etc.
The code is available for review and download at,
http://webrtc.voip-demos.com/corex.tbz2
Regarding the actual encryption / compression etc., i
am planning to add some example PERL / LUA scripts
later on.
Thank you.
On Mon, Aug 4, 2014 at 8:19 PM, Muhammad Shahzad
Thank you for your valuable suggestions, i
appreciate it.
I agree about module name, in fact a couple friends
have already sent me email privately suggesting the
same. May be something like "nio_intercept" would
be better, since module only intercepts the network
in/output and leaves it to script writer what to do
with it.
Regarding embedding in corex, that is interesting,
however i need to go through its code to understand
it a bit and then attempt to embed it. Later on, i
will create separate module which import this
functionality from corex and do specific tasks such
as compression and faking http etc.
There is a good progress on doubango SDK side as
well and at least idoubs would be ready soon (7 to
10 days approx). Then mobile voip developers can
fully test this functionality at both ends.
Anyways let me look at corex module and see if and
how can i embed this. In the meantime more
suggestions and comments on this are warmly welcome
from everyone.
Thank you.
On Mon, Aug 4, 2014 at 7:55 PM, Daniel-Constantin
Hello,
I looked at the code and my conclusion was that
the name is a bit confusing.
While indeed you can do obfuscation using some
embedded language or other meanings from the
config file, the module itself doesn't do
anything related. It executes an event route
for network packet in/out.
Such functionaly is of course useful, just to
remind the given example with obfuscation. But
I think a better name to reflect the behaviour
should be given.
Maybe obfuscate should be a module that
implement some algorithms for obfuscations,
- simply compressing (gz)
- compressing and encapsulation as body in a
http request/reply
- itv
- either rename the module or embed in another
module (e.g., corex) what was developed for
these event route execution. The event route
name should be related to network
reception/transmission (e.g., network:msg).
Also the is_obfuscated_msg() should be
something like is_incoming()
- have a new module obfuscate to implement some
algorithm as proof of concept (e.g., gzip -- i
guess plenty of code from gzcompress module is
very useful just to take from there). Then
others may contribute more, as they have new
ideas or from what you listed (http
ecapsulation is at least interesting,
considering many allow port 80 and inspect for
http).
Of course, these are my opinions, so the
discussion can go on for deciding on how to
proceed.
Cheers,
Daniel
Hi,
As already discussed in detail in following
email thread,
The new Kamailio module obfuscate is ready
for testing and can be downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation
and usage scenarios etc.
Adding Kamailio dev team, can you guys
review the code and add this module to
Kamailio trunk if possible? I will be
responsible for its maintenance and bug
fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda
<http://twitter.com/#%21/miconda> -
http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Muhammad Shahzad
2014-08-08 10:23:56 UTC
Permalink
humm, it is suppose to contain the original message that was feed to
event_route[network:msg], it would be same as $mb till this route changes
the contents of it stores the new contents in $mb, then the $mb and
$raw_msg would contain different contents (original vs modified), this may
be useful in other routes, such as error_route or local_route e.g. for
comparison etc.

Of course, you can remove this variable, since i don't have any concrete
use of it in my mind (other then comparing any changes to message were done
by event_route[network:msg] in other routes).

Thank you.
Post by Daniel-Constantin Mierla
I see that the code introduces a new variable $raw_msg. It looks like
being message buffer which is returned by $mb, thus redundant.
Cheers,
Daniel
yup, i always download kamailio from official repo mentioned here,
http://www.kamailio.org/wiki/install/devel/git
Thank you.
On Tue, Aug 5, 2014 at 3:03 PM, Daniel-Constantin Mierla <
Post by Muhammad Shahzad
OK, created the patch finally...
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
I will look over it and push it to the repository if everything is ok.
I had to add all file i wanted to include in the commit using "git
add", even the ones that are already included in git repo, e.g. corex.xml
and corex_mod.c.
Strange, I never had to do it -- did you clone the git repository from
sip-router.org?
I will just let you know i hit my head on wall just 17 times to make it
work. :-(
Hopefully it was facebook wall :-)
Daniel
Thank you.
On Tue, Aug 5, 2014 at 2:40 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
git format-patch -1 <sha>
The <sha> in your case appears to be f415b0c . If it is last commit,
git format-patch -1 HEAD
Cheers,
Daniel
These commands do not seem to work for me. Can you please do the patch?
1. adding files work,
git add modules/corex/corex_nio.c modules/corex/corex_nio.h
git status
# On branch master
# (use "git reset HEAD <file>..." to unstage)
#
# new file: modules/corex/corex_nio.c
# new file: modules/corex/corex_nio.h
#
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: modules/corex/README
# modified: modules/corex/corex_mod.c
# modified: modules/corex/doc/corex.xml
# modified: modules/corex/doc/corex_admin.xml
#
2. making commit seems to work,
git commit -m "added support for network io intercept."
[master f415b0c] added support for network io intercept.
2 files changed, 268 insertions(+)
create mode 100644 modules/corex/corex_nio.c
create mode 100644 modules/corex/corex_nio.h
3. git format-patch does not work,
git format-patch
[no-output]
4. Also tried,
git format-patch master --stdout
[no-output]
git format-patch master --stdout > /tmp/nio.patch
[no-output]
I don't know what is wrong, i have git version 1.7.10.4 on debian wheezy.
i miss subversion so badly...
Thank you.
On Tue, Aug 5, 2014 at 1:26 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
Can you do a commit on your local git clone and send the patch? It is
- git add -- to add new files
- git commit -- to commit changes
- git format-patch -- to get the commit in a file
Cheers,
Daniel
Done all changes as you suggested.
1. The code is embedded in corex module. Two new files added named,
corex_nio.h and corex_nio.c. Some minor changes to corex_mod.c to call the
methods defined in corex_nio.h.
2. Event route name changed to event_route[network:msg].
3. function name changed from is_msg_obfuscated to is_incoming.
4. one additional module parameter is added, named
network_io_intercept, to enable disable the whole functionality. (default
is disabled)
5. The README file and doc folder is updated with relevant
documentation, examples and use cases etc.
The code is available for review and download at,
http://webrtc.voip-demos.com/corex.tbz2
Regarding the actual encryption / compression etc., i am planning to
add some example PERL / LUA scripts later on.
Thank you.
Post by Muhammad Shahzad
Thank you for your valuable suggestions, i appreciate it.
I agree about module name, in fact a couple friends have already sent
me email privately suggesting the same. May be something like
"nio_intercept" would be better, since module only intercepts the network
in/output and leaves it to script writer what to do with it.
Regarding embedding in corex, that is interesting, however i need to
go through its code to understand it a bit and then attempt to embed it.
Later on, i will create separate module which import this functionality
from corex and do specific tasks such as compression and faking http etc.
There is a good progress on doubango SDK side as well and at least
idoubs would be ready soon (7 to 10 days approx). Then mobile voip
developers can fully test this functionality at both ends.
Anyways let me look at corex module and see if and how can i embed
this. In the meantime more suggestions and comments on this are warmly
welcome from everyone.
Thank you.
On Mon, Aug 4, 2014 at 7:55 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
Hello,
I looked at the code and my conclusion was that the name is a bit
confusing.
While indeed you can do obfuscation using some embedded language or
other meanings from the config file, the module itself doesn't do anything
related. It executes an event route for network packet in/out.
Such functionaly is of course useful, just to remind the given
example with obfuscation. But I think a better name to reflect the
behaviour should be given.
Maybe obfuscate should be a module that implement some algorithms for
- simply compressing (gz)
- compressing and encapsulation as body in a http request/reply
- itv
- either rename the module or embed in another module (e.g., corex)
what was developed for these event route execution. The event route name
should be related to network reception/transmission (e.g., network:msg).
Also the is_obfuscated_msg() should be something like is_incoming()
- have a new module obfuscate to implement some algorithm as proof of
concept (e.g., gzip -- i guess plenty of code from gzcompress module is
very useful just to take from there). Then others may contribute more, as
they have new ideas or from what you listed (http ecapsulation is at least
interesting, considering many allow port 80 and inspect for http).
Of course, these are my opinions, so the discussion can go on for
deciding on how to proceed.
Cheers,
Daniel
Post by Muhammad Shahzad
Hi,
As already discussed in detail in following email thread,
The new Kamailio module obfuscate is ready for testing and can be
downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation and usage scenarios etc.
Adding Kamailio dev team, can you guys review the code and add this
module to Kamailio trunk if possible? I will be responsible for its
maintenance and bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Daniel-Constantin Mierla
2014-08-08 11:31:44 UTC
Permalink
Here is the new function you added:

+int pv_get_raw_msg(sip_msg_t *msg, pv_param_t *param,
+ pv_value_t *res)
+{
+ str sb;
+ if(msg==NULL || res==NULL)
+ return -1;
+ sb.s = msg->buf;
+ sb.len = msg->len;
+ return pv_get_strval(msg, param, res, &sb);
+}

And next is the existing function for $mb:

int pv_get_msg_buf(struct sip_msg *msg, pv_param_t *param,
pv_value_t *res)
{
str s;
if(msg==NULL)
return -1;

s.s = msg->buf;
s.len = msg->len;
return pv_get_strval(msg, param, res, &s);
}

They are the same apart of variables, so no matter where they will be
used (before or after event route processing), they point to the same
buffer, therefore they will return the same.

Cheers,
Daniel
Post by Muhammad Shahzad
humm, it is suppose to contain the original message that was feed to
event_route[network:msg], it would be same as $mb till this route
changes the contents of it stores the new contents in $mb, then the
$mb and $raw_msg would contain different contents (original vs
modified), this may be useful in other routes, such as error_route or
local_route e.g. for comparison etc.
Of course, you can remove this variable, since i don't have any
concrete use of it in my mind (other then comparing any changes to
message were done by event_route[network:msg] in other routes).
Thank you.
On Fri, Aug 8, 2014 at 11:07 AM, Daniel-Constantin Mierla
I see that the code introduces a new variable $raw_msg. It looks
like being message buffer which is returned by $mb, thus redundant.
Cheers,
Daniel
Post by Muhammad Shahzad
yup, i always download kamailio from official repo mentioned here,
http://www.kamailio.org/wiki/install/devel/git
Thank you.
On Tue, Aug 5, 2014 at 3:03 PM, Daniel-Constantin Mierla
Post by Muhammad Shahzad
OK, created the patch finally...
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
I will look over it and push it to the repository if
everything is ok.
Post by Muhammad Shahzad
I had to add all file i wanted to include in the commit
using "git add", even the ones that are already included in
git repo, e.g. corex.xml and corex_mod.c.
Strange, I never had to do it -- did you clone the git
repository from sip-router.org <http://sip-router.org>?
Post by Muhammad Shahzad
I will just let you know i hit my head on wall just 17 times
to make it work. :-(
Hopefully it was facebook wall :-)
Daniel
Post by Muhammad Shahzad
Thank you.
On Tue, Aug 5, 2014 at 2:40 PM, Daniel-Constantin Mierla
git format-patch -1 <sha>
The <sha> in your case appears to be f415b0c . If it is
git format-patch -1 HEAD
Cheers,
Daniel
Post by Muhammad Shahzad
These commands do not seem to work for me. Can you
please do the patch?
1. adding files work,
git add modules/corex/corex_nio.c modules/corex/corex_nio.h
git status
# On branch master
# (use "git reset HEAD <file>..." to unstage)
#
# new file: modules/corex/corex_nio.c
# new file: modules/corex/corex_nio.h
#
# (use "git add <file>..." to update what will be
committed)
# (use "git checkout -- <file>..." to discard changes
in working directory)
#
# modified: modules/corex/README
# modified: modules/corex/corex_mod.c
# modified: modules/corex/doc/corex.xml
# modified: modules/corex/doc/corex_admin.xml
#
2. making commit seems to work,
git commit -m "added support for network io intercept."
[master f415b0c] added support for network io intercept.
2 files changed, 268 insertions(+)
create mode 100644 modules/corex/corex_nio.c
create mode 100644 modules/corex/corex_nio.h
3. git format-patch does not work,
git format-patch
[no-output]
4. Also tried,
git format-patch master --stdout
[no-output]
git format-patch master --stdout > /tmp/nio.patch
[no-output]
I don't know what is wrong, i have git version 1.7.10.4
on debian wheezy.
i miss subversion so badly...
Thank you.
On Tue, Aug 5, 2014 at 1:26 PM, Daniel-Constantin
Can you do a commit on your local git clone and
send the patch? It is easier to review the changes.
- git add -- to add new files
- git commit -- to commit changes
- git format-patch -- to get the commit in a file
Cheers,
Daniel
Post by Muhammad Shahzad
Done all changes as you suggested.
1. The code is embedded in corex module. Two new
files added named, corex_nio.h and corex_nio.c.
Some minor changes to corex_mod.c to call the
methods defined in corex_nio.h.
2. Event route name changed to
event_route[network:msg].
3. function name changed from is_msg_obfuscated to
is_incoming.
4. one additional module parameter is added, named
network_io_intercept, to enable disable the whole
functionality. (default is disabled)
5. The README file and doc folder is updated with
relevant documentation, examples and use cases etc.
The code is available for review and download at,
http://webrtc.voip-demos.com/corex.tbz2
Regarding the actual encryption / compression
etc., i am planning to add some example PERL / LUA
scripts later on.
Thank you.
On Mon, Aug 4, 2014 at 8:19 PM, Muhammad Shahzad
Thank you for your valuable suggestions, i
appreciate it.
I agree about module name, in fact a couple
friends have already sent me email privately
suggesting the same. May be something like
"nio_intercept" would be better, since module
only intercepts the network in/output and
leaves it to script writer what to do with it.
Regarding embedding in corex, that is
interesting, however i need to go through its
code to understand it a bit and then attempt
to embed it. Later on, i will create separate
module which import this functionality from
corex and do specific tasks such as
compression and faking http etc.
There is a good progress on doubango SDK side
as well and at least idoubs would be ready
soon (7 to 10 days approx). Then mobile voip
developers can fully test this functionality
at both ends.
Anyways let me look at corex module and see if
and how can i embed this. In the meantime more
suggestions and comments on this are warmly
welcome from everyone.
Thank you.
On Mon, Aug 4, 2014 at 7:55 PM,
Hello,
I looked at the code and my conclusion was
that the name is a bit confusing.
While indeed you can do obfuscation using
some embedded language or other meanings
from the config file, the module itself
doesn't do anything related. It executes
an event route for network packet in/out.
Such functionaly is of course useful, just
to remind the given example with
obfuscation. But I think a better name to
reflect the behaviour should be given.
Maybe obfuscate should be a module that
implement some algorithms for
- simply compressing (gz)
- compressing and encapsulation as body in
a http request/reply
- itv
- either rename the module or embed in
another module (e.g., corex) what was
developed for these event route execution.
The event route name should be related to
network reception/transmission (e.g.,
network:msg). Also the is_obfuscated_msg()
should be something like is_incoming()
- have a new module obfuscate to implement
some algorithm as proof of concept (e.g.,
gzip -- i guess plenty of code from
gzcompress module is very useful just to
take from there). Then others may
contribute more, as they have new ideas or
from what you listed (http ecapsulation is
at least interesting, considering many
allow port 80 and inspect for http).
Of course, these are my opinions, so the
discussion can go on for deciding on how
to proceed.
Cheers,
Daniel
Hi,
As already discussed in detail in
following email thread,
The new Kamailio module obfuscate is
ready for testing and can be
downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with
documentation and usage scenarios etc.
Adding Kamailio dev team, can you guys
review the code and add this module to
Kamailio trunk if possible? I will be
responsible for its maintenance and
bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla -
http://www.asipto.com
http://twitter.com/#!/miconda
<http://twitter.com/#%21/miconda> -
http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -
http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 -http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Muhammad Shahzad
2014-08-08 13:08:36 UTC
Permalink
patched updated, as discussed.

http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch

Thank you.
Muhammad Shahzad
2014-08-08 12:10:06 UTC
Permalink
patched updated, as discussed.

http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch

Thank you.
humm, original function must have got lost while moving the code to corex.
Anyways, lets just remove this. I send you new patch. Is there anything
else need to be changed/removed etc.?
Thank you.
On Fri, Aug 8, 2014 at 4:31 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
+int pv_get_raw_msg(sip_msg_t *msg, pv_param_t *param,
+ pv_value_t *res)
+{
+ str sb;
+ if(msg==NULL || res==NULL)
+ return -1;
+ sb.s = msg->buf;
+ sb.len = msg->len;
+ return pv_get_strval(msg, param, res, &sb);
+}
int pv_get_msg_buf(struct sip_msg *msg, pv_param_t *param,
pv_value_t *res)
{
str s;
if(msg==NULL)
return -1;
s.s = msg->buf;
s.len = msg->len;
return pv_get_strval(msg, param, res, &s);
}
They are the same apart of variables, so no matter where they will be
used (before or after event route processing), they point to the same
buffer, therefore they will return the same.
Cheers,
Daniel
humm, it is suppose to contain the original message that was feed to
event_route[network:msg], it would be same as $mb till this route changes
the contents of it stores the new contents in $mb, then the $mb and
$raw_msg would contain different contents (original vs modified), this may
be useful in other routes, such as error_route or local_route e.g. for
comparison etc.
Of course, you can remove this variable, since i don't have any concrete
use of it in my mind (other then comparing any changes to message were done
by event_route[network:msg] in other routes).
Thank you.
On Fri, Aug 8, 2014 at 11:07 AM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
I see that the code introduces a new variable $raw_msg. It looks like
being message buffer which is returned by $mb, thus redundant.
Cheers,
Daniel
yup, i always download kamailio from official repo mentioned here,
http://www.kamailio.org/wiki/install/devel/git
Thank you.
On Tue, Aug 5, 2014 at 3:03 PM, Daniel-Constantin Mierla <
Post by Muhammad Shahzad
OK, created the patch finally...
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
I will look over it and push it to the repository if everything is ok.
I had to add all file i wanted to include in the commit using "git
add", even the ones that are already included in git repo, e.g. corex.xml
and corex_mod.c.
Strange, I never had to do it -- did you clone the git repository from
sip-router.org?
I will just let you know i hit my head on wall just 17 times to make
it work. :-(
Hopefully it was facebook wall :-)
Daniel
Thank you.
On Tue, Aug 5, 2014 at 2:40 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
git format-patch -1 <sha>
The <sha> in your case appears to be f415b0c . If it is last commit,
git format-patch -1 HEAD
Cheers,
Daniel
These commands do not seem to work for me. Can you please do the patch?
1. adding files work,
git add modules/corex/corex_nio.c modules/corex/corex_nio.h
git status
# On branch master
# (use "git reset HEAD <file>..." to unstage)
#
# new file: modules/corex/corex_nio.c
# new file: modules/corex/corex_nio.h
#
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: modules/corex/README
# modified: modules/corex/corex_mod.c
# modified: modules/corex/doc/corex.xml
# modified: modules/corex/doc/corex_admin.xml
#
2. making commit seems to work,
git commit -m "added support for network io intercept."
[master f415b0c] added support for network io intercept.
2 files changed, 268 insertions(+)
create mode 100644 modules/corex/corex_nio.c
create mode 100644 modules/corex/corex_nio.h
3. git format-patch does not work,
git format-patch
[no-output]
4. Also tried,
git format-patch master --stdout
[no-output]
git format-patch master --stdout > /tmp/nio.patch
[no-output]
I don't know what is wrong, i have git version 1.7.10.4 on debian wheezy.
i miss subversion so badly...
Thank you.
On Tue, Aug 5, 2014 at 1:26 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
Can you do a commit on your local git clone and send the patch? It
- git add -- to add new files
- git commit -- to commit changes
- git format-patch -- to get the commit in a file
Cheers,
Daniel
Done all changes as you suggested.
1. The code is embedded in corex module. Two new files added named,
corex_nio.h and corex_nio.c. Some minor changes to corex_mod.c to call the
methods defined in corex_nio.h.
2. Event route name changed to event_route[network:msg].
3. function name changed from is_msg_obfuscated to is_incoming.
4. one additional module parameter is added, named
network_io_intercept, to enable disable the whole functionality. (default
is disabled)
5. The README file and doc folder is updated with relevant
documentation, examples and use cases etc.
The code is available for review and download at,
http://webrtc.voip-demos.com/corex.tbz2
Regarding the actual encryption / compression etc., i am planning
to add some example PERL / LUA scripts later on.
Thank you.
On Mon, Aug 4, 2014 at 8:19 PM, Muhammad Shahzad <
Post by Muhammad Shahzad
Thank you for your valuable suggestions, i appreciate it.
I agree about module name, in fact a couple friends have already
sent me email privately suggesting the same. May be something like
"nio_intercept" would be better, since module only intercepts the network
in/output and leaves it to script writer what to do with it.
Regarding embedding in corex, that is interesting, however i need
to go through its code to understand it a bit and then attempt to embed it.
Later on, i will create separate module which import this functionality
from corex and do specific tasks such as compression and faking http etc.
There is a good progress on doubango SDK side as well and at least
idoubs would be ready soon (7 to 10 days approx). Then mobile voip
developers can fully test this functionality at both ends.
Anyways let me look at corex module and see if and how can i embed
this. In the meantime more suggestions and comments on this are warmly
welcome from everyone.
Thank you.
On Mon, Aug 4, 2014 at 7:55 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
Hello,
I looked at the code and my conclusion was that the name is a bit
confusing.
While indeed you can do obfuscation using some embedded language or
other meanings from the config file, the module itself doesn't do anything
related. It executes an event route for network packet in/out.
Such functionaly is of course useful, just to remind the given
example with obfuscation. But I think a better name to reflect the
behaviour should be given.
Maybe obfuscate should be a module that implement some algorithms
- simply compressing (gz)
- compressing and encapsulation as body in a http request/reply
- itv
- either rename the module or embed in another module (e.g., corex)
what was developed for these event route execution. The event route name
should be related to network reception/transmission (e.g., network:msg).
Also the is_obfuscated_msg() should be something like is_incoming()
- have a new module obfuscate to implement some algorithm as proof
of concept (e.g., gzip -- i guess plenty of code from gzcompress module is
very useful just to take from there). Then others may contribute more, as
they have new ideas or from what you listed (http ecapsulation is at least
interesting, considering many allow port 80 and inspect for http).
Of course, these are my opinions, so the discussion can go on for
deciding on how to proceed.
Cheers,
Daniel
Post by Muhammad Shahzad
Hi,
As already discussed in detail in following email thread,
The new Kamailio module obfuscate is ready for testing and can be
downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation and usage scenarios etc.
Adding Kamailio dev team, can you guys review the code and add
this module to Kamailio trunk if possible? I will be responsible for its
maintenance and bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Muhammad Shahzad
2014-08-08 11:37:25 UTC
Permalink
humm, original function must have got lost while moving the code to corex.
Anyways, lets just remove this. I send you new patch. Is there anything
else need to be changed/removed etc.?

Thank you.
Post by Daniel-Constantin Mierla
+int pv_get_raw_msg(sip_msg_t *msg, pv_param_t *param,
+ pv_value_t *res)
+{
+ str sb;
+ if(msg==NULL || res==NULL)
+ return -1;
+ sb.s = msg->buf;
+ sb.len = msg->len;
+ return pv_get_strval(msg, param, res, &sb);
+}
int pv_get_msg_buf(struct sip_msg *msg, pv_param_t *param,
pv_value_t *res)
{
str s;
if(msg==NULL)
return -1;
s.s = msg->buf;
s.len = msg->len;
return pv_get_strval(msg, param, res, &s);
}
They are the same apart of variables, so no matter where they will be used
(before or after event route processing), they point to the same buffer,
therefore they will return the same.
Cheers,
Daniel
humm, it is suppose to contain the original message that was feed to
event_route[network:msg], it would be same as $mb till this route changes
the contents of it stores the new contents in $mb, then the $mb and
$raw_msg would contain different contents (original vs modified), this may
be useful in other routes, such as error_route or local_route e.g. for
comparison etc.
Of course, you can remove this variable, since i don't have any concrete
use of it in my mind (other then comparing any changes to message were done
by event_route[network:msg] in other routes).
Thank you.
On Fri, Aug 8, 2014 at 11:07 AM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
I see that the code introduces a new variable $raw_msg. It looks like
being message buffer which is returned by $mb, thus redundant.
Cheers,
Daniel
yup, i always download kamailio from official repo mentioned here,
http://www.kamailio.org/wiki/install/devel/git
Thank you.
On Tue, Aug 5, 2014 at 3:03 PM, Daniel-Constantin Mierla <
Post by Muhammad Shahzad
OK, created the patch finally...
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
I will look over it and push it to the repository if everything is ok.
I had to add all file i wanted to include in the commit using "git
add", even the ones that are already included in git repo, e.g. corex.xml
and corex_mod.c.
Strange, I never had to do it -- did you clone the git repository from
sip-router.org?
I will just let you know i hit my head on wall just 17 times to make it
work. :-(
Hopefully it was facebook wall :-)
Daniel
Thank you.
On Tue, Aug 5, 2014 at 2:40 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
git format-patch -1 <sha>
The <sha> in your case appears to be f415b0c . If it is last commit,
git format-patch -1 HEAD
Cheers,
Daniel
These commands do not seem to work for me. Can you please do the patch?
1. adding files work,
git add modules/corex/corex_nio.c modules/corex/corex_nio.h
git status
# On branch master
# (use "git reset HEAD <file>..." to unstage)
#
# new file: modules/corex/corex_nio.c
# new file: modules/corex/corex_nio.h
#
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: modules/corex/README
# modified: modules/corex/corex_mod.c
# modified: modules/corex/doc/corex.xml
# modified: modules/corex/doc/corex_admin.xml
#
2. making commit seems to work,
git commit -m "added support for network io intercept."
[master f415b0c] added support for network io intercept.
2 files changed, 268 insertions(+)
create mode 100644 modules/corex/corex_nio.c
create mode 100644 modules/corex/corex_nio.h
3. git format-patch does not work,
git format-patch
[no-output]
4. Also tried,
git format-patch master --stdout
[no-output]
git format-patch master --stdout > /tmp/nio.patch
[no-output]
I don't know what is wrong, i have git version 1.7.10.4 on debian wheezy.
i miss subversion so badly...
Thank you.
On Tue, Aug 5, 2014 at 1:26 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
Can you do a commit on your local git clone and send the patch? It is
- git add -- to add new files
- git commit -- to commit changes
- git format-patch -- to get the commit in a file
Cheers,
Daniel
Done all changes as you suggested.
1. The code is embedded in corex module. Two new files added named,
corex_nio.h and corex_nio.c. Some minor changes to corex_mod.c to call the
methods defined in corex_nio.h.
2. Event route name changed to event_route[network:msg].
3. function name changed from is_msg_obfuscated to is_incoming.
4. one additional module parameter is added, named
network_io_intercept, to enable disable the whole functionality. (default
is disabled)
5. The README file and doc folder is updated with relevant
documentation, examples and use cases etc.
The code is available for review and download at,
http://webrtc.voip-demos.com/corex.tbz2
Regarding the actual encryption / compression etc., i am planning to
add some example PERL / LUA scripts later on.
Thank you.
On Mon, Aug 4, 2014 at 8:19 PM, Muhammad Shahzad <
Post by Muhammad Shahzad
Thank you for your valuable suggestions, i appreciate it.
I agree about module name, in fact a couple friends have already sent
me email privately suggesting the same. May be something like
"nio_intercept" would be better, since module only intercepts the network
in/output and leaves it to script writer what to do with it.
Regarding embedding in corex, that is interesting, however i need to
go through its code to understand it a bit and then attempt to embed it.
Later on, i will create separate module which import this functionality
from corex and do specific tasks such as compression and faking http etc.
There is a good progress on doubango SDK side as well and at least
idoubs would be ready soon (7 to 10 days approx). Then mobile voip
developers can fully test this functionality at both ends.
Anyways let me look at corex module and see if and how can i embed
this. In the meantime more suggestions and comments on this are warmly
welcome from everyone.
Thank you.
On Mon, Aug 4, 2014 at 7:55 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
Hello,
I looked at the code and my conclusion was that the name is a bit
confusing.
While indeed you can do obfuscation using some embedded language or
other meanings from the config file, the module itself doesn't do anything
related. It executes an event route for network packet in/out.
Such functionaly is of course useful, just to remind the given
example with obfuscation. But I think a better name to reflect the
behaviour should be given.
Maybe obfuscate should be a module that implement some algorithms
- simply compressing (gz)
- compressing and encapsulation as body in a http request/reply
- itv
- either rename the module or embed in another module (e.g., corex)
what was developed for these event route execution. The event route name
should be related to network reception/transmission (e.g., network:msg).
Also the is_obfuscated_msg() should be something like is_incoming()
- have a new module obfuscate to implement some algorithm as proof
of concept (e.g., gzip -- i guess plenty of code from gzcompress module is
very useful just to take from there). Then others may contribute more, as
they have new ideas or from what you listed (http ecapsulation is at least
interesting, considering many allow port 80 and inspect for http).
Of course, these are my opinions, so the discussion can go on for
deciding on how to proceed.
Cheers,
Daniel
Post by Muhammad Shahzad
Hi,
As already discussed in detail in following email thread,
The new Kamailio module obfuscate is ready for testing and can be
downloaded at,
http://webrtc.voip-demos.com/obfuscate.tbz2
It contains full code, with documentation and usage scenarios etc.
Adding Kamailio dev team, can you guys review the code and add this
module to Kamailio trunk if possible? I will be responsible for its
maintenance and bug fixes etc. if any.
Thank you.
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Daniel-Constantin Mierla
2014-08-13 09:52:39 UTC
Permalink
I will get back to it and push it if all ok -- got caught by some other
stuff meanwhile.

Cheers,
Daniel
Post by Muhammad Shahzad
patched updated, as discussed.
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
Thank you.
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Muhammad Shahzad
2014-08-13 13:05:03 UTC
Permalink
OK, no problem.

Thank you.
Post by Daniel-Constantin Mierla
I will get back to it and push it if all ok -- got caught by some other
stuff meanwhile.
Cheers,
Daniel
patched updated, as discussed.
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
Thank you.
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Daniel-Constantin Mierla
2014-08-14 07:21:33 UTC
Permalink
There are variable declared in corex_nio.h and this file is included in
two .c files. That results in separate global variables in both .c files.

You have to declare them in a .c file and in the .h with 'extern'.

Cheers,
Daniel
Post by Muhammad Shahzad
OK, no problem.
Thank you.
On Wed, Aug 13, 2014 at 2:52 PM, Daniel-Constantin Mierla
I will get back to it and push it if all ok -- got caught by some
other stuff meanwhile.
Cheers,
Daniel
Post by Muhammad Shahzad
patched updated, as discussed.
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
Thank you.
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 -http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Muhammad Shahzad
2014-08-14 19:13:47 UTC
Permalink
Sorry for late relay, we have had internet blockage due to mass protests
here.

Anyways, i think the variables are declared static, so there should be only
one copy of them in memory. But anyways let me analyze it in gdb.

Thank you.




On Thu, Aug 14, 2014 at 12:21 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
There are variable declared in corex_nio.h and this file is included in
two .c files. That results in separate global variables in both .c files.
You have to declare them in a .c file and in the .h with 'extern'.
Cheers,
Daniel
OK, no problem.
Thank you.
On Wed, Aug 13, 2014 at 2:52 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
I will get back to it and push it if all ok -- got caught by some other
stuff meanwhile.
Cheers,
Daniel
patched updated, as discussed.
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
Thank you.
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Muhammad Shahzad
2014-08-14 19:15:48 UTC
Permalink
oops, spoke too soon. These are not declared static.

Anyways, let me apply your suggestion.

Thank you.
Post by Muhammad Shahzad
Sorry for late relay, we have had internet blockage due to mass protests
here.
Anyways, i think the variables are declared static, so there should be
only one copy of them in memory. But anyways let me analyze it in gdb.
Thank you.
On Thu, Aug 14, 2014 at 12:21 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
There are variable declared in corex_nio.h and this file is included in
two .c files. That results in separate global variables in both .c files.
You have to declare them in a .c file and in the .h with 'extern'.
Cheers,
Daniel
OK, no problem.
Thank you.
On Wed, Aug 13, 2014 at 2:52 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
I will get back to it and push it if all ok -- got caught by some other
stuff meanwhile.
Cheers,
Daniel
patched updated, as discussed.
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
Thank you.
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Muhammad Shahzad
2014-08-14 19:45:17 UTC
Permalink
Fixed as discussed,

webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch

Thank you.
Post by Muhammad Shahzad
oops, spoke too soon. These are not declared static.
Anyways, let me apply your suggestion.
Thank you.
Post by Muhammad Shahzad
Sorry for late relay, we have had internet blockage due to mass protests
here.
Anyways, i think the variables are declared static, so there should be
only one copy of them in memory. But anyways let me analyze it in gdb.
Thank you.
On Thu, Aug 14, 2014 at 12:21 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
There are variable declared in corex_nio.h and this file is included in
two .c files. That results in separate global variables in both .c files.
You have to declare them in a .c file and in the .h with 'extern'.
Cheers,
Daniel
OK, no problem.
Thank you.
On Wed, Aug 13, 2014 at 2:52 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
I will get back to it and push it if all ok -- got caught by some
other stuff meanwhile.
Cheers,
Daniel
patched updated, as discussed.
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
Thank you.
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Daniel-Constantin Mierla
2014-08-15 11:25:11 UTC
Permalink
OK, I've just pushed the patch to master branch -- thanks for this
contribution.

Cheers,
Daniel
Post by Muhammad Shahzad
Fixed as discussed,
webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch <http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch>
Thank you.
On Fri, Aug 15, 2014 at 12:15 AM, Muhammad Shahzad
oops, spoke too soon. These are not declared static.
Anyways, let me apply your suggestion.
Thank you.
On Fri, Aug 15, 2014 at 12:13 AM, Muhammad Shahzad
Sorry for late relay, we have had internet blockage due to
mass protests here.
Anyways, i think the variables are declared static, so there
should be only one copy of them in memory. But anyways let me
analyze it in gdb.
Thank you.
On Thu, Aug 14, 2014 at 12:21 PM, Daniel-Constantin Mierla
There are variable declared in corex_nio.h and this file
is included in two .c files. That results in separate
global variables in both .c files.
You have to declare them in a .c file and in the .h with
'extern'.
Cheers,
Daniel
Post by Muhammad Shahzad
OK, no problem.
Thank you.
On Wed, Aug 13, 2014 at 2:52 PM, Daniel-Constantin Mierla
I will get back to it and push it if all ok -- got
caught by some other stuff meanwhile.
Cheers,
Daniel
Post by Muhammad Shahzad
patched updated, as discussed.
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
Thank you.
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 -http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 -http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Muhammad Shahzad
2014-08-15 11:46:52 UTC
Permalink
That's great. Again thank you so much for you help and cooperation.

Thank you.
Post by Daniel-Constantin Mierla
OK, I've just pushed the patch to master branch -- thanks for this
contribution.
Cheers,
Daniel
Fixed as discussed,
webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
Thank you.
Post by Muhammad Shahzad
oops, spoke too soon. These are not declared static.
Anyways, let me apply your suggestion.
Thank you.
On Fri, Aug 15, 2014 at 12:13 AM, Muhammad Shahzad <
Post by Muhammad Shahzad
Sorry for late relay, we have had internet blockage due to mass
protests here.
Anyways, i think the variables are declared static, so there should be
only one copy of them in memory. But anyways let me analyze it in gdb.
Thank you.
On Thu, Aug 14, 2014 at 12:21 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
There are variable declared in corex_nio.h and this file is included
in two .c files. That results in separate global variables in both .c files.
You have to declare them in a .c file and in the .h with 'extern'.
Cheers,
Daniel
OK, no problem.
Thank you.
On Wed, Aug 13, 2014 at 2:52 PM, Daniel-Constantin Mierla <
Post by Daniel-Constantin Mierla
I will get back to it and push it if all ok -- got caught by some
other stuff meanwhile.
Cheers,
Daniel
patched updated, as discussed.
http://webrtc.voip-demos.com/0001-added-support-for-network-io-intercept.patch
Thank you.
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
--
Daniel-Constantin Mierlahttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany ::: Oct 15-17, San Francisco, USA
Loading...