You have to figure it somehow with adjusting the python code of
media-dispatcher. We have developed special "/etc/init.d/kamailio grace"
command, which waits for the moment, when there are no calls, so it can be
restarted. It queries mediaproxy every second.
In future we will not use mediaproxy anymore - it is not supported in
latest version either. rtpproxy gives us better performance results.
On Tue, Feb 12, 2013 at 2:44 PM, Eduardo Lejarreta
<lejarreta.e(a)sarenet.es>wrote:
> Good evening.
>
> Launching "mediaproxy-dispatcher" and "mediaproxy-relay" on the foreground
> and with "DEBUG" we can see:
>
> mediaproxy-dispatcher log:
> ------------------------------------------------------------------> Kamctl
> restart
> debug: Connection to OpenSIPS lost: Connection was closed cleanly.
> debug: Connection to OpenSIPS lost: Connection was closed cleanly.
> debug: Connection to OpenSIPS lost: Connection was closed cleanly.
> debug: Issuing "remove" command to relay at A.B.C.D
> debug: Got statistics: {xxxxxxxxxxxxxxxxxxx}
> debug: Connection to OpenSIPS lost: Connection was closed cleanly.
>
> mediaproxy-relay log:
> ------------------------------------------------------------------> Kamctl
> restart
> debug: removing session xxxxxxxxxxxxxxxxxxx
> (Port 50000 Closed)
> (Port 50001 Closed)
> (Port 50002 Closed)
> (Port 50003 Closed)
>
> So "mediaproxy-dispatcher" doesn't receive any command from Kamailio, he
> just detects " Connection was closed cleanly" and then issues a "remove"
> command to "mediaproxy-relay".
>
> Does anybody know any way to avoid this?
>
> Thanks and regards.
> --
> Eduardo Lejarreta.
>
>
> _______________________________________________
> 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
>
hello ,
w have PBX gateway along with kamailio. all calls are routed to pbx
extensions. but if it happens to be an IP extrension we want the
kamailio to handle the speech without keeping the PBX channel busy.
if its an analog extension then this channel can be busy but if its
IP extension kamailio should handle the speech itself. how is this
possible ??
thanks in advance.
Hi,
I am using app_lua to frequently store some data in htable and avp
entries, using sr.pv.sets. When I read the values using sr.pv.get
immediately after writing them, they seem correct. However, when I read
them later from Lua, I have noticed that sometimes the value is
incorrect or nil. Am I doing something wrong?
The following code uses rtimer to duplicate the problem on startup,
printing the errors to syslog.
Tested on version: kamailio 3.3.1 (i386/linux) 2d0f6f
###############
# kamailio.cfg
###############
loadmodule "pv.so"
loadmodule "xlog.so"
loadmodule "htable.so"
loadmodule "rtimer.so"
loadmodule "app_lua"
modparam("htable", "htable", "status=>size=14;autoexpire=0;")
modparam("rtimer", "timer", "name=ta;interval=10;mode=1")
modparam("rtimer", "exec", "timer=ta;route=LUA_TEST")
# the following path may need to change depending on filesystem setup
modparam("app_lua", "load", "/etc/kamailio/kamailio.lua")
route
{
route(LUA_TEST);
}
route[LUA_TEST] {
$var(lua_test_key) = $(pp{s.toupper}) + "::";
lua_runstring("htable_test([[status=>$var(lua_test_key)]])");
lua_runstring("avp_test([[status=>$var(lua_test_key)]])");
}
----------------
-- kamailio.lua
----------------
-- Test of sr.pv operations in Lua
function htable_test (namekey)
local pvar_prefix = "$sht("..namekey
pvar_test(pvar_prefix)
end
function avp_test ( name )
local pvar_prefix = "$avp("..name
pvar_test(pvar_prefix)
end
function pvar_test ( pvar_prefix )
for value = 10000, 10050 do
local pvar = pvar_prefix..value..")"
--sr.log("info", "Lua attempting to set '"..pvar.."' to value
'"..value.."'")
sr.pv.sets(pvar, value)
end
for value = 10000, 10050 do
-- now we check what was stored
local pvar = pvar_prefix..value..")"
local checkvar = sr.pv.get(pvar)
if ( tostring(checkvar) ~= tostring(value) ) then
sr.err(string.format("CHECK: Lua checking pvar '%s' and got value
'%s' which is NOT '%s'",
tostring(pvar),
tostring(checkvar),
tostring(value)
))
end
end
end
-- end of kamailio.lua
Thanks,
-Andrew
Hi, all
Have a question about failure_routes.
As I remember if kamailio statefuly sent a request and didn't receive a
reply script writer can handle this situation at a failure_route[] block.
But if kamailio can't resolve a destination from R-URI it sends back 478
reply and finishes current transaction without reaching a failure_route[].
Is it possible to process such a request in a failure_route[] ?
Additional details:
version: kamailio-3.2.4
t_on_failure() is called before t_relay()
I have checked with REGISTER and INVITE transactions.
Hi Shahzad ,
It is not ,We can able to connect remote mysql ( please find the
detail below),moreover we can able create openser db from Kamailio server
to remote mysql server
*Mysql server : 192.168.1.170*
*Kamailio server : 192.168.1.101*
*Mysql output :*
*
*
*mysql -u openser -h 192.168.1.170 -p*
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 68
Server version: 5.1.67 Source distribution
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement.
mysql>
With Regards
N.Prakash
>
> ---------- Forwarded message ----------
> From: Muhammad Shahzad <shaheryarkh(a)gmail.com>
> Date: Tue, Feb 12, 2013 at 5:16 PM
> Subject: Re: [sr-dev] [SR-Users] openser db on an external mysql server
> To: Development mailing list of the sip-router project <
> sr-dev(a)lists.sip-router.org>
> Cc: Daniel-Constantin Mierla <miconda(a)gmail.com>,
> sr-users(a)lists.sip-router.org, Indu Priya <indu(a)tevatel.com>, Prabhakaran
> B <prabhakaran(a)tevatel.com>
>
>
> Its not a Kamailio error, it is problem with connecting to mysql server.
> Error 4 means No MySQL Server Running On Specified Host.
>
> May be MySQL server is down or there is some firewall running or MySQL not
> listening on IP you specified.
>
> Thank you.
>
>
> On Tue, Feb 12, 2013 at 12:11 PM, Prakash N <prakash.n(a)tevatel.com> wrote:
>
>> Dear Daniel,
>>
>> Thanks for your quick response
>>
>> We can able to create operseb db on remote mysql server ,but
>> Kamailio not getting start
>>
>> Error detail:
>>
>> ERROR: db_mysql [km_my_con.c:109]: driver error: Can't connect to MySQL
>> server on '192.168.1.170' (4)
>> ERROR: <core> [db.c:32 0]: could not add connection to the pool
>> ERROR: auth_db [authdb _mod.c:174]: unable to connect to the database
>> ERROR: <core> [sr_modu le.c:896]: init_mod_child(): Error while
>> initializing module auth_db (/usr/local/lib64/kamailio/modules_k/auth_db.so)
>>
>>
>> I have attached my kamailo.cfg ( we followed Kamailio and Asterisk real
>> time installation) ,please advice
>>
>> With Regards
>>
>> N.Prakash
>>
>>>
>>> ---------- Forwarded message ----------
>>> From: Daniel-Constantin Mierla <miconda(a)gmail.com>
>>> Date: Tue, Feb 12, 2013 at 2:41 PM
>>> Subject: Re: [SR-Users] openser db on an external mysql server
>>> To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
>>> Users Mailing List" <sr-users(a)lists.sip-router.org>,
>>> sr-dev(a)lists.sip-router.org, miconda(a)gmail.com
>>> Cc: Prabhakaran B <prabhakaran(a)tevatel.com>
>>>
>>>
>>> Hello,
>>>
>>> kamailio database is created with:
>>>
>>> kamdbctl create
>>>
>>> the host of mysql server has to be specified in kamctlrc file via DBHOST
>>> variable - kamctlrc is located in same directory as kamailio.cfg.
>>>
>>> In kamailio.cfg, update the db_url value (or DBURL define) to reflect
>>> the mysql server host.
>>>
>>> Cheers,
>>> Daniel
>>>
>>>
>>> On 2/12/13 4:16 AM, Prakash N wrote:
>>>
>>> Hi All,
>>>
>>> I am new this Kamailo ,ther is any step by step document to set
>>> up openser db on an external mysql server ?
>>>
>>> With Regards
>>>
>>> N.Prakash
>>>
>>>
>>>
>>> _______________________________________________
>>> 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://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>>> Kamailio World Conference, April 16-17, 2013, Berlin
>>> - http://conference.kamailio.com -
>>>
>>>
>>>
>>
>> _______________________________________________
>> sr-dev mailing list
>> sr-dev(a)lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>>
>>
>
>
> --
> Muhammad Shahzad
> -----------------------------------
> CISCO Rich Media Communication Specialist (CRMCS)
> CISCO Certified Network Associate (CCNA)
> Cell: +49 176 99 83 10 85
> MSN: shari_786pk(a)hotmail.com
> Email: shaheryarkh(a)googlemail.com
>
>
Dear Daniel,
Thanks for your quick response
We can able to create operseb db on remote mysql server ,but
Kamailio not getting start
Error detail:
ERROR: db_mysql [km_my_con.c:109]: driver error: Can't connect to MySQL
server on '192.168.1.170' (4)
ERROR: <core> [db.c:32 0]: could not add connection to the pool
ERROR: auth_db [authdb _mod.c:174]: unable to connect to the database
ERROR: <core> [sr_modu le.c:896]: init_mod_child(): Error while
initializing module auth_db (/usr/local/lib64/kamailio/modules_k/auth_db.so)
I have attached my kamailo.cfg ( we followed Kamailio and Asterisk real
time installation) ,please advice
With Regards
N.Prakash
>
> ---------- Forwarded message ----------
> From: Daniel-Constantin Mierla <miconda(a)gmail.com>
> Date: Tue, Feb 12, 2013 at 2:41 PM
> Subject: Re: [SR-Users] openser db on an external mysql server
> To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users
> Mailing List" <sr-users(a)lists.sip-router.org>, sr-dev(a)lists.sip-router.org,
> miconda(a)gmail.com
> Cc: Prabhakaran B <prabhakaran(a)tevatel.com>
>
>
> Hello,
>
> kamailio database is created with:
>
> kamdbctl create
>
> the host of mysql server has to be specified in kamctlrc file via DBHOST
> variable - kamctlrc is located in same directory as kamailio.cfg.
>
> In kamailio.cfg, update the db_url value (or DBURL define) to reflect the
> mysql server host.
>
> Cheers,
> Daniel
>
>
> On 2/12/13 4:16 AM, Prakash N wrote:
>
> Hi All,
>
> I am new this Kamailo ,ther is any step by step document to set
> up openser db on an external mysql server ?
>
> With Regards
>
> N.Prakash
>
>
>
> _______________________________________________
> 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://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Kamailio World Conference, April 16-17, 2013, Berlin
> - http://conference.kamailio.com -
>
>
>
---------- Forwarded message ----------
From: Bayram Karagoz <karagoz.bayram(a)gmail.com>
Date: 2013/2/12
Subject: Re: [SR-Users] INVITE Retransmission Causes Limiting Simultaneus
Calls for Subscribers
To: miconda(a)gmail.com
Cc: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users
Mailing List" <sr-users(a)lists.sip-router.org>
recheck config and saw that I used dlg_manage() most before route(QUOTA)
block. does it sits in the wrong place?
you can find my kamailio.cfg file in attachment also.
# account only INVITEs
* dlg_manage();*
if (is_method("INVITE"))
{
setflag(FLT_ACC); # do accounting
}
###Display Name manipulation###
if (is_method("INVITE") && ($fn != $fU)) {
uac_replace_from("$fU","");
}
### incoming call from SBC###
route(INCOMINGSBC);
###Suspend User###
route(SUSPEND);
### Concurrent Call Limitation Routing Block ###
* route(QUOTA);*
2013/2/12 Daniel-Constantin Mierla <miconda(a)gmail.com>
> Where do you use dlg_manage()? It is not in the route you pasted below.
>
> Cheers,
> Daniel
>
>
> On 2/12/13 10:12 AM, Bayram Karagoz wrote:
>
> Thanks for quick response Daniel,
>
> My kamailio version is 3.2.3 (x86_64/linux) .
> I want to use dlg_manage() before but not sure which side of my call
> limitation route code block.
> can you advise me where to use dlg_manage() in my routing?
> here is my route block defined below;
>
>
> route[QUOTA] {
>
> if (is_method("INVITE") && $fU == $avp(s:username)) {
>
> avp_db_query("select quota from subscriber where
> username='$avp(s:username)'", "$avp(s:quota)");
>
> $var(SIZE) = 0;
> get_profile_size("callquota", "$avp(s:username)", "$var(SIZE)");
> xlog("L_INFO", "CALL_KAMAILIO:Call originated from =
> $fd\n");
> xlog("L_INFO", "Active call amount for $fU is $var(SIZE) ,
> call-id=$ci, quota=$avp(s:quota)\n");
> if( $var(SIZE) >= $avp(s:quota) ){
> sl_send_reply("403", "Simultaneous calls limit reached");
> xlog("L_INFO", "QUOTA:Limit of $var(SIZE) active calls has
> been reached for user=$avp(s:username), call-id=$ci,
> quota=$avp(s:quota)\n");
> exit;
> }
> set_dlg_profile("callquota","$avp(s:username)");
> }
> }
>
>
> 2013/2/12 Daniel-Constantin Mierla <miconda(a)gmail.com>
>
>> Hello,
>>
>> what version of kamailio are you using?
>>
>> State 1 is for dialogs that were not relayed (or they haven't received
>> any reply yet). That means you create the dialog and don't relay the
>> INVITE. Try to us dlg_manage() just before relaying the INVITE.
>>
>> Cheers,
>> Daniel
>>
>>
>> On 2/12/13 9:37 AM, Bayram Karagoz wrote:
>>
>> Hi,
>>
>> is there any advise about my problem?
>> I'm using kamailio in my production environment and this issue started to
>> reproduce a lot.
>> is there any way to discard retransmitted INVITE messages from counting
>> dialog?
>>
>>
>> 2013/2/9 Bayram Karagoz <karagoz.bayram(a)gmail.com>
>>
>>> thanks for the response Daniel,
>>>
>>> has_totag not solved my problem.
>>>
>>> in a deep search I realized that these retransmission INVITE dialogs
>>> are waiting in dialog list as state = 1. one example is below;
>>> is there any way to clear these dialog which state is waiting for state
>>> = 1 or any other solution is welcome for me?
>>>
>>> dialog:: hash=246:499719317
>>> state:: 1
>>> ref_count:: 1
>>> timestart:: 0
>>> timeout:: 0
>>> callid:: 1356619-3569384775-474862(a)GBSBC-1.mydomain.com
>>> from_uri:: sip:02165151057@xxx.xxx.xxx.xxx
>>> from_tag:: 3569384775-474868
>>> caller_contact:: sip:02165151057@xxx.xxx.xxx.xxx:5060
>>> caller_cseq:: 2
>>> caller_route_set::
>>> caller_bind_addr:: udp:xxx.xxx.xxx.xxx:5060
>>> callee_bind_addr::
>>> to_uri:: sip:4115667@xxx.xxx.xxx.xxx
>>> to_tag::
>>> callee_contact::
>>> callee_cseq::
>>> callee_route_set::
>>>
>>>
>>>
>>>
>>> 2013/2/4 Daniel Tryba <daniel(a)pocos.nl>
>>>
>>>> On Sunday 03 February 2013 12:58:02 Bayram Karagoz wrote:
>>>> > I'm trying to limit all subscriber's active call according to setting
>>>> their
>>>> > simultaneous use setting defined in database.
>>>> > But having problem when one subscriber's INVITE message goes to
>>>> > retransmission. When retranmission occures INVITE messages don't
>>>> complete
>>>> > with BYE and subscriber simultaneus use amount will hung.
>>>> > My example code block is below.
>>>> > Does anyone advice me for overcome INVITE retransmissions?
>>>>
>>>> I haven't implemented it myself yet, but all examples I've seen check
>>>> for
>>>> !has_totag() in the INVITE when doing call limit accounting. So
>>>> if (is_method("INVITE") && $fU == $avp(s:username) && !has_totag())
>>>> in your case. But that only works if the device received the initial 100
>>>> Trying with a tag from Kamailio.
>>>>
>>>> But might it not be better to just do the count in the INVITE and
>>>> adding/deleting of dialogs in the dialog event routes?
>>>> http://kamailio.org/docs/modules/stable/modules_k/dialog.html#id2556156
>>>> Problem here is that if the limit is 5 and and there are more than 5
>>>> concurrent INVITES you'd have to drop calls with a 200 OK response.
>>>>
>>>> --
>>>>
>>>> POCOS B.V. - Croy 9c - 5653 LC Eindhoven
>>>> Telefoon: 040 293 8661 - Fax: 040 293 8658
>>>> http://www.pocos.nl/ - http://www.sipo.nl/
>>>> K.v.K. Eindhoven 17097024
>>>>
>>>
>>>
>>>
>>> --
>>> *Bayram KARAGÖZ*
>>>
>>> *NGN Engineer*
>>>
>>> *-----------------------------------------*
>>>
>>> *@* bayram(a)bayramkaragoz.org
>>>
>>> *:** *www.bayramkaragoz.org
>>>
>>> *-----------------------------------------*
>>>
>>
>>
>>
>> --
>> *Bayram KARAGÖZ*
>>
>> *NGN Engineer*
>>
>> *-----------------------------------------*
>>
>> *@* bayram(a)bayramkaragoz.org
>>
>> *:** *www.bayramkaragoz.org
>>
>> *-----------------------------------------*
>>
>>
>> _______________________________________________
>> 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://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
>> Kamailio World Conference, April 16-17, 2013, Berlin
>> - http://conference.kamailio.com -
>>
>>
>> _______________________________________________
>> 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
>>
>>
>
>
> --
> *Bayram KARAGÖZ*
>
> *NGN Engineer*
>
> *-----------------------------------------*
>
> *@* bayram(a)bayramkaragoz.org
>
> *:** *www.bayramkaragoz.org
>
> *-----------------------------------------*
>
>
> --
> Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
> Kamailio World Conference, April 16-17, 2013, Berlin
> - http://conference.kamailio.com -
>
>
--
*Bayram KARAGÖZ*
*NGN Engineer*
*-----------------------------------------*
*@* bayram(a)bayramkaragoz.org
*:** *www.bayramkaragoz.org
*-----------------------------------------*
--
*Bayram KARAGÖZ*
*NGN Engineer*
*-----------------------------------------*
*@* bayram(a)bayramkaragoz.org
*:** *www.bayramkaragoz.org
*-----------------------------------------*
Hello,
we have published the first set of accepted speeches at Kamailio World
Conference, you can view the current draft of the schedule at:
- http://conference.kamailio.com/k01/schedule/
There are already about 15 speakers and presentations in the agenda for
the two days of conference, other proposals being in the review queue.
Another good news is that business environment around Kamailio project
is growing, the sponsors of Kamailio World Conference, Sipwise, Sipgate
and Asipto are looking to hire or subcontract new talents, check the
Career & Jobs page at:
- http://conference.kamailio.com/k01/career-jobs/
Greetings again to our community members that participated at Fosdem, we
were quite a big group there, unfortunately not much time to catch up in
detail with everyone.
Looking forward to see many of you in Berlin as well,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, April 16-17, 2013, Berlin
- http://conference.kamailio.com -
Hi All
Got a problem handling redirects when more than one phone is ringing. The setup is this;
Phone1 - Extension 100
Phone 2 - Extension 101
Phone 3 - Extension 102 & 101
When Phone 1 rings Extension 101 Phones 2 & 3 ring correctly as you would expect.
If Phone 2 now sets the on phone forward/redirect we see the following;
Phone 1 - Invite sent to 101
Phone 2 & 3 Receive Invites
Phone 2 responds with a 302 Redirect
Phone 3 Rings.
Which again is as you would expect.
The problem is that the 302 Message we're getting back is being seen in onreply_route where I cannot add a new branch to handle it. (Error - misused command append_branch / Command cannot be used in the block)
If Phone 3 is unavailable / times out / busy / or otherwise does not take the call we then see the 302 from Phone 2 arrive in failure_route where it is handled as expected.
The call flow we're trying to achieve is that the redirect is followed whilst the other available phone carries on ringing.
I've tried with failure_reply_mode as the default 0 and as 3, both do the same thing.
Currently working with kamailio version 3.4.0-dev6
Can anyone spot what I'm doing wrong ?
Thanks
Mark