Hi,
I was wondering if anyone has used "substr()" function from TEXTOPS in "onreply_route" block. This function works fine in "route" and "branch_route" blocks. However, it creates duplicate fields (instead of substituting) when being used in "onreply_route" blocks.
I need to modify FROM field in "onreply_route" block. As far as I know, "uac_replace_from()" function works only in request_route block, so my only option is to use "substr()".
Thanks,
Alex R
_________________________________________________________________
Proud to be a PC? Show the world. Download the “I’m a PC” Messenger themepack now.
hthttp://clk.atdmt.com/MRT/go/119642558/direct/01/
Something fishy is going on with my routing. If my SIP UA
(91.XXX.XXX.80) hangs up before the receiving end (pstn on
212.YYY.YYY.84) answers, it keeps ringing forever. Below is my routing
in regards to CANCEL and the ngrep output. If I understand things
correctly, I should send a 487 Request Terminated back to the initiating
UA (sip), and I would get a 487 Request Terminated from the pstn provider.
I'm not sending the 487 to the UA, and I'm guessing I close the session
before my pstn provider sends one to me, so I don't see it with ngrep?
The big question is ofcourse what I need to do to get on track, sending
the appropriate 487?
route:
--
#CANCEL processing
if (is_method("CANCEL") || is_method("ACK")) {
if (t_check_trans()) {
setflag(1);
if(!t_relay()) {
sl_reply_error();
}
}
exit;
};
ngrep output, comments starting with #:
--
U 91.XXX.XXX.80:5060 -> 91.ZZZ.ZZZ.9:5060 CANCEL
sip:6--------@91.ZZZ.ZZZ.9 SIP/2.0
Via: SIP/2.0/UDP
91.XXX.XXX.80:5060;branch=z9hG4bK1e22091bbd2d0a9b9e0f8de6553d2c27
From: "349--------"<sip:user1@91.ZZZ.ZZZ.9>;tag=XG6525p2-b915854d-1373157639
To: <sip:6--------@91.ZZZ.ZZZ.9>
Call -ID: 6C8F-F261-374702698-E353C7B05C17-0006(a)91.XXX.XXX.80
CSeq: 10 CANCEL
Max-Forwards: 70
User-Agent: XAVi/XG6525p2-1.6.7
Content-Length: 0
U 91.ZZZ.ZZZ.9:5060 -> 91.XXX.XXX.80:5060 SIP/2.0 200 canceling
Via: SIP/2.0/UDP
91.XXX.XXX.80:5060;branch=z9hG4bK1e22091bbd2d0a9b9e0f8de6553d2c27
From: "349--------"<sip:user1@91.ZZZ.ZZZ.9>;tag=XG6525p2-b915854d-1373157639
To: <sip:6--------@91.ZZZ.ZZZ.9>;tag=bbd8f31c58bc6a3266ec5509a254d55b-cb96
Call-ID: 6C8F-F261-374702698-E353C7B05C17-0006(a)91.XXX.XXX.80
CSeq: 10 CANCEL
Server: Kamailio (1.4.1-notls (i386/linux))
Content-Length: 0
# 487 Request Terminated from 91.ZZZ.ZZZ.9 to 91.XXX.XXX.80 ??
U 91.ZZZ.ZZZ.9:5060 -> 212.YYY.YYY.84:5060 CANCEL
sip:346--------@212.YYY.YYY.84 SIP/2.0
Via: SIP/2.0/UDP 91.ZZZ.ZZZ.9;branch=z9hG4bKe214.208c19e6.0
From: "349--------"<sip:user1@91.ZZZ.ZZZ.9>;tag=XG6525p2-b915854d-1373157639
Call-ID: 6C8F-F261-374702698-E353C7B05C17-0006(a)91.XXX.XXX.80
To: <sip:6--------@91.ZZZ.ZZZ.9>
CSeq: 10 CANCEL
Max-Forwards: 70
User-Agent: Kamailio (1.4.1-notls (i386/linux))
Content-Length: 0
U 212.YYY.YYY.84:5060 -> 91.ZZZ.ZZZ.9:5060 SIP/2.0 200 OK
Via: SIP/2.0/UDP 91.ZZZ.ZZZ.9:5060;branch=z9hG4bKe214.208c19e6.0
To: <sip:6--------@91.ZZZ.ZZZ.9>;tag=a439d513
From: "349--------"
<sip:user1@91.ZZZ.ZZZ.9>;tag=XG6525p2-b915854d-1373157639
Call-ID: 6C8F-F261-374702698-E353C7B05C17-0006(a)91.XXX.XXX.80
CSeq: 10 CANCEL
User-Agent: ENS2.2.122-IS2
Content-Length: 0
# 487 Request Terminated from 212.YYY.YYY.84 to 91.ZZZ.ZZZ.9 ??
Best Regards,
Magnus
Hello,
using the latest development work and the newest
pseudo-variable&transformation framework
(http://lists.kamailio.org/pipermail/users/2008-December/020918.html),
the textops module offers a new class of transformation for regular
expressions.
By now, it implements {re.subst,expression} - ability to do Perl-like
substitution of string value pseudo-variables:
http://www.kamailio.org/dokuwiki/doku.php/transformations:devel#re.subst_ex…
Here is an example to extract username part from R-URI using this
transformation:
$var(user) = $(ru{re.subst,/^sip:(.*)@(.*)/\1/});
Now, the subst operation becomes very handy, old tricks to copy in R-URI
and use subst*() functions from textops module, or copy in avps and use
avpops module are no longer required.
This implementation can be used as example by developers to learn how to
export new transformations from other modules.
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://www.asipto.com
Hello,
the pseudo-variable and transformation framework in core has been
completed for upcoming v1.5.0 of Kamailio (OpenSER). The core has now
only API to register, parse name, evaluate and set values for PV&T.
All specific implementations have moved to PV module:
http://kamailio.org/docs/modules/devel/pv.html
The current architecture provides a flexible way to enhance the number
PV&T available in config file without affecting the stability and the
performance of core and main modules. As this number increased a lot,
and will grow more, the API changed the indexing from a list to a hash
table, offering faster lookup and quicker shorter up time.
With this work done, a new functionality is available for developers:
- they can export new transformations from their module.
As example, check the pv or textops (new transformation to be announced
in separate message) modules. The system is simple, you have to
implement a function to parse the name of transformation and its
parameter, plus a function to evaluate a transformation.
Now core got some clean up, not that fat anymore, implementation of
about 100 pseudo-variables and over 30 transformations was moved out
(couple of thousands lines of code). This work is part of the efforts to
increase the stability, performance and flexibility of the core, so that
specific implementations do not affect typical use cases.
As final note, remember to load the pv module from now on if you work
with/need old core pseudo-variables or transformations.
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://www.asipto.com
Hello,
the devel version (to be released as 1.5.0 in Q1 2009) includes now a
new module: sqlops.
It can be used to do raw sql queries in config file and play with the
result data. Key features:
*
/many DB connections/ - the module can connect to many databases
on different servers using different DB driver modules (mysql,
postgres, ...) at the same time.
*
/many DB results/ - the module can store many results of different
SQL queries in separate structures at the same time. Thus is
possible to work in parallel with several DB results.
*
/access via pseudo-variables/ - the content of SQL query result is
accessible via pseudo-variables.
*
/array indexes/ - fast access to result values via array
possition: [row,column].
*
/persistence in process space/ - a result can be used many times
in same worker process. Query once, use many times.
Here is an example of fetching and printing the content of a table:
...
modparam("sqlops","sqlcon","ca=>mysql://openser:abc@localhost/openser")
...
sql_query("ca", "select * from domain", "ra");
xlog("rows: $dbr(ra=>rows) cols: $dbr(ra=>cols)\n");
if($dbr(ra=>rows)>0)
{
$var(i) = 0;
while($var(i)<$dbr(ra=>cols))
{
xlog("--- SCRIPT: column[$var(i)] = $dbr(ra=>colname[$var(i)])\n");
$var(i) = $var(i) + 1;
}
$var(i) = 0;
while($var(i)<$dbr(ra=>rows))
{
$var(j) = 0;
while($var(j)<$dbr(ra=>cols))
{
xlog("[$var(i),$var(j)] = $dbr(ra=>[$var(i),$var(j)])\n");
$var(j) = $var(j) + 1;
}
$var(i) = $var(i) + 1;
}
}
sql_result_free("ra");
...
Other advantages than the ones listed above against avp_db_query():
- does not mess up fields position if the value in db is null
- use private memory, no locking
- does not iterate through linked (avp) list to get each field, direct
reference to each data structure in result array, thus much faster.
More info at:
http://kamailio.org/docs/modules/devel/sqlops.html
Testing and feedback is appreciated.
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://www.asipto.com
Greger Viken Teigre wrote:
> Hi Frank, the behavior of rtpproxy is like that because you want to send
> rtp back on source port if it has changed from the sdp, which often
> happens
> behind a nat.
> Have you tried changing active media in sdp? The gateway has the same
> active media mode as rtpproxy.
> g-)
I don't believe I understand what you are asking re: active media.
Are you talking about some control I can set in SER or rtpproxy?
Because those are the only knobs available to me. The company
sending the call to us doesn't want to change settings on their
equipment to accomodate what they consider to be our
incompatibility (what rtpproxy is doing), as what they are
doing (not sending audio until they receive audio from us)
isn't a problem when they send calls to other carriers.
If you are suggesting something I have SER patch into the
183/200 SDP payload to trick the calling system to send
audio without waiting to see some audio from us, what exactly
are you suggesting be added and how would that be done?
As a FYI, the PSTN gateway switch behind our SER system has
virtually no SIP controls, as the first thing it does is make
the call look as much like a TDM call as possible, right down
to assigning a pseudo trunk number for the call to be carried
in. Of course, this is the device that is happily sending RTP
audio which rtpproxy is throwing away, so I don't think I can
fix the problem from that side even if there was a knob to
change something since this side is already working.
And yes, you can create this same problem that I am reporting
by having the audio for a call pass between two SER systems
with rtpproxy on both with no NAT present whatsoever (no
re-routing of audio, just bridging isolated networks).
Neither rtpproxy daemon will blink until the other does,
and so audio never works. This has got to be wrong.
I'll point out that when I reported this a month of two ago,
someone on the list came out and said rtpproxy does not do what
I was reporting, can't do this, always passes audio in a
given direction the instant the SDP payload for that direction
passes through SER. I don't find that to be the case and
the demonstration proves that the behavior is different.
I also don't understand the comment above about sending back to
the source port. From what I can see, rtpproxy opens four
separate ports, two on each interface, one for incoming and
one for outgoing on each I would assume. If not, then that
would be a different bug as rtpproxy is opening twice the
number of ports it actually needs. (I think it is using all
four in the two-interface mode.)
Please clarify what you are saying/suggesting if you can.
Examples appreciated. Thanks.
Hi
Is there any way (special module, or something like that) to implement RFC 3323 in Kamailio. Or do I have to do it manually, by changing the header fields that require privacy and change them for something like ("Anonymous" <sip:anonymous@anonymous.invalid>) and keep the relation of this new URI with the original one, in a separate table of my database?. How can I do this in a more easy way?.
David Cespedes
Hi,
I am new to SIP - Kamailio. I am trying to run Kamailion (version
1.4.2 Latest) SIP server with authantication using dbtext module. I
have compiled and installed Kamalio and required modules sucessfully.
When I run the Kamalio after configuration I received error from
"find_mod_export".
----------------------------------------------------------------------------------------------------------------------------------------------------------
"Debug log"
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/db_text.so
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/sl.so
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/tm.so
Dec 5 19:33:42 [24301] DBG:core:register_module: register_pv: tm
Dec 5 19:33:42 [24301] DBG:core:pv_add_extra: extra items list is not
initialized
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/rr.so
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/maxfwd.so
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/usrloc.so
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/registrar.so
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/textops.so
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/mi_fifo.so
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/uri_db.so
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/uri.so
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/xlog.so
Dec 5 19:33:42 [24301] DBG:core:register_module: register_pv: xlog
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/acc.so
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/auth.so
Dec 5 19:33:42 [24301] DBG:core:yyparse: loading module
//lib/kamailio/modules/auth_db.so
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: db_text matches
module db_text
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found <db_mode>
in module db_text [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: mi_fifo matches
module mi_fifo
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<fifo_name> in module mi_fifo [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: rr matches module rr
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<enable_full_lr> in module rr [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: rr matches module rr
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<append_fromtag> in module rr [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: registrar
matches module registrar
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<method_filtering> in module registrar [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: uri_db matches
module uri_db
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<use_uri_table> in module uri_db [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: uri_db matches
module uri_db
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found <db_url>
in module uri_db [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: acc matches module acc
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<early_media> in module acc [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: acc matches module acc
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<report_ack> in module acc [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: acc matches module acc
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<report_cancels> in module acc [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: acc matches module acc
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<detect_direction> in module acc [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: acc matches module acc
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<failed_transaction_flag> in module acc [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: acc matches module acc
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found <log_flag>
in module acc [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: acc matches module acc
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<log_missed_flag> in module acc [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: acc matches module acc
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found <db_flag>
in module acc [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: acc matches module acc
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<db_missed_flag> in module acc [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: usrloc matches
module usrloc
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found <db_mode>
in module usrloc [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: usrloc matches
module usrloc
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found <db_mode>
in module usrloc [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: usrloc matches
module usrloc
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found <db_url>
in module usrloc [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: auth_db matches
module auth_db
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<calculate_ha1> in module auth_db [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: auth_db matches
module auth_db
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found
<password_column> in module auth_db [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: auth_db matches
module auth_db
Dec 5 19:33:42 [24301] DBG:core:set_mod_param_regex: found <db_url>
in module auth_db [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<mf_process_maxfwd_header>(1) in module maxfwd
[//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<sl_send_reply>(2) in module sl [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<has_totag>(0) in module uri [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<loose_route>(0) in module rr [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<is_method>(1) in module textops [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<is_method>(1) in module textops [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<t_check_trans>(0) in module tm [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found <t_relay>(0)
in module tm [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<sl_send_reply>(2) in module sl [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<is_method>(1) in module textops [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<t_check_trans>(0) in module tm [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found <t_relay>(0)
in module tm [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<t_check_trans>(0) in module tm [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<proxy_authorize>(2) in module auth_db [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<proxy_challenge>(2) in module auth [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<check_from>(0) in module uri_db [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<sl_send_reply>(2) in module sl [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<consume_credentials>(0) in module auth [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<is_method>(1) in module textops [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<record_route>(0) in module rr [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<is_method>(1) in module textops [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<append_hf>(1) in module textops [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<is_method>(1) in module textops [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<sl_send_reply>(2) in module sl [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<is_method>(1) in module textops [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<www_authorize>(2) in module auth_db [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<www_challenge>(2) in module auth [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<check_to>(0) in module uri_db [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<sl_send_reply>(2) in module sl [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found <save>(1) in
module registrar [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<sl_reply_error>(0) in module sl [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<sl_send_reply>(2) in module sl [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found <lookup>(1)
in module registrar [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<t_newtran>(0) in module tm [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found <t_reply>(2)
in module tm [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<sl_send_reply>(2) in module sl [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<is_method>(1) in module textops [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<t_on_branch>(1) in module tm [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<t_on_reply>(1) in module tm [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<t_on_failure>(1) in module tm [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found <t_relay>(0)
in module tm [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<sl_reply_error>(0) in module sl [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found <xlog>(1) in
module xlog [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found <xlog>(1) in
module xlog [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:find_cmd_export_t: found
<t_was_cancelled>(0) in module tm [//lib/kamailio/modules/]
Dec 5 19:33:42 [24301] DBG:core:socket2str: <udp:127.0.0.1:5060>
Dec 5 19:33:42 [24301] WARNING:core:fix_socket_list: could not rev.
resolve 192.168.40.35
Dec 5 19:33:42 [24301] DBG:core:socket2str: <udp:192.168.40.35:5060>
Dec 5 19:33:42 [24301] DBG:core:socket2str: <tcp:127.0.0.1:5060>
Dec 5 19:33:42 [24301] WARNING:core:fix_socket_list: could not rev.
resolve 192.168.40.35
Dec 5 19:33:42 [24301] DBG:core:socket2str: <tcp:192.168.40.35:5060>
Listening on
udp: 127.0.0.1 [127.0.0.1]:5060
udp: 192.168.40.35 [192.168.40.35]:5060
tcp: 127.0.0.1 [127.0.0.1]:5060
tcp: 192.168.40.35 [192.168.40.35]:5060
Aliases:
tcp: localhost:5060
udp: localhost:5060
Dec 5 19:33:42 [24301] WARNING:core:main: no fork mode and more than
one listen address found(will use only the first one)
Dec 5 19:33:42 [24301] DBG:core:fm_malloc_init: F_OPTIMIZE=16384, /ROUNDTO=2048
Dec 5 19:33:42 [24301] DBG:core:fm_malloc_init: F_HASH_SIZE=2067,
fm_block size=16560
Dec 5 19:33:42 [24301] DBG:core:fm_malloc_init: params (0xb5fdc000,
33554432), start=0xb5fdc000
Dec 5 19:33:42 [24301] DBG:core:shm_mem_init_mallocs: success
Dec 5 19:33:42 [24301] INFO:core:init_tcp: using epoll_lt as the TCP
io watch method (auto detected)
Dec 5 19:33:42 [24301] DBG:core:set_core_dump: core dump limits set
to 4294967295
Dec 5 19:33:42 [24301] NOTICE:core:main: version: kamailio
1.4.2-notls (i386/linux)
Dec 5 19:33:42 [24301] INFO:core:main: using 32 Mb shared memory
Dec 5 19:33:42 [24301] INFO:core:main: using 1 Mb private memory per process
Dec 5 19:33:42 [24301] DBG:core:add_avp_galias: registering
<serial_branch> for avp id <16725044>
Dec 5 19:33:42 [24301] DBG:core:init_stats_collector: statistics
manager successfully initialized
Dec 5 19:33:42 [24301] DBG:core:init_mod: initializing module db_text
Dec 5 19:33:42 [24301] DBG:core:init_mod: initializing module sl
Dec 5 19:33:42 [24301] INFO:sl:mod_init: Initializing StateLess engine
Dec 5 19:33:42 [24301] DBG:core:MD5StringArray: MD5 calculated:
f8f2ab2c1295e90ed7dbb499b30f44b2
Dec 5 19:33:42 [24301] DBG:core:init_mod: registering stats for sl
Dec 5 19:33:42 [24301] DBG:core:init_mod: initializing module tm
Dec 5 19:33:42 [24301] INFO:tm:mod_init: TM - initializing...
Dec 5 19:33:42 [24301] DBG:tm:init_callid: Call-ID initialization: '35cb5f3b'
Dec 5 19:33:42 [24301] DBG:tm:lock_initialize: lock initialization started
Dec 5 19:33:42 [24301] DBG:core:MD5StringArray: MD5 calculated:
533cb9e91f4b999cf76861cbb9ed54ed
Dec 5 19:33:42 [24301] DBG:core:MD5StringArray: MD5 calculated:
bbd8f31c58bc6a3266ec5509a254d55b
Dec 5 19:33:42 [24301] DBG:core:init_mod: registering stats for tm
Dec 5 19:33:42 [24301] DBG:core:init_mod: register MI for tm
Dec 5 19:33:42 [24301] DBG:core:init_mod: initializing module rr
Dec 5 19:33:42 [24301] DBG:rr:mod_init: rr - initializing
Dec 5 19:33:42 [24301] DBG:core:init_mod: initializing module maxfwd
Dec 5 19:33:42 [24301] INFO:maxfwd:mod_init: initializing...
Dec 5 19:33:42 [24301] DBG:core:init_mod: initializing module usrloc
Dec 5 19:33:42 [24301] DBG:usrloc:mod_init: initializing
Dec 5 19:33:42 [24301] INFO:usrloc:ul_init_locks: locks array size 512
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_bind_api> in
module db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:db_bind_mod: using export interface
to bind db_dbtext
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_use_table> in
module db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_init> in module
db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_close> in module
db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_query> in module
db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_fetch_result> in
module db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_raw_query> in
module db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_free_result> in
module db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_insert> in
module db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_delete> in
module db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_update> in
module db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_replace> in
module db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:find_mod_export:
<db_last_inserted_id> in module db_dbtext not found
Dec 5 19:33:42 [24301] DBG:core:find_mod_export: <db_insert_update>
in module db_dbtext not found
Dec 5 19:33:42 [24301] ERROR:core:db_check_api: module db_dbtext does
not export db_use_table function
Dec 5 19:33:42 [24301] ERROR:usrloc:mod_init: failed to bind database module
Dec 5 19:33:42 [24301] ERROR:core:init_mod: failed to initialize module usrloc
Dec 5 19:33:42 [24301] ERROR:core:main: error while initializing modules
Dec 5 19:33:42 [24301] DBG:xlog:destroy: destroy module...
Dec 5 19:33:42 [24301] DBG:tm:tm_shutdown: tm_shutdown : start
Dec 5 19:33:42 [24301] DBG:tm:unlink_timer_lists: emptying DELETE list
Dec 5 19:33:42 [24301] DBG:tm:tm_shutdown: emptying hash table
Dec 5 19:33:42 [24301] DBG:tm:tm_shutdown: releasing timers
Dec 5 19:33:42 [24301] DBG:tm:tm_shutdown: removing semaphores
Dec 5 19:33:42 [24301] DBG:tm:tm_shutdown: destroying callback lists
Dec 5 19:33:42 [24301] DBG:tm:tm_shutdown: tm_shutdown : done
Dec 5 19:33:42 [24301] DBG:db_text:destroy: destroy ...
Dec 5 19:33:42 [24301] DBG:core:shm_mem_destroy:
Dec 5 19:33:42 [24301] DBG:core:shm_mem_destroy: destroying the
shared memory lock
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
The kamailio.cfg is as given below:
####### Global Parameters #########
debug=3
log_stderror=no
log_facility=LOG_LOCAL0
fork=yes
children=4
/* uncomment the following lines to enable debugging */
debug=6
fork=no
log_stderror=yes
/* uncomment the next line to disable TCP (default on) */
#disable_tcp=yes
/* uncomment the next line to enable the auto temporary blacklisting of
not available destinations (default disabled) */
#disable_dns_blacklist=no
/* uncomment the next line to enable IPv6 lookup after IPv4 dns
lookup failures (default disabled) */
#dns_try_ipv6=yes
/* uncomment the next line to disable the auto discovery of local aliases
based on revers DNS on IPs (default on) */
#auto_aliases=no
/* uncomment the following lines to enable TLS support (default off) */
#disable_tls = no
#listen = tls:your_IP:5061
#tls_verify_server = 1
#tls_verify_client = 1
#tls_require_client_certificate = 0
#tls_method = TLSv1
#tls_certificate = "//etc/kamailio/tls/user/user-cert.pem"
#tls_private_key = "//etc/kamailio/tls/user/user-privkey.pem"
#tls_ca_list = "//etc/kamailio/tls/user/user-calist.pem"
port=5060
/* uncomment and configure the following line if you want Kamailio to
bind on a specific interface/port/proto (default bind on all available) */
#listen=udp:192.168.1.2:5060
####### Modules Section ########
#set module path
mpath="//lib/kamailio/modules/"
/* uncomment next line for MySQL DB support */
#loadmodule "db_mysql.so"
loadmodule "db_text.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"
loadmodule "uri_db.so"
loadmodule "uri.so"
loadmodule "xlog.so"
loadmodule "acc.so"
/* uncomment next lines for MySQL based authentication support
NOTE: a DB (like db_mysql) module must be also loaded */
loadmodule "auth.so"
loadmodule "auth_db.so"
/* uncomment next line for aliases support
NOTE: a DB (like db_mysql) module must be also loaded */
#loadmodule "alias_db.so"
/* uncomment next line for multi-domain support
NOTE: a DB (like db_mysql) module must be also loaded
NOTE: be sure and enable multi-domain support in all used modules
(see "multi-module params" section ) */
#loadmodule "domain.so"
/* uncomment the next two lines for presence server support
NOTE: a DB (like db_mysql) module must be also loaded */
#loadmodule "presence.so"
#loadmodule "presence_xml.so"
# ----------------- setting module-specific parameters ---------------
modparam("db_text", "db_mode", 0)
# ----- mi_fifo params -----
modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
# ----- rr params -----
# add value to ;lr param to cope with most of the UAs
modparam("rr", "enable_full_lr", 1)
# do not append from tag to the RR (no need for this script)
modparam("rr", "append_fromtag", 0)
# ----- rr params -----
modparam("registrar", "method_filtering", 1)
/* uncomment the next line to disable parallel forking via location */
# modparam("registrar", "append_branches", 0)
/* uncomment the next line not to allow more than 10 contacts per AOR */
#modparam("registrar", "max_contacts", 10)
# ----- uri_db params -----
/* by default we disable the DB support in the module as we do not need it
in this configuration */
modparam("uri_db", "use_uri_table", 0)
modparam("uri_db", "db_url", "")
# ----- acc params -----
/* what sepcial events should be accounted ? */
modparam("acc", "early_media", 1)
modparam("acc", "report_ack", 1)
modparam("acc", "report_cancels", 1)
/* by default ww do not adjust the direct of the sequential requests.
if you enable this parameter, be sure the enable "append_fromtag"
in "rr" module */
modparam("acc", "detect_direction", 0)
/* account triggers (flags) */
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "log_flag", 1)
modparam("acc", "log_missed_flag", 2)
/* uncomment the following lines to enable DB accounting also */
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)
# ----- usrloc params -----
modparam("usrloc", "db_mode", 0)
/* uncomment the following lines if you want to enable DB persistency
for location entries */
modparam("usrloc", "db_mode", 2)
modparam("usrloc", "db_url",
"dbtext:///usr/local/etc/kamailio/dbtext")
# ----- auth_db params -----
/* uncomment the following lines if you want to enable the DB based
authentication */
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "db_url",
"dbtext:///usr/local/etc/kamailio/dbtext")
#modparam("auth_db", "load_credentials", "")
# ----- alias_db params -----
/* uncomment the following lines if you want to enable the DB based
aliases */
#modparam("alias_db", "db_url",
# "mysql://openser:openserrw@localhost/openser")
# ----- domain params -----
/* uncomment the following lines to enable multi-domain detection
support */
#modparam("domain", "db_url",
# "mysql://openser:openserrw@localhost/openser")
#modparam("domain", "db_mode", 1) # Use caching
# ----- multi-module params -----
/* uncomment the following line if you want to enable multi-domain support
in the modules (dafault off) */
#modparam("alias_db|auth_db|usrloc|uri_db", "use_domain", 1)
# ----- presence params -----
/* uncomment the following lines if you want to enable presence */
#modparam("presence|presence_xml", "db_url",
# "mysql://openser:openserrw@localhost/openser")
#modparam("presence_xml", "force_active", 1)
#modparam("presence", "server_address", "sip:192.168.1.2:5060")
####### Routing Logic ########
# main request routing logic
route{
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}
if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {
if (is_method("BYE")) {
setflag(1); # do accounting ...
setflag(3); # ... even if the transaction fails
}
route(1);
} else {
/* uncomment the following lines if you want
to enable presence */
##if (is_method("SUBSCRIBE") && $rd ==
"your.server.ip.address") {
## # in-dialog subscribe requests
## route(2);
## exit;
##}
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# non loose-route, but
stateful ACK; must be an ACK after a 487 or e.g. 404 from upstream
server
t_relay();
exit;
} else {
# ACK without matching
transaction ... ignore and discard.\n");
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}
#initial requests
# CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}
t_check_trans();
# authenticate if from local subscriber (uncomment to enable auth)
if (!(method=="REGISTER") && from_uri==myself)
{
if (!proxy_authorize("192.168.20.35", "subscriber")) {
proxy_challenge("192.168.20.35", "0");
exit;
}
if (!check_from()) {
sl_send_reply("403","Forbidden auth ID");
exit;
}
consume_credentials();
# caller authenticated
}
# record routing
if (!is_method("REGISTER|MESSAGE"))
record_route();
# account only INVITEs
if (is_method("INVITE")) {
setflag(1); # do accounting
}
if (!uri==myself)
/* replace with following line if multi-domain support is used */
##if (!is_uri_host_local())
{
append_hf("P-hint: outbound\r\n");
# if you have some interdomain connections via TLS
##if($rd=="tls_domain1.net") {
## t_relay("tls:domain1.net");
## exit;
##} else if($rd=="tls_domain2.net") {
## t_relay("tls:domain2.net");
## exit;
##}
route(1);
}
# requests for my domain
/* uncomment this if you want to enable presence server
and comment the next 'if' block
NOTE: uncomment also the definition of route[2] from below */
##if( is_method("PUBLISH|SUBSCRIBE"))
## route(2);
if (is_method("PUBLISH"))
{
sl_send_reply("503", "Service Unavailable");
exit;
}
if (is_method("REGISTER"))
{
# authenticate the REGISTER requests (uncomment to enable auth)
if (!www_authorize("192.168.20.35", "subscriber"))
{
www_challenge("192.168.20.35", "0");
exit;
}
if (!check_to())
{
sl_send_reply("403","Forbidden auth ID");
exit;
}
if (!save("location"))
sl_reply_error();
exit;
}
if ($rU==NULL) {
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}
# apply DB based aliases (uncomment to enable)
##alias_db_lookup("dbaliases");
if (!lookup("location")) {
switch ($retcode) {
case -1:
case -3:
t_newtran();
t_reply("404", "Not Found");
exit;
case -2:
sl_send_reply("405", "Method Not Allowed");
exit;
}
}
# when routing via usrloc, log the missed calls also
setflag(2);
route(1);
}
route[1] {
# for INVITEs enable some additional helper routes
if (is_method("INVITE")) {
t_on_branch("2");
t_on_reply("2");
t_on_failure("1");
}
if (!t_relay()) {
sl_reply_error();
};
exit;
}
# Presence route
/* uncomment the whole following route for enabling presence
NOTE: do not forget to enable the call of this route from the main
route */
##route[2]
##{
## if (!t_newtran())
## {
## sl_reply_error();
## exit;
## };
##
## if(is_method("PUBLISH"))
## {
## handle_publish();
## t_release();
## }
## else
## if( is_method("SUBSCRIBE"))
## {
## handle_subscribe();
## t_release();
## }
##
## exit;
##}
branch_route[2] {
xlog("new branch at $ru\n");
}
onreply_route[2] {
xlog("incoming reply\n");
}
failure_route[1] {
if (t_was_cancelled()) {
exit;
}
# uncomment the following lines if you want to block client
# redirect based on 3xx replies.
##if (t_check_status("3[0-9][0-9]")) {
##t_reply("404","Not found");
## exit;
##}
# uncomment the following lines if you want to redirect the failed
# calls to a different new destination
##if (t_check_status("486|408")) {
## sethostport("192.168.2.100:5060");
## append_branch();
## # do not set the missed call flag again
## t_relay();
##}
}
------------------------------------------------------------------------------------------------------------------------------------
Any suggestion will be very helpful.
Thanks in advance.
Dhaval
I have motivated the creation of a port of kamailio to OpenBSD, the
port creates binary packages, which can then be added via the pkg_add
command.
I could definitely use input and testing of this port from the
kamailio community, if you are interested in running kamailio on
OpenBSD, I could use your help!
We also needed to create a port of radiusclient to support kamailio.
Both ports are attached to the messages appended below.
Don
Begin forwarded message:
> From: Don Jackson <don.jackson(a)gmail.com>
> Date: November 18, 2008 11:16:22 AM PST
> To: ports(a)openbsd.org
> Subject: NEW: telephony/kamailio-1.4.2 (kamailio used to be called
> OpenSER)
>
>
> Tested on 4.4/amd64, definitely interested in more testing
>
> $ cat DESCR-main
>
> KAMAILIO (OpenSER) is a mature and flexible open source SIP server
> (RFC3261).
> It can be used on systems with limitted resources as well as on
> carrier grade
> servers, scaling to up to thousands call setups per second. It is
> written in
> pure C for Unix/Linux-like systems with architecture specific
> optimizations to
> offer high performances. It is customizable, being able to feature
> as fast load
> balancer; SIP server flavours: registrar, location server, proxy
> server,
> redirect server; gateway to SMS/XMPP; or advanced VoIP application
> server.
>
>
Begin forwarded message:
> From: Don Jackson <don.jackson(a)gmail.com>
> Date: November 18, 2008 11:11:53 AM PST
> To: ports(a)openbsd.org
> Subject: NEW: net/radiusclient-ng-0.5.6
>
>
> This port is needed for the kamailio/openser port (see subsequent
> email)
>
> Tested on 4.4/amd64, definitely interested in more testing.
>
> $ cat pkg/DESCR
>
> Purpose of this project is to build portable, easy-to-use and standard
> compliant library suitable for developing free and commercial software
> that need support for a RADIUS protocol (RFCs 2138 and 2139).
>
>
>
>
Hi,
I am running a rather old version of openser, but since in a production
context, I cannot upgrade anytime I want to catch up with newer releases.
I searched bugs and googled for my problem without any result.
There it is.
I have a module with functions beginning with mn_
mn_received handle any incoming request and prints it out.
my module has a callback on response which prints out responses.
My configuration file is something like
// handle register
mn_received() ;
record_route() ;
if ( method=="INVITE")
{
t_on_failure(ROUTE_INVITE) ;
t_on_reply(ROUTE_INVITE) ;
}
Then the request is t_relayed to destination.
The onreply_route[ROUTE_INVITE] prints some output, and fix_contact on
200, ... whatever.
Then this happens :
- An INVITE is received from A (I see it with mn_received)
- INVITE is relayed to destination B
- B replies 180, I see the response on my module output and I see my
onreply_route[INVITE] statements.
- B replies 200, I see the response on my module output, but, I *do not*
see my reply_route statements.
- A sends ACK for INVITE
- ACK is relayed to B
2 minutes later (fr_inv_timer), the failure_route[INVITE] is triggered !
Since I use failure routes to manage serial forking, this means openser
forward the initial INVITE to the other destination, though first call
was established !
Moreover, first call, which seems ok is CANCELED by the openser (I can
see a 200 answer to a cancel from B)
Openser did not disarm the fr_inv_timer on "200" answer to INVITE ?
Openser did not triggered my onreply_route...
Has someone already experienced this ?
Has someone a clue where it may come from ?
- Sometimes it works ok
- Sometimes, 180 is not "seen" and 200 is ok
- Sometimes 180 is seen but not 200
- Sometimes neither 180, nor 200 are seen
- Headers in 180 and 200 are the same except for content
- I'm running openser-1.2.0 (ouch !)
I'm stuck !
Could this be related to
2008-05-15 10:59 Bogdan-Andrei Iancu, <bogdan at voice-system dot ro>
* [r4191] modules/tm/t_reply.c:
backport from trunk (rev #4190):
- fixed race condition that may lead to deadlock on the transaction
lock. As the reply route (t_on_reply()) stored in transaction may be
changed in reply route br the current process or any other process, to
avoid race conditions, it is better to make a local copy of the reply
route number to be sure it will not be changed.
The deadlock can appear as the reply route number is used in several
conditions to determine id locking is required. But as this value may
be changed (by current or other process), it may lead to multiple
lockings with no unlock -> deadlock.
NOTE: this might happen only if onreply_avp_mode is turned on.
Aurelien