Hello,
Here is a brief git crash course for those who are used to CVS or SVN. The
purpose of this crash course is to get you started, it describes basic
operations that you will need to do simple changes in the sip-router git
repository. You can find links to more documentation at the end.
First of all, you'll need to install git. The name of the corresponding Debian
package is git-core. Debian Lenny contains version 1.5.6.5 which is
sufficient. Newer git versions or packages for other distributions or
architectures can be obtained from http://git-scm.com/.
As the second step you need to configure the git client. I have attached
configuration files to this email for your convenience, save files .gitconfig
and .gitignore in your home directory. File sip-router.org_CA.pem is optional,
you will only need the file if you plan on accessing the repository over https
(that's not the case for developers with write access).
Edit file ~/.gitconfig and configure your name and email address there. This
is the name and email address that will be visible in git commits. Unlike CVS
or SVN commits, git commits contain full name and email address of the
commiter, this is the name and email that will be visible in git history. Note
that the email address to be used in From header of commit logs sent to the
development mailing list is configured separately on the server (there are
technical reasons for this). Here is how I configured my name in email address
in ~/.gitconfig:
[user]
name = Jan Janak
email = jan(a)iptel.org
The git configuration file in your home directory sets up a bunch of short
aliases for most common git commands, so you do not have to type
$ git checkout
every time you are checking out a branch, you can just type 'git co' instead,
and if you alias git to 'g' in your ~/.bashrc then it becomes just 'g co'
which is much more convenient.
Another setting that is particular to our repository is the number of
characters used for tabs in the git pager. Git uses less as the default pager
and less is configured to use 8 spaces for tabs by default. We use 4 spaces in
our sources and thus you might want to re-configure the git pager in your
~/.bashrc. The following setting makes the output of 'git diff' and friends
look prettier:
export GIT_PAGER="less --tabs=4"
Now you can start working with git. The first command that you need to run is
'git clone', this is the command that is used to retrieve the sip-router
repository from the server:
$ git clone ssh://<username>@git.sip-router.org/sip-router
Replace <username> with your real username. The contents of the repository
will be stored in 'sip-router' subdirectory of your current working directory.
This command is the git equivalent of cvs/svn checkout. Like cvs/svn it will
make the most recent version of the sources available in the
subdirectory.
UNLIKE cvs/svn, this command does not retrieve just the latest version of the
sources, it copies the whole history of the project to your local hard drive,
not just the latest revision, but all revisions that are stored in the
repository, since tday 1. You do not have to be worried about the size of
the repository, the full history of SER takes about 40MB only.
Also, you will need to run the command only once (or occassionally if you wipe
your local copy out entirely). There are other git commands (covered later)
that can be used to keep your local copy up-to-date. Those commands can figure
out the difference between your local version of the repository and the
version on the server and they will transfer only the data that has
changed. In other words, 'git clone' is similar to the scp command, it creates
a local identical copy of the remote repository by copying the whole remote
repository to the local machine.
Once you have a local copy of the sip-router repository, you can try to see
what is in there:
$ cd sip-router
$ git branch
The command above shows a list of branches that are present in your local copy
of the repository. Most likely you will see just one branch called 'master'
marked with an asterisk. This means that your local repository contains only
one branch called 'master' and the asterisk tells you that this is the branch
that is currently checked out. So the sources that you see in that directory
come from the master branch. The local master branch is an exact copy of the
'master' branch from the remote repository at git.sip-router.org and it
contains latest sip-router sources.
Typically, the branch with the most up-to-date code is called 'master' in
git. It is the git equivalent of CVS HEAD branch and SVN trunk branch.
NOTE: Branches are sometimes called 'heads' in git documentation, but you can
just remember that 'branch' and 'head' refers to the same thing.
If you look at the remote version of the repository with gitweb at
http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=heads you will
notice that there are more branches than the 'master' branch which was created
by 'git clone' in the local copy of the repository. The command 'git clone'
only makes the master branch directly available in the local copy of the
repository. For other branches it merely records the fact that the branches
exist in the remote repository. To display branches from both the local and
the remote repository you can run:
$ git branch -a
The output should look roughly like this:
* master
origin/HEAD
origin/MAIN
origin/Maintainer
origin/andrei/cvshead
origin/andrei/sctp
origin/andrei/sctp_fixes
origin/andrei/sctp_one_to_one
origin/andrei_sctp
origin/cancel_fix
origin/cvs-head
origin/janakj/cvshead
origin/janakj/doxygen
origin/master
Branches that start with "origin/" are branches that exist in the remote
repository. The string origin is just a short alias for the full URI of the
remote repository, such as ssh://git.sip-router.org/sip-router. It is a
convention that the repository you cloned from initially is called the origin.
Once you have the local repository, you can start making changes in it.
Modifying the code on the master branch directly is really easy, because git
clone already created the master branch for you in local repository and it
checked out the master branch by default. Here is how can you make a simple
change in one file and commit the result:
$ edit main.c
$ git add main.c
$ git commit
As you can see above you need to call 'git add' before you call 'git
commit'. 'git add' marks your changes to be commited during the next commit,
this is useful, for example, if you want to leave some local changes
uncommited while you make the commit. Unlike CVS or SVN, git does not assume
that all local changes should be commited during the next commit. It lets you
explicitly select a set of changes to be commited. You can avoid the need to
call two commands with 'git commit -a', see the git documentation for more
details.
When you are done with the commit, you can display the list of changes in the
repository with 'git log'. The command displays the history of changes in the
whole repository, if you want to limit the list to main.c only then you can
run 'git log main.c'.
If you look closely at the output of 'git log' then you will notice strange
lines starting with "commit" followed by a long string of characters:
commit 0253726f99ac151f748712a5d39d71f42d9defc6
The long string is how commits in git are represented. This string is a SHA1
checksum of the commit and it is the git equivalent SVN revision numbers. Like
SVN revision numbers and UNLIKE CVS versions, this identifier represents the
state of the whole repository, not just individual files. Because such long
identifier are tedious to type, git supports abbreviated format, you can type
just the beginning of the string as long as the beginning of the string is
unique. In other words, there must be at most one commit in the database of all
commits with this prefix. For example the following two commands refer to the
same commit:
$ git diff b0f6ec8784712e4c1436fc9a4a3b54296e94ba5c
$ git diff b0f6e
If somebody creates another commit with an SHA1 id starting with b0f6e later
then 'git diff b0f6e' would not longer work and git would complain that the
prefix is ambiguous.
All changes, such as the commit above, that you do affect the local repository
only. There is absolutely no communication with the the remote repository in
any of the commands above (git add, git commit, git log). This is possible
because we created a full copy of the remote repository with 'git clone'. This
is also the reason why all the commands are so fast, unlike their equivalents
in CVS or SVN.
The fact that you perform all actions/modifications on the local repository
only and then you instruct git to do its black magic and synchronize your
local changes with the remote repository is probably the biggest difference
from CVS/SVN and one of the things that is hard to understand for people who
are used to CVS/SVN. This is also why git falls into the category of
distributed revision control systems.
When you are satisfied with your local changes/commits, you can decide to make
them available to others. This can be done by uploading your local changes to
the remote repository (the one you initially cloned from). In git terminology
this operation is called 'push', so you can push your local changes to the
remote repository with 'git push':
$ git push origin master:master
The first parameter is the name of the remote repository, the second parameter
is the name of the local branch and the name of the remote branch, delimited
by ':'. You can omit the 2nd parameter:
$ git push origin
and then 'git push' will upload all local branches to the remote
repository. You can also omit the first parameter:
$ git push
and in that case repository 'origin' is used.
The opposite of 'git push' is 'git pull'. This is the operation that you can
use to synchronize your local repository with the remote repository. 'git
pull' downloads all changes (made by others) from the remote repository that
are not yet in your local repository and integrates them into your local
repository. You can run 'git pull' whenever you are online to fetch latest
changes and keep your local copy of the repository up-to-date.
'git push' and 'git pull' are similar to rsync, they update either the local
or the remote copy of the repository by tranferring only what is missing. 'git
push' is the git equivalent of 'cvs ci' and 'svn ci'. 'git pull' is the git
equivalent of 'cvs update' or 'svn update'.
If you make only small changes to the repository then you can modify the
master branch directly, as described above. This approach is suitable only for
small, trivial changes. If are working on a change which takes longer to
implement, consists of many commits, then it is better to create a separate
branch and do the development on a separate branch. Branches in git are cheap,
remember that all operations, including branch creation, are local
operations. You do not even have to push your local branches into the remote
repository, you can just keep them in the local copy for your own
purposes. You can create a new branch in your local repository with 'git checkout':
$ git checkout --track -b mybranch master
This command creates a new branch called 'mybranch', configures the branch to
track the master branch and checks the new branch out. The word 'track' in
this context means that the newly created branch will receive all updates from
the master branch whenever you run 'git pull' with this branch checked out. In
other words, the branch tracks another branch (master in this case) by merging
all changes from the original branch. Command line option -b instructs git to
to create a new branch. If this option was omitted then git would assume that
'mybranch' is an existing branch and it would try to check the branch out.
The newly created branch exists in the local repository only. If you want to
push the branch to the remote repository then you can use 'git push' again:
$ git push origin mybranch:janakj/mybranch
Because mybranch is a private topic branch of mine, I am pushing it as
janakj/mybranch to the remote repository at git.sip-router.org. The remote
repository only permits new "username" branches. In other words their name
must start with your username. If you try:
$ git push origin mybranch:mybranch
then git will report an error. The main reason why we have this restriction in
place is because we wanted to make sure that people do not push all local
branches to the remote repository by accident. This can easily happen if you
run 'git push' without any parameters.
You can also delete a local branch that is no longer needed by running
$ git branch -D mybranch
This will delete the local branch only. If you pushed the branch to the remote
repository then you might also want to delete the branch in the remote
repository with 'git push':
$ git push :janakj/mybranch
This is a special syntax of 'git push', if you omit the name of the local
branch then 'git push' deletes the remote branch whose name follows ':'.
Test Repository
===============
We have a test repository at git.sip-router.org which you can use to test
various git operations. Clone the repository with:
$ git clone ssh://username@git.sip-router.org/test
and there you can test whatever you want. The repository can also be browsed
with gitweb at
http://git.sip-router.org/cgi-bin/gitweb.cgi?p=test;a=summary
Further Reading
===============
[1] Git related pages in the wiki: http://sip-router.org/wiki/git
[2] http://eagain.net/articles/git-for-computer-scientists/
[3] Git SVN Crashcourse: http://git.or.cz/course/svn.html
[4] http://git-scm.com/documentation
Hi,
during a review i noticed that it seems that all the functionality in the
modules_s/dbg module is also provided from the modules_k/cfgutils module.
function mapping:
- dbg_msleep(n) -> usleep(n*1000)
- dbg_abort() -> abort()
- dbg_pkg_status() -> pkg_status()
- dbg_shm_status() -> shm_status()
It is ok when i remove this module? If this one additional multiplication is
not ok, i can of course also add a 'm_sleep' function to the cfgutils module
as well.
Regards,
Henning
Hi, trying to create a new subscriber I've realized that I must insert
the ha1 (ha1b doesn't appear) by hand... doesn't SIREMIS implement the
generation of the MD5 values by inserting the text plain password?
Regards.
--
Iñaki Baz Castillo
<ibc(a)aliax.net>
Hi all,
My SER process had crashed today with the following logs
in /var/log/messages :
ser[378]: child process 418 exited by a signal 11
ser[378]: core was generated
ser[378]: INFO: terminating due to SIGCHLD
ser[421]: INFO: signal 15 received
...
Can someone help me to determine what kind of problem is it ? I think I
need to use gdb to extract some information from the core dump. How can
I use it to extract the uses informations ?
Regards,
Adrien
Hello,
I want to introduce SIP Router Development Meeting 2009 planned for
Friday, October 2 in Berlin, Germany. More details about the event at:
http://sip-router.org/2009/09/14/development-meeting-2009/
Shortly, the goal of the meeting is to analyze the evolution so far,
discuss the plans for the future and socialize within the community. The
integration between SER and Kamailio is 99% done (only seas module needs
some work), first major release based on SIP router core is due in about
one month: Kamailio 3.0, today being the date of going into testing phase.
Participation is free for anybody upon registration via email at:
registration(a)lists.sip-router.org
Feel free to submit suggestions for discussion topics, presentations and
event extensions. A hacking session is already proposed, now just show
your interest.
For general questions about the meeting (and/or hacking session), please
address them to: sr-dev(a)lists.sip-router.org
See you in Berlin!
Cheers,
Daniel
--
Daniel-Constantin Mierla
* http://www.asipto.com/
SNMPstats currently lives in modules_k. As we've got an OID for Kamailio.org
it's time to update the module.
1. Change the OID - maybe with a config option if people depend on the
old
2. Change file names on all files starting with "openser". I don't see
why we need a name tag in these file names. Anyone else?
openserObjects.h could very well be snmpObjects.h
3. Update all MIBS so that we don't use the openser namespace or OID.
I would suggest that we change all "openser" tags to "siprouter" to
enable this module to move in to core at some point. Changing MIBs to
have "kamailio" in all names doesn't seem very long term for me.
Any comments?
I can start playing with this and upload patches to the tracker, but
would like some consensus on the road map before I proceed.
/O
Bugs item #2822344, was opened at 2009-07-16 11:06
Message generated for change (Comment added) made by axlh
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=2822344&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: ver 1.4.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Alex Hermann (axlh)
Assigned to: Nobody/Anonymous (nobody)
Summary: Branch route has wrong ruri or missing headers
Initial Comment:
The scenario:
In branch route, I rewrite the ruri and add an additional header. When the destination fails and DNS-based failover takes place, the branch route is called again. For this second branch, the ruri is not the same as the ruri at t_relay time. Also the extra header is missing.
So this bug could be either:
- The ruri and rest of variables/packet for each branch should be the same as the ruri at t_relay time
or
- The header added in the first branch route should also be present for the second branch (in the case of DNS-based failover)
I would either expect the ruri and all other variables and headers to be exactly the same as at t_relay time for each branch, or (for DNS-based failover ONLY) the packet sent to a failover destination to be exactly the same as the first branch (including any added headers / from replacement, etc.) Not a mix of both.
Before t_relay:
$rU = "*1234567890"
t_relay("0x03");
my branch route:
xlog("L_NOTICE", "Branch: <$ru> via <$du>\n");
if (is_method("INVITE") and $(rU{s.substr,0,3}) == "*12") {
strip(3);
append_hf("X-Test: 12\r\n");
}
The log:
Jul 15 09:14:38 Branch: <sip:*1234567890@test.domain;transport=udp> via <<null>>
Jul 15 09:14:38 Reply Status: 503 Service Unavailable
Jul 15 09:14:38 Branch: <sip:234567890@test.domain;transport=udp> via <<null>>
Jul 15 09:14:38 Reply Status: 100 Trying
----------------------------------------------------------------------
>Comment By: Alex Hermann (axlh)
Date: 2009-09-04 17:03
Message:
And when there is no response at all from th destination, resulting in a
local generated 408, the behaviour is even different. Then branch route
isn't called at all, but the packet headed for the failover host is
different from the original as it misses any headers added in the branch
route.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=2822344&group_…
Greetings,
I've run into a bug in Kamailio 1.4.4 where, if using the permissions
module with db_mysql the database becomes unavailable, Kamailio will
crash (SIGSEGV) somewhat arbitrarily after about 30-45 seconds. The
process is a little random; sometimes it can take longer.
At first, I suspected the problem may be with 1.4.x, but got the exact
same effect when trying 1.5.2. I also assumed the problem may be with
db_mysql or even libmysqlclient, but when I remove the permissions
functionality from the configuration the process does not crash. This
is a configuration from the 1.4.x era with a lot of custom DB queries
via avp_db_query() (pre-sqlops); when the database disappears, Kamailio
will complain loudly in the logs, of course, but it will not crash
unless I am calling allow_trusted() as part of the configuration and am
using the permissions module with database backing.
The test system is CentOS 4.7 64-bit, but I've reproduced the problem on
Debian lenny and unstable just as easily with libmysqlclient15.
Here are my steps for producing the bug:
1) Initialise Kamailio (the only modules that use database are
permissions and avpops);
2) Firewall MySQL database off or shut it down;
3) Place a call - even one will do;
4) Kamailio will not crash immediately; it usually takes several
request retransmissions or successive attempts to contact the database
for this to happen, and it can take close to a minute. Eventually,
though, there is a segfault that appears to be bubbling up from
allow_trusted() in the call stack.
Here is the backtrace. IP addresses and phone numbers are sanitised to
protect confidentiality, but have been substituted consistently:
(gdb) where
0 0x00000030eba21b70 in mysql_real_escape_string ()
from /usr/lib64/mysql/libmysqlclient.so.15
1 0x0000002a95be64c1 in db_mysql_val2str (_c=0x686e60, _v=0x7fbfffd900,
_s=0x6331a7 "222.22.222.22'", _len=0x7fbfffd2cc) at val.c:233
0000002 0x00000000004b2f14 in db_print_where (_c=0x686e60,
_b=0x63319f "src_ip='222.22.222.22'", _l=65473, _k=0x7fbfffd440,
_o=0x0,
_v=0x7fbfffd900, _n=1, val2str=0x2a95be62ca <db_mysql_val2str>)
at db/db_ut.c:275
0000003 0x00000000004affb8 in db_do_query (_h=0x686e60, _k=0x7fbfffd440,
_op=0x0,
_v=0x7fbfffd900, _c=Variable "_c" is not available.
) at db/db_query.c:78
0000004 0x0000002a95be2dbf in db_mysql_query (_h=0x0, _k=0x6331a7,
_op=0x2a962492a0, _v=0xe, _c=0x7fbfffd900, _n=6844000, _nc=0, _o=0x0,
_r=0x0) at dbase.c:249
0000005 0x0000002a961428c0 in allow_trusted (msg=0x687038,
src_ip=0x2a962492a0 "222.22.223.23", proto=1) at trusted.c:422
0000006 0x0000002a96143356 in allow_trusted_0 (_msg=0x687038,
str1=Variable "str1" is not available.
)
at ../../parser/../ip_addr.h:398
0000007 0x000000000040d4df in do_action (a=0x6566f8, msg=0x687038) at
action.c:850
0000008 0x000000000040ec2b in run_action_list (a=Variable "a" is not
available.
) at action.c:138
0000009 0x00000000004523dc in eval_expr (e=0x6567c8, msg=0x687038, val=0x0)
at route.c:1116
0000010 0x00000000004527c2 in eval_expr (e=0x656810, msg=0x687038, val=0x0)
at route.c:1429
11 0x0000000000452159 in eval_expr (e=0x656858, msg=0x687038, val=0x0)
at route.c:1434
12 0x000000000040c933 in do_action (a=0x656e70, msg=0x687038) at
action.c:705
13 0x000000000040ec2b in run_action_list (a=Variable "a" is not available.
) at action.c:138
14 0x000000000040e95f in do_action (a=0x657f00, msg=0x687038) at
action.c:728
15 0x000000000040ec2b in run_action_list (a=Variable "a" is not available.
) at action.c:138
16 0x000000000040e95f in do_action (a=0x657fd0, msg=0x687038) at
action.c:728
17 0x000000000040ec2b in run_action_list (a=Variable "a" is not available.
) at action.c:138
18 0x000000000040ef30 in run_top_route (a=0x651008, msg=0x687038)
at action.c:118
---Type <return> to continue, or q <return> to quit---
19 0x00000000004467ef in receive_msg (
buf=0x622ac0 "INVITE
sip:8005551212@123.132.132.7:5060;transport=udp SIP/2.0\r\nRecord-Route:
<sip:222.22.223.23;lr;rpdicor=VPSF506071629460;vsf=AAAAAB0GDgULBQIABgJ3AW4CFhgKGwIbARoJNDg->\r\nRecord-Route:
<sip:90.148.216.254"..., len=922,
rcv_info=0x7fbffff700) at receive.c:165 0000020 0x0000000000480c44
in udp_rcv_loop () at udp_server.c:449 21 0x0000000000422b4f in main
(argc=Variable "argc" is not available. ) at main.c:692
--
Alex Balashov - Principal
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
i made some fixes to lib/srdb1/gw.xml file. how do i regenerate
corresponding tools/kamctl/mysql (and other db) files?
earlier 'make dbschema' did it, but doesn't exit anymore.
-- juha