22 apr 2013 kl. 19:34 skrev Daniel-Constantin Mierla <miconda(a)gmail.com>om>:
On 4/22/13 5:30 PM, Juha Heinanen wrote:
Andreas Granig writes:
Let me know if this is stupid and/or a complete
overkill, but what about
introducing some kind of dummy mode, where you'd pipe a message into
kamailio via stdin, and get the resulting message out on stdout (e.g. in
ngrep style with ip information as first line, plus the content
following), plus a dump of internals (e.g. vars, avps) on stderr as
they're being assigned, and once the message is processed, kamailio
would just shut down again?
in addition to the message, you would need to be able
to tell which
ip addr it is coming from and which ip/port in kamailio it is going to.
also, on the output side, kamailio would need to tell which
proto/ip/port it would use to send the message out.
Details about going out can be
printed on onsend_route. In this route block, one can execute drop and nothing is sent to
the wire. It can be a config started with a special define specified with -A parameter.
Enabling debugger module with cfg trace should give valuable information about what has
been executed from config.
From what Andreas suggesting, printing the value of variables as they are assigned is
missing, probably can be added by hooking in the interpreter when doing the assignment
operation.
Grouping all above under some global/command line parameter can be useful to make it
easier to do a dry run.
We could steal an idea from ASterisk, where we have a directory that asterisk monitors for
"call files".
We could have a module that monitors a directory for SIP messages and injects them into
the routing
script. The file could have a few lines of metadata, like faking transport and
sender's IP and port,
an empty line and then a full SIP message.
/O