Hello,
the main GIT repository for Kamailio project is now hosted on Github -
the web link to it is:
* https://github.com/kamailio/kamailio
For users (read only access -- ie, you cloned from git.sip-router.org)
should be no change, just be sure that DNS has been updated, because
git.sip-router.org is pointing now to another server which has a
real-time clone of Github repository. To know if DNS was updated on your
side, browse to:
* http://git.sip-router.org
an you must be directed to Gitlist web interface:
* http://git.kamailio.org/gitlist/index.php
If you end up in an url with gitweb on it, DNS is pointing to the old
server.
The listed kamailio and sip-router projects are the same (the second is
a symlink to the first).
Gitweb is also running on the mirror, so the links from the email
notifications of old commits are valid:
* http://git.sip-router.org/gitweb/
Gitweb can be made the main web interface for the mirror, if people like
it more. For now I let Gitlist in order to be easy to detect the DNS update.
Once the DNS is updated, pulling/fetching in an existing clone done from
git.sip-router.org should just work.
For developers, you need to change the remote URL of your local clone to
point to Githup repository. Github provides several access methods
(git/ssh or https) -- as an example of switching the remote URL to
github repository and do the push via https, got you your local clone
directory and do:
git remote set-url origin https://github.com/kamailio/kamailio.git
Check the change with:
git remote -v
You should see:
origin https://github.com/kamailio/kamailio.git (push)
origin https://github.com/kamailio/kamailio.git (fetch)
When you try to push, it should ask you for your github username and
password. For github repository access, see more details at:
- https://help.github.com/articles/which-remote-url-should-i-use/
I sent invitations to some of the developers that I found quickly on
github, but there are still some of them very active that I didn't spot
on github. Send me the github user id to allow you write access.
>From now on all commits must be pushed to github! For fetching/pulling
in an existing clone, wait for a little more or check the DNS update on
your side with the above guidelines - there is already a commit I pushed
there, which is no longer on the old repository (which will be
decommissioned soon, but still can take a bit for the DNS to propagate,
so some of you might end up to it if using git.sip-router.org). New
read-only clones can be done from Github as well.
Hopefully the migrations is going to be smooth for everyone!
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Hi,
We need to build multipart SIP messages with SDP, with rtpengine
involved in the process. We currently use rtpengine_offer() then
msg_apply_changes() to retrieve get the newly generated SDP in $rb and
then build the multipart body. Besides the fact that this is not
optimal, we experience crashes in failure routes[1].
What would help in our case, is if the rtpengine module was able to
return the SDP in a pv rather than in the body. This would eliminate
the need to call msg_apply_changes().
Has someone already needed this behavior? Do you think this could be
useful to integrate in the rtpengine module?
Cheers.
[1] the following sequence:
t_newtran();
rtpengine_offer();
msg_apply_changes();
[adding lumps with set_body(), append_hf()]
t_relay(); # if it fails:
failure_route[] {t_relay();}
causes a crash, and we think this is because the t_relay() in the
failure route tries to apply the lumps computed on the reparsed
message (after msg_apply_changes()), on the old version of it
(saved by t_newtran()), and offsets and sizes don't correspond.
--
Camille
Module: kamailio
Branch: master
Commit: a2b52c52e8a2503c53825b82fb66d7af11b9bc4e
URL: https://github.com/kamailio/kamailio/commit/a2b52c52e8a2503c53825b82fb66d7a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2014-12-15T12:37:42+01:00
dispatcher: proper filling of weights array when summ is less than 100
- more comments on building the array for weight based distribution
---
Modified: modules/dispatcher/dispatch.c
---
Diff: https://github.com/kamailio/kamailio/commit/a2b52c52e8a2503c53825b82fb66d7a…
Patch: https://github.com/kamailio/kamailio/commit/a2b52c52e8a2503c53825b82fb66d7a…
---
diff --git a/modules/dispatcher/dispatch.c b/modules/dispatcher/dispatch.c
index e8da58b..434593a 100644
--- a/modules/dispatcher/dispatch.c
+++ b/modules/dispatcher/dispatch.c
@@ -416,7 +416,10 @@ int add_dest2list(int id, str uri, int flags, int priority, str *attrs,
}
/**
- *
+ * Initialize the weight distribution for a destination set
+ * - build an array of 0..99 where to keep the index of the
+ * destination address to be used. The Nth call will use
+ * the address with the index at possition N%100
*/
int dp_init_weights(ds_set_t *dset)
{
@@ -431,6 +434,11 @@ int dp_init_weights(ds_set_t *dset)
if(dset->dlist[0].attrs.weight==0)
return 0;
+ /* first fill the array based on the weight of each destination
+ * - the weight is the percentage (e.g., if weight=20, the afferent
+ * address gets its index 20 times in the array)
+ * - if the sum of weights is more than 100, the addresses over the
+ * limit are ignored */
t = 0;
for(j=0; j<dset->nr; j++)
{
@@ -442,10 +450,15 @@ int dp_init_weights(ds_set_t *dset)
t++;
}
}
- j = (t-1>=0)?t-1:0;
+ /* if the array was not completely filled (i.e., the sum of weights is
+ * less than 100), then use last address to fill the rest */
for(; t<100; t++)
- dset->wlist[t] = (unsigned int)j;
+ dset->wlist[t] = (unsigned int)(dset->nr-1);
randomize:
+ /* shuffle the content of the array in order to mix the selection
+ * of the addresses (e.g., if first address has weight=20, avoid
+ * sending first 20 calls to it, but ensure that within a 100 calls,
+ * 20 go to first address */
srand(time(0));
for (j=0; j<100; j++)
{
Hello,
a short announcement in advance that today around noon (Berlin time), I
will shift the dns from git.sip-router.org to a read-only mirror of GIT
repository. From that moment, all commits must be pushed directly to
github.com/kamailio.
I will announce when the procedure starts and once is finished.
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Module: sip-router
Branch: master
Commit: 610a93ea038f9eb10ac611263891813b734fc7a0
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=610a93e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Dec 14 14:21:06 2014 +0100
dispatcher: dedicated section for attributes in docs
- file format has it own section too
---
modules/dispatcher/doc/dispatcher_admin.xml | 49 ++++++++++++++++++++------
1 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/modules/dispatcher/doc/dispatcher_admin.xml b/modules/dispatcher/doc/dispatcher_admin.xml
index 43deb72..404bbd2 100644
--- a/modules/dispatcher/doc/dispatcher_admin.xml
+++ b/modules/dispatcher/doc/dispatcher_admin.xml
@@ -1394,21 +1394,45 @@ onreply_route {
</listitem>
<listitem>
<para>attributes: extra fields in form of
- name1=value1;...;nameN=valueN. There are some predefined names:
- <itemizedlist>
- <listitem>
- 'duid' - used for call load dispatching
- </listitem>
- <listitem>
- 'weight' - used for weight based load distribution
- </listitem>
- <listitem>
- 'socket' - used to set the sending socket for the gateway
- </listitem>
- </itemizedlist>
+ name1=value1;...;nameN=valueN.
</para>
</listitem>
</itemizedlist>
+ <section id="dispatcher.ex.attributes">
+ <title>Special Attributes</title>
+ <para>
+ There are some predefined names:
+ <itemizedlist>
+ <listitem>
+ 'duid' - used for call load dispatching. It must be an
+ unique value to identify a destination (gateway address).
+ Practically the load within the group is associated with
+ this value.
+ </listitem>
+ <listitem>
+ 'maxload' - used for call load dispatching. It must be
+ a positive integer, defining the upper limit of active
+ calls per destination. When the limit is reached, then
+ the gateway is no longer selected for new calls until
+ an exiting call via that gateway is terminated. If set
+ to 0, then no active call limit is used.
+ </listitem>
+ <listitem>
+ 'weight' - used for weight based load distribution. It
+ must be set to a positive integer value beteen 0 and
+ 100. The value represents the percent of calls to be
+ sent to that gateways.
+ </listitem>
+ <listitem>
+ 'socket' - used to set the sending socket for the gateway.
+ It is used for sending the SIP traffic as well as
+ OPTIONS keepalives.
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section id="dispatcher.ex.fileforma">
+ <title>File Format</title>
<para>
Line format is:
</para>
@@ -1440,6 +1464,7 @@ setid(int) destination(sip uri) flags(int,opt) priority(int,opt) attrs(str,opt)
</programlisting>
</example>
</section>
+ </section>
<section id="dispatcher.ex.config">
<title>&kamailio; config file</title>
Module: sip-router
Branch: master
Commit: c882b3a70b5afe7cab9d9cc1e2e528af9e735b9d
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=c882b3a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Dec 14 14:21:43 2014 +0100
dispatcher: regenerated README file
---
modules/dispatcher/README | 35 +++++++++++++++++++++++++++++++----
1 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/modules/dispatcher/README b/modules/dispatcher/README
index bfa6d38..23515d8 100644
--- a/modules/dispatcher/README
+++ b/modules/dispatcher/README
@@ -102,6 +102,10 @@ Olle E. Johansson
7. Installation and Running
7.1. Destination List File
+
+ 7.1.1. Special Attributes
+ 7.1.2. File Format
+
7.2. Kamailio config file
8. Event routes
@@ -224,6 +228,10 @@ Chapter 1. Admin Guide
7. Installation and Running
7.1. Destination List File
+
+ 7.1.1. Special Attributes
+ 7.1.2. File Format
+
7.2. Kamailio config file
8. Event routes
@@ -1103,6 +1111,10 @@ kamcmd dispatcher.set_state ip 2 sip:127.0.0.1:5080
7. Installation and Running
7.1. Destination List File
+
+ 7.1.1. Special Attributes
+ 7.1.2. File Format
+
7.2. Kamailio config file
7.1. Destination List File
@@ -1121,10 +1133,25 @@ kamcmd dispatcher.set_state ip 2 sip:127.0.0.1:5080
* priority: sets the priority in destination list (based on it is
done the initial ordering inside the set)
* attributes: extra fields in form of name1=value1;...;nameN=valueN.
- There are some predefined names:
- + 'duid' - used for call load dispatching
- + 'weight' - used for weight based load distribution
- + 'socket' - used to set the sending socket for the gateway
+
+7.1.1. Special Attributes
+
+ There are some predefined names:
+ * 'duid' - used for call load dispatching. It must be an unique value
+ to identify a destination (gateway address). Practically the load
+ within the group is associated with this value.
+ * 'maxload' - used for call load dispatching. It must be a positive
+ integer, defining the upper limit of active calls per destination.
+ When the limit is reached, then the gateway is no longer selected
+ for new calls until an exiting call via that gateway is terminated.
+ If set to 0, then no active call limit is used.
+ * 'weight' - used for weight based load distribution. It must be set
+ to a positive integer value beteen 0 and 100. The value represents
+ the percent of calls to be sent to that gateways.
+ * 'socket' - used to set the sending socket for the gateway. It is
+ used for sending the SIP traffic as well as OPTIONS keepalives.
+
+7.1.2. File Format
Line format is:
...
Hi!
In the source code for dispatcher there is parsing of a predefined attribute called "maxload".
It's not documented and I don't see it used anywhere in the source code. Only in output of
attributes and debug code.
Anyone that knows more? Can we remove this unused attribute or is it planned for future glory?
/O
Module: sip-router
Branch: master
Commit: cbce3372cd48246d62504d6949402e008b96d41c
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cbce337…
Author: Juha Heinanen <jh(a)tutpro.com>
Committer: Juha Heinanen <jh(a)tutpro.com>
Date: Sat Dec 13 03:51:43 2014 +0200
modules/registrar: added 'q' xavp_cfg name
---
modules/registrar/README | 84 +++++++++++++++-------------
modules/registrar/doc/registrar.xml | 5 ++
modules/registrar/doc/registrar_admin.xml | 8 +++
modules/registrar/sip_msg.c | 23 +++++++-
4 files changed, 79 insertions(+), 41 deletions(-)
diff --git a/modules/registrar/README b/modules/registrar/README
index 059a210..5f58359 100644
--- a/modules/registrar/README
+++ b/modules/registrar/README
@@ -8,6 +8,10 @@ Daniel-Constantin Mierla
<miconda(a)gmail.com>
+Juha Heinanen
+
+ <jh(a)tutpro.com>
+
Edited by
Jan Janak
@@ -16,7 +20,7 @@ Edited by
Bogdan-Andre Iancu
- Copyright � 2003 FhG FOKUS
+ Copyright (c) 2003 FhG FOKUS
__________________________________________________________________
Table of Contents
@@ -628,6 +632,8 @@ modparam("registrar", "reg_callid_avp", "$avp(s:avp)")
parameter value.
* socket - the string representing the socket on which the register
rquest was received, as alternative to using the sock_hdr.
+ * q - q value of contact (integer 0-1000). It overrides q value given
+ in contact header and default_q parameter.
For example. if this parameter is set to 'reg', then the number of
maximum contacts can be set in $xavp(reg=>max_contacts).
@@ -754,7 +760,7 @@ modparam("registrar", "flow_timer", 25)
4.7. reg_fetch_contacts(domain, uri, profile)
4.8. reg_free_contacts(profile)
-4.1. save(domain, [, flags [, uri]])
+4.1. save(domain, [, flags [, uri]])
The function processes a REGISTER message. It can add, remove or modify
location records (in usrloc) depending on Contact and Expires HFs in
@@ -799,7 +805,7 @@ save("location", "0x01");
save("location", "0x00", "sip:test@kamailio.org");
...
-4.2. lookup(domain [, uri])
+4.2. lookup(domain [, uri])
The lookup function extracts username and/or domain from Request-URI
and tries to find all contacts for the username in usrloc. If there are
@@ -839,7 +845,7 @@ switch ($retcode) {
};
...
-4.3. lookup_branches(domain)
+4.3. lookup_branches(domain)
The function performs lookup(domain) on r-uri and additional branches
(only branches that have no other attributes set than uri).
@@ -856,7 +862,7 @@ switch ($retcode) {
lookup_branches("location");
...
-4.4. registered(domain [, uri])
+4.4. registered(domain [, uri])
The function returns true if the AOR in the Request-URI is registered,
false otherwise. The function does not modify the message being
@@ -878,7 +884,7 @@ if (registered("location")) {
};
...
-4.5. add_sock_hdr(hdr_name)
+4.5. add_sock_hdr(hdr_name)
Adds a new header to the current REGISTER request with "hdr_name" which
contains the description of the received socket (proto:ip:port)
@@ -895,7 +901,7 @@ if (registered("location")) {
add_sock_hdr("Sock-Info");
...
-4.6. unregister(domain, uri[, ruid])
+4.6. unregister(domain, uri[, ruid])
The function removes contacts associated with 'uri' from the location
database. If 'ruid' is provided a specific contact is removed, if
@@ -922,7 +928,7 @@ unregister("location", "$ru", "$ulc(caller=>ruid)");
unregister("location", "", "$ruid");
...
-4.7. reg_fetch_contacts(domain, uri, profile)
+4.7. reg_fetch_contacts(domain, uri, profile)
The function fetches the contacts for 'uri' from table 'domain' to
pseudo-variable $ulc(profile).
@@ -944,7 +950,7 @@ reg_fetch_contacts("location", "$ru", "callee");
reg_fetch_contacts("location", "sip:user@kamailio.org", "caller");
...
-4.8. reg_free_contacts(profile)
+4.8. reg_free_contacts(profile)
The function frees the contacts from pseudo-variable $ulc(profile).
Should be called to release the content of a profile. Anyhow, fetching
@@ -1087,60 +1093,60 @@ Chapter 2. Frequently Asked Questions
2.1.
- What happend with the old "nat_flag" module parameter?
+ What happend with the old "nat_flag" module parameter?
- In was removed, as the module internally loads this value from the
- "USRLOC" module (see the "nat_bflag" USRLOC parameter).
+ In was removed, as the module internally loads this value from the
+ "USRLOC" module (see the "nat_bflag" USRLOC parameter).
2.2.
- What happend with the old "use_domain" module parameter?
+ What happend with the old "use_domain" module parameter?
- In was removed, as the module internally loads this option from the
- "USRLOC" module. This was done in order to simplify the configuration.
+ In was removed, as the module internally loads this option from the
+ "USRLOC" module. This was done in order to simplify the configuration.
2.3.
- What happened with the old "save_noreply" and "save_memory" functions?
+ What happened with the old "save_noreply" and "save_memory" functions?
- There functions were merged into the new "save(domain,flags)"
- functions. If a reply should be sent or if the DB should be updated
- also is controlled via the flags.
+ There functions were merged into the new "save(domain,flags)"
+ functions. If a reply should be sent or if the DB should be updated
+ also is controlled via the flags.
2.4.
- Where can I find more about Kamailio?
+ Where can I find more about Kamailio?
- Take a look at http://www.kamailio.org/.
+ Take a look at http://www.kamailio.org/.
2.5.
- Where can I post a question about this module?
+ Where can I post a question about this module?
- First at all check if your question was already answered on one of our
- mailing lists:
- * User Mailing List -
- http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
- * Developer Mailing List -
- http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
+ First at all check if your question was already answered on one of our
+ mailing lists:
+ * User Mailing List -
+ http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
+ * Developer Mailing List -
+ http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
- E-mails regarding any stable Kamailio release should be sent to
- <sr-users(a)lists.sip-router.org> and e-mails regarding development
- versions should be sent to <sr-dev(a)lists.sip-router.org>.
+ E-mails regarding any stable Kamailio release should be sent to
+ <sr-users(a)lists.sip-router.org> and e-mails regarding development
+ versions should be sent to <sr-dev(a)lists.sip-router.org>.
- If you want to keep the mail private, send it to
- <sr-users(a)lists.sip-router.org>.
+ If you want to keep the mail private, send it to
+ <sr-users(a)lists.sip-router.org>.
2.6.
- How can I report a bug?
+ How can I report a bug?
- Please follow the guidelines provided at:
- http://sip-router.org/tracker.
+ Please follow the guidelines provided at:
+ http://sip-router.org/tracker.
2.7.
- What happened to the desc_time_order parameter?
+ What happened to the desc_time_order parameter?
- It was removed, as its functionality was migrated into usrloc module,
- were there is a parameter with the same name.
+ It was removed, as its functionality was migrated into usrloc module,
+ were there is a parameter with the same name.
diff --git a/modules/registrar/doc/registrar.xml b/modules/registrar/doc/registrar.xml
index 4328ccf..8e8143c 100644
--- a/modules/registrar/doc/registrar.xml
+++ b/modules/registrar/doc/registrar.xml
@@ -26,6 +26,11 @@
<surname>Mierla</surname>
<email>miconda(a)gmail.com</email>
</author>
+ <author>
+ <firstname>Juha</firstname>
+ <surname>Heinanen</surname>
+ <email>jh(a)tutpro.com</email>
+ </author>
<editor>
<firstname>Jan</firstname>
<surname>Janak</surname>
diff --git a/modules/registrar/doc/registrar_admin.xml b/modules/registrar/doc/registrar_admin.xml
index 5530e15..cabf3c7 100644
--- a/modules/registrar/doc/registrar_admin.xml
+++ b/modules/registrar/doc/registrar_admin.xml
@@ -671,6 +671,14 @@ modparam("registrar", "reg_callid_avp", "$avp(s:avp)")
to using the sock_hdr.
</para>
</listitem>
+ <listitem>
+ <para>
+ <emphasis>q</emphasis> - q value of contact
+ (integer 0-1000). It
+ overrides q value given in contact header and
+ default_q parameter.
+ </para>
+ </listitem>
</itemizedlist>
<para>
For example. if this parameter is set to 'reg', then the number
diff --git a/modules/registrar/sip_msg.c b/modules/registrar/sip_msg.c
index 6ccfd5b..fc5bba1 100644
--- a/modules/registrar/sip_msg.c
+++ b/modules/registrar/sip_msg.c
@@ -283,11 +283,29 @@ void calc_contact_expires(struct sip_msg* _m, param_t* _ep, int* _e)
/*! \brief
* Calculate contact q value as follows:
- * 1) If q parameter exists, use it
- * 2) If the parameter doesn't exist, use the default value
+ * 1) If xavp_cfg q has been defined, use it
+ * 2) If q parameter exists in contact, use it
+ * 3) If the parameter doesn't exist in contact, use the default value
*/
int calc_contact_q(param_t* _q, qvalue_t* _r)
{
+ sr_xavp_t *vavp = NULL;
+ str xqname = str_init("q");
+
+ if (reg_xavp_cfg.s != NULL)
+ vavp = xavp_get_child_with_ival(®_xavp_cfg, &xqname);
+
+ if (vavp != NULL) {
+ if ((vavp->val.v.i >= 0) && (vavp->val.v.i <= 1000)) {
+ *_r = vavp->val.v.i;
+ return 0;
+ } else {
+ rerrno = R_INV_Q; /* Invalid q parameter */
+ LM_ERR("invalid q parameter\n");
+ return -1;
+ }
+ }
+
if (!_q || (_q->body.len == 0)) {
*_r = cfg_get(registrar, registrar_cfg, default_q);
} else {
@@ -297,5 +315,6 @@ int calc_contact_q(param_t* _q, qvalue_t* _r)
return -1;
}
}
+
return 0;
}