Hi all,
For a project on which I'm currently working, I am having some problems
figuring out how to correctly configure Kamailio to communicate with RTP
Proxy in order to send media into and out of a network with private IP
address ranges.
I have a proxy set up to send the SIP traffic, and all of this is
working fine. However, I'm having some trouble getting the RTP Proxy
set up. Currently, when the call is connected, the offer/answer is made
and RTP Proxy seems to be taking over, but I'm having trouble getting my
audio to flow in both directions.
Examination of the traffic coming into and out of this machine seems to
indicate that the IP addresses aren't being mangled correctly.
Specifically, it appears the internal IP address isn't being changed to
reflect the IP address of the machine on which RTP Proxy is running, so
that when the caller tries to send audio back, the IP it's given to
reply to is 10.10.x.x, which obviously won't work.
I have tried experimenting with specifically setting IP addresses in the
rtpproxy_offer() and _answer() methods to no avail, as well as setting
various flags in those methods. However, I must admit that I'm not
entirely sure what's happening under the hood with these methods, or
what rtpproxy is doing with that information when it gets it. Rather
than continue to hack at this by trial and error, I'm hoping someone
here can point me in the right direction.
Any advice, example code or pep talks would be greatly appreciated.
Thanks in advance,
--
Joe Hart
Voice Systems Integrator
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0673
Hi,
I'd like to implement a couple of helper functions for time handling,
e.g. checking day of week, day of month etc. from within the kamailio
config file. What would you prefer, a new module ("timeutils" maybe?) or
adding it to cfgutils (there are already time-based functions there like
sleep and usleep)?
The idea is to implement time based call-forwards, and an approach could
be to provision various time-related values in usr_preferences table,
and then check it in the config. For example, when doing call-forwards
from Monday to Friday only, I could put this into usr_preferences:
attribute: cf_weekday
value: [1, 2, 3, 4, 5] (each entry is a separate row in usr_preferences)
And in kamailio config, I'd call this:
avp_db_load(...);
if(is_weekday("$avp(s:cf_weekday)")) { do CF }
So is_weekday would iterate over the entries in the avp list and return
true if the weekday at the time of routing matches an entry in the list.
A module config param could control whether to use gmtime or localtime
for matching.
Does this make sense? Suggestions for other approaches? I'd rather
prefer to do it directly in config instead of using some external
interpreter like lua, python etc.
Andreas
I have 2 servers running Solaris and Kamailio 3.2.3 where on one
Kamailio is terminating when it tries to save the location for a
register request and the other is producing a core dump when processing
an Option request. I have one server handling Register request while the
other sip server forwards the register requests and handles the other
requests. I have included the backtraces from the core dumps and the
output from the log for the registrar server as well as the command that
is causing kamailio to terminate:
if (!save("location"))
sl_reply_error();
4(3364) ERROR: *** cfgtrace:
c=[/opt/kamailio-3.2/etc/kamailio/kamailio.cfg] l=714 a=17 n=if
4(3364) ERROR: *** cfgtrace:
c=[/opt/kamailio-3.2/etc/kamailio/kamailio.cfg] l=711 a=26 n=save
14(3374) : <core> [pass_fd.c:293]: ERROR: receive_fd: EOF on 15
14(3374) DEBUG: <core> [tcp_main.c:3555]: DBG: handle_ser_child: dead
child 4, pid 3364 (shutting down?)
14(3374) DEBUG: <core> [io_wait.h:617]: DBG: io_watch_del (1003743d8,
15, 0, 0x0) fd_no=18 called
0(3360) ALERT: <core> [main.c:751]: child process 3364 exited by a
signal 10
0(3360) ALERT: <core> [main.c:754]: core was not generated
0(3360) INFO: <core> [main.c:766]: INFO: terminating due to SIGCHLD
6(3366) INFO: <core> [main.c:817]: INFO: signal 15 received
1(3361) INFO: <core> [main.c:817]: INFO: signal 15 received
2(3362) INFO: <core> [main.c:817]: INFO: signal 15 received
3(3363) INFO: <core> [main.c:817]: INFO: signal 15 received
5(3365) INFO: <core> [main.c:817]: INFO: signal 15 received
7(3367) INFO: <core> [main.c:817]: INFO: signal 15 received
8(3368) INFO: <core> [main.c:817]: INFO: signal 15 received
9(3369) INFO: <core> [main.c:817]: INFO: signal 15 received
10(3370) INFO: <core> [main.c:817]: INFO: signal 15 received
11(3371) INFO: <core> [main.c:817]: INFO: signal 15 received
12(3372) INFO: <core> [main.c:817]: INFO: signal 15 received
13(3373) INFO: <core> [main.c:817]: INFO: signal 15 received
14(3374) INFO: <core> [main.c:817]: INFO: signal 15 received
0(3360) DEBUG: presence_xml [presence_xml.c:347]: start
0(3360) ERROR: ctl [ctl.c:379]: ERROR: ctl: could not delete unix
socket /tmp/kamailio_ctl: Permission denied (13)
0(3360) DEBUG: <core> [db_pool.c:102]: removing connection from the pool
0(3360) DEBUG: db_postgres [km_pg_con.c:122]: PQfinish(100842470)
0(3360) DEBUG: db_postgres [km_pg_con.c:126]: pkg_free(1004c1f30)
0(3360) DEBUG: tm [t_funcs.c:122]: DEBUG: tm_shutdown : start
0(3360) DEBUG: tm [t_funcs.c:125]: DEBUG: tm_shutdown : emptying hash
table
0(3360) DEBUG: tm [t_funcs.c:127]: DEBUG: tm_shutdown : removing
semaphores
0(3360) DEBUG: tm [t_funcs.c:129]: DEBUG: tm_shutdown : destroying
tmcb lists
0(3360) DEBUG: tm [t_funcs.c:132]: DEBUG: tm_shutdown : done
Thanks
Nathaniel
Hello,
I am trying to implement the following configuration :
- Kamailio as a SIP proxy/registrar behind a one-to-one NAT (port number is
not modified) listening on ports 5060 and 53 (and more ports in the future)
- aliases correctly configured :
alias= udp: public_ip:53
alias= udp: public_ip:5060
alias= udp: hostname:53
alias= udp: hostname:5060
- listen directive correctly on private ip address and both ports :
listen=udp:private_ip:53
listen=udp:private_ip:5060
- advertised_address=public_ip
- record_route_preset("public_ip") is used to announce the public IP
address in the RR header
- user A : registered on port 5060
- user B : registered on port 53
Suppose user A tries to call user B.
The Record-Route header in the INVITE forwarded from Kamailio to user B
should contain the port number on which user B is connected (53), to force
user B to send future requests to that port number. But I have no method to
know which port user B is connected to, and that problem is aggravated when
user B has multiple registrations on different port numbers and parralel
forking is done. Declaring advertised_port doesn't solve the problem. I
cannot force port number 53 in record_route_preset("public_ip:53") since it
wouldn't work when user B calls user A. Using the record_route( ) function,
Kamailio doesn't use the advertised_address to construct the RR header.
Another problem is that the record_route_preset function clears the DID
cookie set by the dialog module, which makes Kamailio fallback to SIP
elements to match the request to an existing dialog, thus dialog matching
becomes slower, and performance is an issue for me.
Any suggestions? I know that one solution would be to run Kamailio with a
public IP address and no NAT, but unfortunately it's not possible.
I suggest that the function record_route( ) takes a public IP address as a
parameter, still doing what it does (correct record routing and cookie
addition did=xxx and loose route lr=on), but only replacing the private IP
address on which Kamailio listens with a public IP address. Or that the
record_route( ) function uses the advertised_address to construct the RR
header.
Thank you
RA
Hello,
finally had a chance to look over it. I guess it is some race, resulting
in a memory space being overwritten. The 200ok for publish with ringing
state is processed more or less at the time when 200ok for invite comes
and dialog changes state.
Can you re-compile with MEMDBG=1 (edit the Makefile.defs or give it in
the command line parameter) and try again? Maybe the memory manager can
catch the fault operation and provide more details.
Cheers,
Daniel
On 5/17/12 6:58 PM, Charles Chance wrote:
>
> Hi Daniel,
>
> I have sent the messages over to you.
>
> I look forward to hear what you can find.
>
> Best,
>
> Charles
>
> ------------------------------------------------------------------------
>
> *From:*Daniel-Constantin Mierla [mailto:miconda@gmail.com]
> *Sent:* 17 May 2012 15:06
> *To:* Charles Chance
> *Cc:* 'SIP Router - Kamailio (OpenSER) and SIP Express Router (SER)
> -Users Mailing List'
> *Subject:* Re: FW: (Devel) Segmentation fault using pua_dialoginfo
>
> Hello,
>
> the content of ps->param is pretty much all invalid. So looks like a
> callback on a freed/invalid parameter, could be a double-callback
> execution.
>
> Set debug=3 and send all the messages for such case -- it might be
> quite a lot of them, so send them to my email address, the mailing
> list has a limit of message size.
>
> Cheers,
> Daniel
>
> On 5/17/12 2:13 PM, Charles Chance wrote:
>
>> Hi,
>>
>> Requested output as follows:
>>
>> (gdb) frame 1
>>
>> #1 publ_cback_func (t=0xb3dc8e38, type=1024, ps=0xbfcdd5d8)
>>
>> at send_publish.c:246
>>
>> 246 hash_code= core_hash(hentity->pres_uri, NULL, HASH_SIZE);
>>
>> (gdb) p *ps
>>
>> $2 = {req = 0x0, rpl = 0xb7c30340, param = 0xb3dc3ff4, code = 412,
>> flags = 0,
>>
>> branch = 0, t_rbuf = 0x0, dst = 0x0, send_buf = {s = 0x0, len = 0}}
>>
>> (gdb) p *(ua_pres_t*)(*ps->param)
>>
>> $3 = {id = {s = 0x20455942 <Address 0x20455942 out of bounds>,
>>
>> len = 980445555}, pres_uri = 0x40323531, event = 875444279,
>>
>> expires = 875703856, desired_expires = 858861105, flag = 808794676,
>>
>> db_flag = 1394618421, cb_param = 0x322f5049, next = 0xa0d302e,
>>
>> ua_flag = 979462486, etag = {
>>
>> s = 0x50495320 <Address 0x50495320 out of bounds>, len = 808333871},
>>
>> tuple_id = {s = 0x5044552f <Address 0x5044552f out of bounds>,
>>
>> len = 775436064}, body = 0x322e3034, content_type = {
>>
>> s = 0x312e3134 <Address 0x312e3134 out of bounds>, len = 1648047155},
>>
>> watcher_uri = 0x636e6172, call_id = {
>>
>> s = 0x397a3d68 <Address 0x397a3d68 out of bounds>, len = 1647593320},
>>
>> to_tag = {s = 0x3435634b <Address 0x3435634b out of bounds>,
>>
>> len = 842149473}, from_tag = {
>>
>> s = 0x63306461 <Address 0x63306461 out of bounds>, len = 808334648},
>>
>> cseq = 1767246349, version = 1394621025, outbound_proxy = 0x322f5049,
>>
>> extra_headers = 0x552f302e, record_route = {
>>
>> s = 0x31205044 <Address 0x31205044 out of bounds>, len = 825111097},
>>
>> remote_contact = {s = 0x312e3836 <Address 0x312e3836 out of bounds>,
>>
>> len = 976498224}, contact = {
>>
>> s = 0x36373135 <Address 0x36373135 out of bounds>, len = 1701985073}}
>>
>> Yes, it is a test server so very happy to arrange for remote access
>> if required. In the meantime, I will do a little more digging to try
>> to find out why entity is null.
>>
>> Cheers,
>>
>> Charles
>>
>
>
> --
> Daniel-Constantin Mierla -http://www.asipto.com
> http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> -http://www.linkedin.com/in/miconda
>
> ------------------------------------------------------------------------
>
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com>
> Version: 2012.0.2176 / Virus Database: 2425/5004 - Release Date: 05/16/12
>
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - http://asipto.com/u/katu
Hello,
We plan to use Kamailio as redirect server. Corresponding contact list is to
be fetched by a Lua script from DB.
The problem is about calling the required 'rewriteuri' function:
1. From lua script. both 'sr.rewriteuri()' and 'sr.modf("rewriteuri",
...)" fails to write the 'contact' field.
2. I tried an alternative way; pushing the value from lua (e.g.
sr.pv.sets("contact", "sip:...")) and got the value in the Kamailio.cfg
($var(contact)). But can't call the rewriteuri function with this variable's
value as argument. This seems to be a general problem of calling a function
from .cfg with a variable's value as parameter.
Any help much appreciated.
--
Sharif
Hello
Can somebody help me understand the example given with MI command "is_gflag"?
...
$ kamctl fifo set_gflag 1024
$ kamctl fifo is_gflag 1024
TRUE
$ kamctl fifo is_gflag 1025
TRUE
$ kamctl fifo is_gflag 1023
FALSE
$ kamctl fifo set_gflag 0x10
$ kamctl fifo is_gflag 1023
TRUE
$ kamctl fifo is_gflag 1007
FALSE
$ kamctl fifo is_gflag 16
TRUE
This is how I understand it. There are 32 posible flags (0..31), each one can be set independently. The commands "is_flag" and "set_gflag" expect a bitmask as value (decimal or hex)
If I set "kamctl fifo set_gflag 1024", this means "100 0000 0000", I expect that the only flag that has been set to 1 is the position 10. How come the command "kamctl fifo is_gflag 1025" which is "100 0000 0001" can yield TRUE?. I expect it to be TRUE only if flags 0 and 10 are both set to 1.
Same thing with setting the flag to 0x10 (16 in decimal, "1 0000" in binary), how come the "is_gflag 1023 and is_gflag 1007" can return TRUE?
tx a lot
fborot
Hi all,
I'm posting the script which worked. In future if anybody faces the
same problem can get a solution out of this.
In request_route:
#!ifdef WITH_HASH
if (is_method("INVITE") && !has_totag()){
xdbg ("Contact [$ct] with Callid [$ci]");
$sht(a=>$ci) = $ct;
}
#!endif
in route[WITHINDLG]
#!ifdef WITH_HASH
xdbg ("ruri [$ru]");
if ($(sht(a=>$ci){nameaddr.uri}) != $ru){
xdbg ("hash table entry
[$sht(a=>$ci)]");
$ru = $(sht(a=>$ci){nameaddr.uri});
sht_rm_name_re("ha=>$ci");
xdbg ("rewriting ruri to [$ru]");
}
#!endif
Thanks everyone for the help. I'm marking this thread as solved.
--
-aft
--
-aft
I set up sip-xmpp gateway using xmpp module(in component mode).
messages from sip client to xmpp delivered, but I have a problem.
If recipient is not existent, the sip client don't know nothing about it.
How can I inform sip client about such condition?
The xmpp server(ejabberd) inform it's component about this error(I've
checked it using tcpdump), but kamailio seems ignore this error
completely.
What can I do in this situation?
--
Homo Homini domini est!