Hello,
I'm using Kamailio 4.0.3 as a presence server. I read in the documentation that the MI interface is or will be deprecated so I decided to use XMLRPC to get presence information about the UAs registered to the Kamailio to feed into my application.
I reused the example Python xmlrpc example script to prove out that I could connect to Kamailio and retrieve any information. I tried executing this command
[root@hera home]# python xmlrpcclient.py GET '<?xml version='1.0'?><methodCall><methodName>usrLoc.statistics</methodName><params></params></methodCall>'
^Z
[4]+ Stopped python xmlrpcclient.py GET '<?xml version='1.0'?><methodCall><methodName>usrLoc.statistics</methodName><params></params></methodCall>'
It seems the command hangs, but I read in the kamailio.cfg file that Kamailio does not accept connections from Python's xmlrpclib so is this correct? Are there other libraries out there, I prefer Python but willing to give Lua a try. Or am I missing something something else, I made the script executable and its running locally on the local host and using port 5060.
The use case I'm trying to develop is send Kamailio the AoR/URI of a registered UA and get back its presence state (online/offline), that is it.
Regards,
Tony de Sousa
Thanks for looking at it, I have put in a notice message in the
failure_route and it's not showing in the log which suggests it's not
triggering this route at all.
I don't think it is treating the 401 as a failure route.
Keith
On Tue, Oct 8, 2013 at 1:54 PM, <sr-users-request(a)lists.sip-router.org>wrote:
> Send sr-users mailing list submissions to
> sr-users(a)lists.sip-router.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
> or, via email, send a message with subject or body 'help' to
> sr-users-request(a)lists.sip-router.org
>
> You can reach the person managing the list at
> sr-users-owner(a)lists.sip-router.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of sr-users digest..."
>
>
> Today's Topics:
>
> 1. Re: On register (Keith)
> 2. Re: On register (Daniel-Constantin Mierla)
> 3. Re: Apply changes made to sip reply in onreply_route
> (Klaus Darilion)
> 4. Re: Presence: Duplicate entry
> 'username-domain-presence-*#-OFFLINE-#*' for key 'presentity_idx'
> when multiple clients register using the same credentials (Yufei Tao)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 8 Oct 2013 12:31:20 +0100
> From: Keith <keith(a)hubner.co.uk>
> To: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) -
> Users Mailing List" <sr-users(a)lists.sip-router.org>
> Subject: Re: [SR-Users] On register
> Message-ID:
> <CAK7Ybu96QT+xt6BqJCjemai5En8uZ7VHigCg=
> AFvpP5tUYKXWw(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
> I am trying to "on register" from kamailio to an asterisk box. I am having
> trouble when asterisk sends a 401 to the first register response. I have
> tried to set a failure route as follows:
> t_on_failure("FAILURE_HANDLE");
>
> failure_route[FAILURE_HANDLE] {
>
> if (t_is_canceled()) {
> exit;
> }
>
> if(t_check_status("401")) {
> uac_auth();
> }
>
>
>
> t_relay();
> }
>
> But it doesn't see to send the credentials back.
>
> Any help would be appreciated.
> Thanks.
> Keith
>
Hi!
keep_hf("") keeps all headers, as every header matches the regexp "".
IMO an empty regexp should remove all headers (except the mandatory
ones). Otherwise I have to use something like
keep_hf("hope-this-header-never-exists")
regards
Klaus
Hello,
I've setup two Kamailio machines, one which does all the processing and the second one which always replies with a 500 Server Internal Error, to test my Dispatcher fail-over.
When routing a call, the call is always routed to the second Kamailio first, to test the fail-over.
What happens in this scenario is the 500 is received by the main Kamailio and the 500 message is duplicated to the capture server. After this the failure_route kicks in and the 500 is obviously never sent back to the initiator.
The changes made to the 500 message (adding a new header), in onreply_route, aren't present when the message is duplicated to the capture server, because the original 500 message is duplicated instead of the modified one.
I tried the following things, but none of them worked:
- Adding the header and calling sip_trace();, but this doesn't work since sip_trace() duplicated the message prior to changes made to it.
- Msg_apply_changes(), doesn't work either, since I can't use it in onreply_route
- Append_to_reply(), cannot be used from onreply_route
Appending new headers to replies works, but only when the reply is also sent back to the initiator, since I have the setflag(22) set. This makes sure the processed messages are also duplicated.
In this case the 500 is never sent back.
Anyone have an idea how to solve this?
Regards,
Grant
Hi,
I am trying to "on register" from kamailio to an asterisk box. I am having
trouble when asterisk sends a 401 to the first register response. I have
tried to set a failure route as follows:
t_on_failure("FAILURE_HANDLE");
failure_route[FAILURE_HANDLE] {
if (t_is_canceled()) {
exit;
}
if(t_check_status("401")) {
uac_auth();
}
t_relay();
}
But it doesn't see to send the credentials back.
Any help would be appreciated.
Thanks.
Keith
Hi list
i'm trying to set a session timeout in kamailio 4.0 debian repository, i'm
new with kamailio
i got this error, when established a call
- CRITICAL: dialog [dlg_timer.c:205]: update_dlg_timer(): Trying to update
a bogus dlg tl=0xb29bb454 tl->next=(nil) tl->prev=(nil)
- dialog [dlg_hash.c:987]: update_dlg_timeout(): failed to update dialog
lifetime
the config i applied are:
mod parameters:
# ---- dialog ----
modparam("dialog", "enable_stats",1)
modparam("dialog", "dlg_flag",4)
modparam("dialog", "db_url",DBURL)
modparam("dialog", "table_name", "dialog")
modparam("dialog", "db_mode",0)
#modparam("dialog", "default_timeout", 10)
modparam("dialog", "send_bye", 1)
modparam("dialog", "profiles_with_value", "caller")
modparam("dialog", "timeout_avp", "$avp(i:10)")
modparam("dialog", "dlg_match_mode",2)
modparam("dialog","detect_spirals",1)
route block:
# account only INVITEs
if (is_method("INVITE"))
{
setflag(FLT_ACC); # do accounting
#!ifdef WITH_DIALOG
dlg_manage();
dlg_set_timeout("10","$dlg(h_entry)","$dlg(h_id)");
$var(SIZE)=0;
get_profile_size("caller", "$rU", "$var(SIZE)");
if( $var(SIZE) >= 1 ){
xlog("DEBUG: Simultaneous calls limit
reached for $rU: $var(SIZE)\n");
sl_send_reply("503", "Simultaneous calls limit
reached");
exit;
}
set_dlg_profile("caller","$rU");
if(get_profile_size("caller","$var(SIZE)")) {
xlog("DEBUG: there are $var(SIZE) total
$dlg(h_id) calls for $rU\n");
}
#!endif
I hope could you help me thanks in advance
Hello sr mailing list,
I've been banging my head around this for a while. I have an interesting use case.
We have a remote site where the user's SIP phones register to a MetaSwitch Call Feature Server. This CFS supports all the presence RFCs like RFC 4235 (Dialog Event Package) and RFC 3856 (Presence Event Package).
Those users also have a GUI on their desk PC's that provide the user with information about the state our our application.
Now the use case, I want to have the "presence" state of the SIP phones (on-hook/Open, off-hook/InUse) displayed on the GUI. I already have the communication channel between the backend application server and the GUI. What I need guidance on is,
1. Is it possible to setup my Kamailio (4.0.3/CentOS 6.4 32 bit) to receive PUBLISH messages from the MetaSwitch CFS which is responsible for the Presentities under its control. I'm optimistic that this may be a simple SIP Trunk.
2. My application server (which would act as the Watcher) will need to subscribe to the presence events of a list of presentities I'm interested in. This could be done by using SIP and sending a SUBSCRIBE message, but my application doesn't have a SIP stack so is there a API to interact with the Presence module?
3. As per the RFCs and documentation the "watcher application" is responsible for consuming the NOTIFY messages. Once again my application doesn't have a SIP stack so is there a API that my application can poll for or can listen for presence event updates at a higher layer than SIP/SIMPLE
Any guidance would be appreciated.
Regards,
Tony de Sousa
When a client (S) subscribes to this contact (username@domain) whose
credentials are used by two clients, (S) gets NOTIFYs containing
statuses from either of the username@domain contacts in alternation. But
all these NOTIFYs have the same call-id.
I've tried remove the constraint 'CONSTRAINT presentity_idx UNIQUE
(username, domain, event, etag)' from the presentity table and the
errors have gone away. Just wondering if this is something that *should*
be done to cope with the situation where multiple presentities use the
same credentials.
Cheers,
Yufei
On 05/10/13 11:00, sr-users-request(a)lists.sip-router.org wrote:
> Hi
>
> I use kamailio 4.0.3 with presence. I sometimes get these errors:
>
> Oct 4 09:26:24 server /usr/sbin/kamailio[1292]: ERROR: presence
> [publish.c:171]: msg_presentity_clean(): Marking presentity
> Oct 4 09:26:34 server /usr/sbin/kamailio[1292]: ERROR: db_mysql
> [km_dbase.c:122]: db_mysql_submit_query(): driver error on query:
> Duplicate entry 'username-domain-presence-*#-OFFLINE-#*' for key
> 'presentity_idx'
> Oct 4 09:26:34 server /usr/sbin/kamailio[1292]: ERROR: <core>
> [db_query.c:337]: db_do_update(): error while submitting query
> Oct 4 09:26:34 server /usr/sbin/kamailio[1292]: ERROR: presence
> [presentity.c:1281]: mark_presentity_for_delete(): unsuccessful sql
> update operation
>
> This is when multiple SIP clients are registered using the same
> credentials, they each have a presentity entry, with the same username
> and domain but different etags, which is fine. But when they expire, the
> presentity.etag will be filled with '*#-OFFLINE-#*', and when both
> expire at about the same time, kamailio tries to fill both with the same
> '*#-OFFLINE-#*' etag. Because presentity table has a 'CONSTRAINT
> presentity_idx UNIQUE (username, domain, event, etag)', this gives the
> errors.
>
> Should the constraint be removed to cope with this situation?
>
> Thank you!
> Yufei
>
>
> --
> 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
>
>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 4 Oct 2013 14:30:23 +0300
> From: Juha Heinanen <jh(a)tutpro.com>
> To: "Kamailio \(SER\) - Users Mailing List"
> <sr-users(a)lists.sip-router.org>
> Subject: [SR-Users] Presence: Duplicate entry
> 'username-domain-presence-*#-OFFLINE-#*' for key 'presentity_idx' when
> multiple clients register using the same credentials
> Message-ID: <21070.42703.920666.161344(a)siika.tutpro.com>
> Content-Type: text/plain; charset=us-ascii
>
> Yufei Tao writes:
>
>> > This is when multiple SIP clients are registered using the same
>> > credentials, they each have a presentity entry, with the same username
>> > and domain but different etags, which is fine. But when they expire, the
>> > presentity.etag will be filled with '*#-OFFLINE-#*', and when both
>> > expire at about the same time, kamailio tries to fill both with the same
>> > '*#-OFFLINE-#*' etag. Because presentity table has a 'CONSTRAINT
>> > presentity_idx UNIQUE (username, domain, event, etag)', this gives the
>> > errors.
>> >
>> > Should the constraint be removed to cope with this situation?
> how are those '*#-OFFLINE-#*' records used? are both needed? does it
> make sense to publish different information for the same presentity by
> two UAs? if i subscribe to presence of that username@domain, do i get
> two notifys one from each or just one?
>
> -- juha
--
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
Does anyone have a working kamailio system that implements the IMS moduls
using mysql?
I see lots of examples when I search but still haven't pieced it together.
It would be really awesome if I could review somebody's working config and
see where I went wrong.
Thanks!!!!
Hello,
discussed last week during IRC development meeting, we are approaching
the time for getting out a new major release - to be numbered v4.1.x.
I would proposed October 7 as the last day do accept new features for
v4.1.0. That gives another three weeks to push new code. As a reminder,
those that have personal branches with new feature, should merge asap, too.
If the date is a constraint for some immediate plans, you can propose
another date and we will see which fits better.
Cheers,
Daniel
--
Daniel-Constantin Mierla - http://www.asipto.comhttp://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Trainings - Berlin, Oct 21-24; Miami, Nov 11-13, 2013
- more details about Kamailio trainings at http://www.asipto.com -