Hi,
insert_hf doesn't work for CANCEL messages. It doesn't work either on 487
replies in failure_route..
Why? Is it because they are re-generated on every hop?
Is there a workaround?
Reda
Hi.
I'm a newbie to Kamailio (so do not judge strictly). I have experience only
with Asterisk and now I'm trying to configure Kamailio. With default config
all is working as expected, but I'm trying to configure it from zero with
minimal functions, but using parts from default config (those parts that I
figured out).
With my present config local calls are working great, but I can't make
outbound calls.
I've attached config file, sip-trace and debug log.
I think there is a route loop somewhere but I can't figure out where.
I would be grateful if you pointed out to me where exactly my mistake or
just point me in the right direction =)
Thanks in advance
Hi,
I ran into an interesting scenario when experimenting with kamailio 3.1
as a stateless proxy (no tm module used):
There is an initial INVITE without to-tag and with pre-loaded Route
header pointing to the external address of the lb. When I call
loose_route for that, it returns false and the Route header is removed.
That's what I expected, and it's documented in
http://www.kamailio.org/docs/modules/3.1.x/modules_k/rr.html#loose-route-id.
However if a 407 is relayed back from the registrar via the lb to the
UA, it sends an ACK, again with pre-loaded Route header like in the
initial INVITE, this time with to-tag. In that case, loose_route()
returns true, but the $du is $null and the R-URI is still the same. So
the Route is consumed, but the URI is not used. Since it's a stateless
proxy, this hop-by-hop ACK needs to be routed the same way as the
initial INVITE, so what I'm doing is something like that:
if(loose_route()) {
if($du == $null && $ru == $ou) {
# skip loose-routing for such a request
}
}
Is this how it's supposed to work? And is there some documentation of
how loose_route() detects whether Route points to itself or not? I'm not
using auto_aliases, nor do I set any aliases manually. Does it determine
internally whether the Route points to its local ip and port? If not,
how come the $du is not set although loose_route returns true?
Andreas
Hi,
I am newly experiencing kamailio 3.2. I have installed kamailio and MySQL
and tried the test call from 1 PC(x-lite) to another PC(x-lite) and ended
successfully.
Now moving further, I have configured dynamic routing module and applied
needed parameters and scripts to finally be able to start kamailio without
any issue. Also I set a testing scenario in the related database tables
BUT my problem is that whenever am trying to call the predefined prefix
(961) from x-lite am getting a 'calling' message on it and then request
timeout where I find that kamailio has stopped running. I kamctrl start
again and call 961 then get calling so I wait and kamailio stps again. Below
is the script used in the routing logic and database record.
Any help to achieve a successful call is highly appreciated.
dr_gatways: 3, 1, '192.168.111.15', 0, '', '', 2, 'PC1'
dr_groups: 2, '.*', '.*', 0, 'Anyone'
dr_gw_lists: 2, '3', 'Test Call'
dr_rules: 2, '0', '961', '', 0, '1', '#2', 'Lebanon Fix'
####### Routing Logic ########
# main request routing logic
route{
if (is_method("INVITE")) {
setflag(1); # do accounting
route(4); # Call our dynamic route.
}
}
..
..
..
route[4] {
if (!do_routing("0")) {
send_reply("503", "No Rules matching the URI");
exit;
}
if (is_method("INVITE")) {
t_on_failure("4");
}
route(RELAY);
}
..
..
..
failure_route[4] {
if (use_next_gw()) {
t_relay();
exit;
} else {
t_reply ("503", "Service not available");
exit;
}
}
Thanks in Advance,
F.Chahrour
Hi,
The openser service died on my servers after "memory allocation failure".
This issue has been occurred a couple of times on two different servers
within the last two months.
Feb 29 08:31:59 /usr/sbin/openser[7115]: ERROR:core:do_action: memory
allocation failure
Feb 29 08:31:59 /usr/sbin/openser[7115]: ERROR:core:pv_set_ruri_user: do
action failed
Feb 29 08:31:59 /usr/sbin/openser[7115]: ERROR:core:do_assign: setting PV
failed
....
Feb 29 08:31:59 /usr/sbin/openser[7115]:
ERROR:core:insert_cond_lump_after: out of pkg memory
Feb 29 08:31:59 /usr/sbin/openser[7115]: ERROR:rr:build_rr: failed to
insert lumps
Feb 29 08:31:59 /usr/sbin/openser[7115]: ERROR:rr:record_route: failed to
insert inbound Record-Route
Feb 29 08:31:59 kernel: [8806798.263792] openser[7115] general protection
rip:7f6e17eae69c rsp:7fff21dac5b0 error:0
Feb 29 08:31:59 /usr/sbin/openser[7164]: CRITICAL:core:receive_fd: EOF on
22
It seems increasing memory size in /etc/default/openser to 1024 didn't fix
the issue.
# Amount of memory to allocate for the running OpenSER server (in Mb)
MEMORY=1024
Any advice would be appreciated.
Thanks,
R
Hello,
I've used kamailio 3.2.2, i have rls, simple presence and xcap support
working. I've replicated this server into another one in a different
domain, but presence between domains is not working. I'm using for presence
presence.so, presence_xml.so and presence_mwi.so. In route[WITHINDLG] i
have the following lines:
...
if (is_method("SUBSCRIBE|NOTIFY") && uri==myself)
route(PRESENCE);
...
When NOTIFY from user B at domain B arrives to the server at domain A, the
message is not forwarded to the user A, How can i achieve this?
Thank you.
Hi,
I noticed dialog module showing calls that have already been terminated
with state=4.
The kamailio version is 3.1.5, I'm aware of certain limitations of
dialog module in this version (must use stateless replies, create dialog
after 407), but this is something rather new.
In kamailio config I'm using dlg_manage() for initial INVITEs and
BYE/CANCEL and in-dialog requests are loose-routed, so nothing finicky.
The call scenario is: A calls B, B answers the call, A immediately after
sending ACK for the 200 OK issues re-INVITE. After some seconds A hangs
up, and the dialog stays in memory in state=4, e.g.:
dialog:: hash=3304:623200556
state:: 4
ref_count:: 2
timestart:: 1329938667
timeout:: 78590167
callid:: MGExMjRiYzMzN2Q5YWU4YjRiMjFjYTYwYWZlMGFlMzY.
from_uri:: sip:sipwise-user1@67.202.62.202
from_tag:: 4207e429
caller_contact:: sip:sipwise-user1@80.108.64.151:46420
caller_cseq:: 3
caller_route_set::
<sip:127.0.0.1:5060;lr;r2=on>,<sip:67.202.62.202:5060;lr;r2=on>
caller_bind_addr:: udp:127.0.0.1:5062
callee_bind_addr:: udp:127.0.0.1:5062
to_uri:: sip:43991002@67.202.62.202
to_tag:: 6C8F89E9-4F4540EA0001F575-AC557700
callee_contact:: sip:sipwise-user2@127.0.0.1:5080
callee_cseq:: 11
callee_route_set::
When I set dlg_match_mode=1 the problem goes away. I would like however
to understand why the dialog fails to clear in default mode (DID_ONLY),
because the dialog cookie seems to be preserved by caller in all
in-dialog requests properly. There is nothing in the debug log and trace
attached that catches my eye. Do you see anything wrong there?
In trace file the proxy address is 127.0.0.1:5062. You may notice that
the actual signaling flow is a little bit more complicated, I will
gladly answer any questions about it. For this test I've used two lines
in the eyeBeam softphone, when one line answers the other is
automatically put on hold which is what I want. Then I un-hold the
callee and clear the call.
The customer is reporting multiple stale calls when re-INVITE is sent by
Cirpack PSTN gw immediately after call connect, which is basically the
same call flow I am talking about, it is just not practical for me to
run kamailio with debug=3 there all the time. I am going to try
theredlg_match_mode=1 though and see if the problem goes away.
Any ideas?
Hi
Thanks for your reply!
I already set the accounting flag like you say. And all normal BYEs are
inserted into the acc table fine. Just internally generated BYEs don't
get inserted in acc table.
I've done a bit googling and added event_route:
event_route[tm:local-request]
{
if (is_method("BYE")) {
xlog("L_INFO", "event_route: BYE: callid=$ci, cseq=$cs - internally
generated\n");
setflag(FLT_ACC); # do accounting ...
setflag(FLT_ACCFAILED); # ... even if the transaction fails
}
}
When I have two clients in a call, I disconnect the network for both
clients, so no RTP either direction, which triggered mediaproxy to send
dlg_bye_dlg to Kamailio, which sent BYE to both clients. I can see from
the log that event_route did get executed, and BYE sent to both clients,
but still BYE isn't inserted to acc table.
The code inside event_route() above is copied from my route[WITHINDLG],
which for client-generated BYEs operates correctly (inserts BYEs into
acc table). But in event_route it didn't work.
I also tried to use sql_query to insert BYE into acc table in
event_route and it causes Kamailio to crash. Using sql_query to select *
from acc also causes Kamailio to crash.
Any idea where I've done wrong? I'm very much lost.
Thank you!
Yufei
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 27 Feb 2012 13:21:50 -0500
> From: Alex Balashov <abalashov(a)evaristesys.com>
> Subject: Re: [SR-Users] How to do accounting for Kamailio-generated
> BYEs?
> To: sr-users(a)lists.sip-router.org
> Message-ID: <4F4BC9BE.8000704(a)evaristesys.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 02/27/2012 12:58 PM, Yufei Tao wrote:
>> Hi
>>
>> I've got a mediaproxy that detects no media, and sends dlg_end_dlg to
>> Kamailio via mi_datagram socket. Then Kamailio sends BYE to both calling
>> parties. It all works fine. But my question is, how to do accounting for
>> these Kamailio-generated BYEs? They don't appear in the acc table.
> In the loose_route() section of the config script, set the accounting
> flag for BYEs, e.g.
>
> if(is_method("BYE"))
> setflag(xx);
>
>
--
Yufei Tao
Red Embedded
This E-mail and any attachments hereto are strictly confidential and intended solely for the addressee. If you are not the intended addressee please notify the sender by return and delete the message.
You must not disclose, forward or copy this E-mail or attachments to any third party without the prior consent of the sender.
Red Embedded Design, Company Number 06688253 Registered in England: The Waterfront, Salts Mill Rd, Saltaire, BD17 7EZ
Ok thanks Daniel.
I'll do what you suggested and we'll see how to proceed.
Thanks again
Reda
On 27 févr. 2012, at 17:46, Daniel-Constantin Mierla <miconda(a)gmail.com>
wrote:
Hello,
On 2/26/12 11:01 AM, Reda Aouad wrote:
Daniel, I sent you the log file by private email, for privacy concerns.
ok, no time yet to look over them, but as you say it does not call
mediaproxy explicitely from config and callcontrol, maybe you should look
inside mediaproxy module, might be automatically executed on dialog or tm
module callbacks -- then the patch has to be done for mediaproxy module.
I took a quick look at the log files, and didn't see any call to
mediaproxy module.
Though, the mediaproxy log file indicates a media session engaged, and
CDRTool shows media information for the established session.
The mediaproxy module is loaded, but no function from the module is called
at all.
It can be via some internal callbacks registered to some modules such as tm
and dialog, or even script execution callbacks... so look over the code of
mediaproxy module. You can run kamailio with debug=3 and from the logs you
should get some hints about what is the way media proxy is executed.
Cheers,
Daniel
Thanks
Reda
On Sat, Feb 25, 2012 at 18:58, Reda Aouad <reda.aouad(a)gmail.com> wrote:
> I looked in detail in the source of the call control module and didn't
> find anything related to the mediaproxy module neither..
> I'll send you the output of cfgtrace soon.
>
> Reda
>
>
>
> On Fri, Feb 24, 2012 at 23:46, Daniel-Constantin Mierla <miconda(a)gmail.com
> > wrote:
>
>> A quick grep over the callcontrol sources didn't reveal a point where
>> mediaproxy is engaged.
>>
>> Can you load debugger module and enable cfgtrace, then run such a
>> scenario and send out the output from cfgtrace to see all the config
>> actions executed?
>>
>> Cheers,
>> Daniel
>>
>>
>> On 2/24/12 7:56 PM, Reda Aouad wrote:
>>
>> It would be great Daniel if you could do it.
>> I will be more than happy to test it.
>> A function parameter would be more flexible than a module parameter.
>> I expect it shouldn't affect the behavior of the external application
>> CallControl.
>>
>> Thanks in advance :)
>>
>> Reda
>>
>>
>>
>> On Fri, Feb 24, 2012 at 08:09, Daniel-Constantin Mierla <
>> miconda(a)gmail.com> wrote:
>>
>>> Hello,
>>>
>>> I am not using mediaproxy at all (but nathelper/rtpproxy), neither the
>>> call control module, but making an option (module parameter or function
>>> parameter) for call control to bind to another module like media proxy,
>>> should not be big deal if it is all you are looking for -- I can look over
>>> it and send a patch if you are going to help testing it. I cannot do it
>>> these days, though, being out of the office.
>>>
>>> Cheers,
>>> Daniel
>>>
>>>
>>> On 2/23/12 8:59 PM, Reda Aouad wrote:
>>>
>>> First, I am posting about the wrong behavior of CallControl (or most
>>> probably Kamailio modules) which leaves no option. I should be the only
>>> one deciding about how to handle timeouts. If I decide to take some risk,
>>> no module should oblige me to do otherwise.
>>>
>>> Mediaproxy detects ONLY RTP timeouts from BOTH parties, because linux
>>> conntrack rules it uses are bi-directional. If a single party stops sending
>>> RTP for whatever reason (connection lost, codec with silence detection
>>> used, ....), mediaproxy doesn't care and doesn't act upon it. This is a
>>> feature, and a wanted one, to mainly support voice-detecting codecs. Think
>>> also about conferences for example, in which only a single person talks for
>>> a long time while others are silent and don't send RTP.
>>>
>>> Single-side RTP timeout because of a real problem (loosing network
>>> connection for example) should be handled with other methods, such as SIP
>>> session timers.
>>>
>>> MY POINT IS : I don't see it practical to handle RTP flows for EVERY
>>> call to handle the least probable scenario: an RTP timeout from both (or
>>> all) parties.
>>>
>>> If I understood well, mediaproxy updates the CDR when it detects an
>>> RTP timeout from both parties. CallControl can look in the CDR to debit the
>>> correct balance, instead of attaching itself to the dialog module to detect
>>> dialog termination.
>>>
>>> This is an extract from the call_control module :
>>>
>>> Even when mediaproxy is unable to end the dialog because it was not
>>> started with engage_media_proxy(), the callcantrol application is still
>>> able to detect calls that did timeout sending media, by looking in the
>>> radius accounting records for entries recorded by mediaproxy for calls that
>>> did timeout. These calls will also be ended gracefully by the callcontrol
>>> application itself.
>>>
>>>
>>> Unless there is something I miss..
>>>
>>> I also opened a bug about the issue because call_control doesn't have
>>> the same behavior with OpenSips. It doesn't force mediaproxy.
>>>
>>> Reda
>>>
>>>
>>>
>>> On Thu, Feb 23, 2012 at 20:00, Jeff Brower <jbrower(a)signalogic.com>wrote:
>>>
>>>> Reda-
>>>>
>>>> > It's clear but not necessary. It can look at radius records fixed by
>>>> > mediaproxy on RTP timeout to debit the correct balance as well. And
>>>> why
>>>> > also force it on postpaid calls which it doesn't control at all ?
>>>>
>>>> I don't understand how you plan to tear down Kamailio calls that
>>>> suffer RTP time-out?
>>>>
>>>> -Jeff
>>>>
>>>> > What happens is cost and performance issues for additional calls
>>>> passing
>>>> > through my mediaproxy server, which I didn't plan for at first. No
>>>> audio
>>>> > issue at all.
>>>> >
>>>> > Reda
>>>> >
>>>> >
>>>> >
>>>> > On Thu, Feb 23, 2012 at 11:58, Sammy Govind <govoiper(a)gmail.com>
>>>> wrote:
>>>> >
>>>> >> Reading from the module docs its clear why it needs to engage
>>>> media/rtp
>>>> >> proxy to start,stop billing or timer of a call. so what happens when
>>>> it
>>>> >> engages mediaproxy on unwanted calls !? audio-issues?
>>>> >>
>>>> >>
>>>> >> On Thu, Feb 23, 2012 at 1:21 PM, Reda Aouad <reda.aouad(a)gmail.com>
>>>> wrote:
>>>> >>
>>>> >>> Thanks Sammy. I didn't get any reply yet.
>>>> >>>
>>>> >>> CallControl is an application used with CDRTool for prepaid calls.
>>>> It
>>>> >>> calculates the maximum call duration based on the user's balance.
>>>> Once the
>>>> >>> call's duration limit is reached, it sends BYE to both calling
>>>> parties,
>>>> >>> terminating the call. At the end of a prepaid call, terminated
>>>> either by
>>>> >>> the user or by CallControl, it debits the user's balance according
>>>> to the
>>>> >>> call's duration.
>>>> >>>
>>>> >>> The Call_Control module interfaces with this external application.
>>>> >>>
>>>> >>> call_control function is called in Kamailio's cfg to check if the
>>>> user
>>>> >>> has prepaid or postpaid account, and get the max call duration for
>>>> prepaid
>>>> >>> users. CallControl controls only prepaid calls, not postpaid ones.
>>>> >>>
>>>> >>> So call control and NAT traversal using mediaproxy are two
>>>> differents
>>>> >>> things which i can't link, since I don't want mediaproxy for every
>>>> call.
>>>> >>> And since the function call_control is called on every invite before
>>>> >>> knowing if the user has a prepaid account or not, it engages
>>>> mediaproxy for
>>>> >>> every call.
>>>> >>>
>>>> >>> CallControl relies on mediaproxy to detect RTP timeouts and debit
>>>> the
>>>> >>> correct balance from a prepaid account based on the last instant the
>>>> >>> mediaproxy saw an RTP packet.
>>>> >>>
>>>> >>> But why to force using mediaproxy with no choice? And why to force
>>>> it for
>>>> >>> every call, whether it falls under CallControl's control or not?
>>>> >>>
>>>> >>> I am using Kamailio 3.2.
>>>> >>>
>>>> >>>
>>>> >>> Reda
>>>> >>>
>>>> >>> On 23 févr. 2012, at 07:21, Sammy Govind <govoiper(a)gmail.com>
>>>> wrote:
>>>> >>>
>>>> >>> Hi,
>>>> >>> I can see you posting multiple times on both proxies listings so
>>>> I'm sure
>>>> >>> you havent heard back from anyone.I am not at all familiar with your
>>>> >>> functions in email but could it be possible for you to determine on
>>>> which
>>>> >>> calls you need to engage mediaproxy and on which not to, then on
>>>> the base
>>>> >>> of that flag use the call_control function !
>>>> >>> your problem is complicated for me atleast. I hope somebody could
>>>> answer
>>>> >>> you accurately and precisely.
>>>> >>>
>>>> >>> btw, what are you using in real? opensips or kamailio, which
>>>> version? and
>>>> >>> in what context you need to use the call_control function?
>>>> >>>
>>>> >>> Thanks,
>>>> >>> Sammy
>>>> >>>
>>>> >>> On Thu, Feb 23, 2012 at 12:45 AM, Reda Aouad <reda.aouad(a)gmail.com
>>>> >wrote:
>>>> >>>
>>>> >>>> Hi,
>>>> >>>>
>>>> >>>> When I use the function call_control( ) of the call_control
>>>> module, it
>>>> >>>> automatically engages mediaproxy if it finds the mediaproxy module
>>>> loaded.
>>>> >>>> If the mediaproxy module is not loaded, call_control doesn't even
>>>> try to
>>>> >>>> engage it.
>>>> >>>>
>>>> >>>> I need mediaproxy for NAT traversal in some cases, but don't want
>>>> it to
>>>> >>>> be engaged on every call.
>>>> >>>>
>>>> >>>> How can I disable this behavior?
>>>> >>>>
>>>> >>>> Thanks
>>>> >>>> Reda
>>>> >>>>
>>>> >>>> _______________________________________________
>>>> >>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>>>> list
>>>> >>>> sr-users(a)lists.sip-router.org
>>>> >>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>> >>>>
>>>> >>>>
>>>> >>> _______________________________________________
>>>> >>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>>>> list
>>>> >>> sr-users(a)lists.sip-router.org
>>>> >>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>> >>>
>>>> >>>
>>>> >>> _______________________________________________
>>>> >>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>>>> list
>>>> >>> sr-users(a)lists.sip-router.org
>>>> >>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>> >>>
>>>> >>>
>>>> >>
>>>> >> _______________________________________________
>>>> >> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>>>> list
>>>> >> sr-users(a)lists.sip-router.org
>>>> >> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>> >>
>>>> >>
>>>> > _______________________________________________
>>>> > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
>>>> list
>>>> > sr-users(a)lists.sip-router.org
>>>> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>> >
>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>> --
>>> Daniel-Constantin Mierla -- http://www.asipto.comhttp://linkedin.com/in/miconda -- http://twitter.com/miconda
>>>
>>>
>>
>>
>> _______________________________________________
>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>> --
>> Daniel-Constantin Mierla -- http://www.asipto.comhttp://linkedin.com/in/miconda -- http://twitter.com/miconda
>>
>>
>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
listsr-users@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla --
http://www.asipto.comhttp://linkedin.com/in/miconda --
http://twitter.com/miconda
Hi All,
Is it possible to asertain the array index of an htable entry based on
its value?
For example, say I have an htable called foo with the following entries:
Entry:: 11
testing[0]:: hello-2
testing[1]:: 1
testing::size:: 2
is it possible to:
[a] extract the array index based on a regex of the value, for example,
something like value count:
shtcv(foo=>hello-*)
[b] if [a] is possible, how would I extract that value (from the
associated array index returned in [a] above) from the htable using sht()?
Is the above possible, or am I using the wrong tool for the job?
I did have a look at the htable module docs, but i didnt see anything
that stood out to me showing that i could achieve the above. I saw an
shtval exported function, but i dont see it documented in the pseudo-var
wiki page. I then tried it in the routing script but got an error
message to the affect that it couldnt find the PV. I assume its not
exported.
All comments welcome and appreciated?
Thanks