I am trying to set up XCAP support for SIP SIMPLE, and using jitsi as the sample client. The kamailio database was previously configured using ODBC and kamailio-4.1.3 and was apparently working correctly. I was following the guide at
http://nil.uniza.sk/instant-messaging/simple/configuring-xcap-support-im-an… as well as the standard documentation at http://kamailio.org/docs/modules/4.1.x/modules/xcap_server.html . However, the rls support is
currently disabled. When I use jitsi to connect, and add one contact to the empty contact list, I see the database being populated (mysql backend):
mysql> select * from xcap;
+----+-------------+-----------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-----------------------+--------+-----------------------------------------------------------------------+------+
| id | username | domain | doc | doc_type | etag | source | doc_uri | port |
+----+-------------+-----------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-----------------------+--------+-----------------------------------------------------------------------+------+
| 3 | avillacisIM | pbx.elastix.com | <?xml version="1.0" encoding="UTF-8" standalone="no"?><resource-lists xmlns="urn:ietf:params:xml:ns:resource-lists"><list name="RootGroup"><entry
uri="sip:bmacias@pbx.elastix.com"><display-name>bmacias</display-name></entry></list></resource-lists> | 4 | sr-1401316328-31413-1 | 0 | /xcap-root/resource-lists/users/sip:avillacisIM@pbx.elastix.com/index | 0 |
| 4 | avillacisIM | pbx.elastix.com | <?xml version="1.0" encoding="UTF-8" standalone="no"?><ruleset xmlns="urn:ietf:params:xml:ns:common-policy"><rule id="presence_allow"><conditions><identity><one
id="sip:bmacias@pbx.elastix.com"/></identity></conditions><actions><sub-handling xmlns="urn:ietf:params:xml:ns:pres-rules">allow</sub-handling></actions><transformations><provide-devices
xmlns="urn:ietf:params:xml:ns:pres-rules"><all-devices/></provide-devices><provide-persons xmlns="urn:ietf:params:xml:ns:pres-rules"><all-persons/></provide-persons><provide-services
xmlns="urn:ietf:params:xml:ns:pres-rules"><all-services/></provide-services></transformations></rule></ruleset> | 2 | sr-1401316328-31416-1 | 0 | /xcap-root/pres-rules/users/sip:avillacisIM@pbx.elastix.com/presrules | 0 |
+----+-------------+-----------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+-----------------------+--------+-----------------------------------------------------------------------+------+
2 rows in set (0.00 sec)
As far as I can see, both XML documents are well formed.
However, if I shutdown and then restart jitsi, I see (with wireshark) that the server returned a 500 Server Error when trying to fetch resource-lists . At the same time, the following appears on the log:
May 28 17:39:12 elx /usr/sbin/kamailio[31421]: ALERT: <script>: ===== xhttp: request [HTTP/1.1] GET => /xcap-root/xcap-caps/global/index
May 28 17:39:12 elx /usr/sbin/kamailio[31421]: ALERT: <script>: ===== xhttp: request [HTTP/1.1] GET => /xcap-root/xcap-caps/global/index
May 28 17:39:12 elx /usr/sbin/kamailio[31421]: ALERT: <script>: ===== xhttp: xcap-caps : <null>
May 28 17:39:12 elx /usr/sbin/kamailio[31413]: ALERT: <script>: ===== xhttp: request [HTTP/1.1] GET => /xcap-root/resource-lists/users/sip:avillacisIM@pbx.elastix.com/index
May 28 17:39:12 elx /usr/sbin/kamailio[31413]: ALERT: <script>: ===== xhttp: request [HTTP/1.1] GET => /xcap-root/resource-lists/users/sip:avillacisIM@pbx.elastix.com/index
May 28 17:39:12 elx /usr/sbin/kamailio[31413]: ALERT: <script>: ===== xhttp: resource-lists : sip:avillacisIM@pbx.elastix.com
May 28 17:39:12 elx /usr/sbin/kamailio[31413]: ERROR: xcap_server [xcap_server.c:758]: xcaps_get_db_doc(): invalid xml doc retrieved from database
May 28 17:39:12 elx /usr/sbin/kamailio[31413]: ERROR: xcap_server [xcap_server.c:1171]: w_xcaps_get(): could not fetch xcap document
What can I do to solve this issue. This is preventing contacts from being retrieved or added once the first contact is stored.
My event-route looks like this (WITH_XCAPSRV is defined elsewhere in the configuration):
#!ifdef WITH_XHTTP
event_route[xhttp:request] {
#!ifdef WITH_XHTTP_RPC
$var(xhttp_rpc_root) = $(hu{s.substr,0,9});
if ($var(xhttp_rpc_root) == "/http_rpc") {
dispatch_xhttp_rpc();
}
#!endif
#!ifdef WITH_XHTTP_PI
$var(xhttp_rpc_root) = $(hu{s.substr,0,8});
if ($var(xhttp_rpc_root) == "/http_pi") {
dispatch_xhttp_pi();
}
#!endif
#!ifdef WITH_XCAPSRV
if ($hu =~ "^/xcap-root/") {
route(XCAPSRV);
}
#!endif
set_reply_close();
set_reply_no_connect();
# if ($Rp != 80
##!ifdef WITH_TLS
# && $Rp != 443
##!endif
# ) {
#
# xlog("L_WARN", "HTTP request received on $Rp\n");
# xhttp_reply("403", "Forbidden", "text/html", "Forbidden");
# exit;
# }
xlog("L_DBG", "HTTP Request Received\n");
if ($hdr(Upgrade)=~"websocket"
&& $hdr(Connection)=~"Upgrade"
&& $rm=~"GET") {
# Validate Host - make sure the client is using the correct
# alias for WebSockets
if ($hdr(Host) == $null || !is_myself("sip:" + $hdr(Host))) {
xlog("L_WARN", "Bad host $hdr(Host)\n");
xhttp_reply("403", "Forbidden", "", "");
exit;
}
# Optional... validate Origin - make sure the client is from an
# authorised website. For example,
#
# if ($hdr(Origin) != "http://communicator.MY_DOMAIN"
# && $hdr(Origin) != "https://communicator.MY_DOMAIN") {
# xlog("L_WARN", "Unauthorised client $hdr(Origin)\n");
# xhttp_reply("403", "Forbidden", "", "");
# exit;
# }
# Optional... perform HTTP authentication
# ws_handle_handshake() exits (no further configuration file
# processing of the request) when complete.
if (ws_handle_handshake())
{
# Optional... cache some information about the
# successful connection
exit;
}
}
xhttp_reply("200", "OK", "text/html",
"<html><body>Wrong URL $hu</body></html>");
}
#!endif
#!ifdef WITH_XCAPSRV
route[XCAPSRV] {
xlog("L_ALERT", "===== xhttp: request [$rv] $rm => $hu\n");
# Remove port specification from Host header and use as authentication domain
$var(http_domain) = $(hdr(Host){s.select,0,:});
if (!www_authorize("$var(http_domain)", "subscriber")) {
www_challenge("$var(http_domain)", "0");
exit;
}
set_reply_close();
set_reply_no_connect();
if ($hu=~"^/xcap-root/oma_status-icon/users/.*/.*$")
$var(doc_uri) = $(hu{re.subst,/(^\/xcap-root\/)oma_status-icon(\/users\/.*\/).*$/\1org.openmobilealliance.pres-content\2oma_status-icon\/preseImage/});
else
$var(doc_uri) = $hu;
# xcap ops
$xcapuri(u=>data) = $var(doc_uri);
if($xcapuri(u=>xuid)=~"^sip:.+@.+")
$var(uri) = $xcapuri(u=>xuid);
else if($xcapuri(u=>xuid)=~".+@.+")
$var(uri) = "sip:" + $xcapuri(u=>xuid);
else
$var(uri) = "sip:"+ $xcapuri(u=>xuid) + "@" + $Ri;
xlog("L_ALERT", "===== xhttp: $xcapuri(u=>auid) : $xcapuri(u=>xuid)\n");
if ($xcapuri(u=>auid) == "xcap-caps") {
if ($rm == "GET") {
$var(xbody) =
"<?xml version='1.0' encoding='UTF-8'?>
<xcap-caps xmlns='urn:ietf:params:xml:ns:xcap-caps'>
<auids>
<auid>rls-services</auid>
<auid>pidf-manipulation</auid>
<auid>xcap-caps</auid>
<auid>resource-lists</auid>
<auid>pres-rules</auid>
<auid>org.openmobilealliance.pres-rules</auid>
<auid>org.openmobilealliance.user-profile</auid>
<auid>org.openmobilealliance.pres-content</auid>
<auid>org.openmobilealliance.search</auid>
<auid>org.openmobilealliance.xcap-directory</auid>
</auids>
<extensions></extensions>
<namespaces>
<namespace>urn:ietf:params:xml:ns:rls-services</namespace>
<namespace>urn:ietf:params:xml:ns:pidf</namespace>
<namespace>urn:ietf:params:xml:ns:xcap-caps</namespace>
<namespace>urn:ietf:params:xml:ns:resource-lists</namespace>
<namespace>urn:ietf:params:xml:ns:pres-rules</namespace>
<namespace>urn:oma:xml:xdm:user-profile</namespace>
<namespace>urn:oma:xml:prs:pres-content</namespace>
<namespace>urn:oma:xml:xdm:search</namespace>
<namespace>urn:oma:xml:xdm:xcap-directory</namespace>
</namespaces>
</xcap-caps>";
xhttp_reply("200", "OK", "application/xcap-caps+xml", "$var(xbody)");
} else {
append_to_reply("Allow: GET\r\n");
xhttp_reply("405", "Method Not Allowed", "", "");
}
exit;
}
# be sure auth user access only its documents
if ($au != $(var(uri){uri.user})) {
xhttp_reply("403", "Forbidden", "text/html", "<html><body>$si:$sp</body></html>");
exit;
}
switch($rm) {
case "PUT":
xcaps_put("$var(uri)", "$var(doc_uri)", "$rb");
if ($xcapuri(u=>auid) =~ "pres-rules") {
pres_update_watchers("$var(uri)", "presence");
pres_refresh_watchers("$var(uri)", "presence", 1);
# } else if ($xcapuri(u=>auid) =~ "rls-services" || $xcapuri(u=>auid) =~ "resource-lists") {
# rls_update_subs("$var(uri)", "presence");
} else if ($xcapuri(u=>auid) =~ "pidf-manipulation") {
pres_refresh_watchers("$var(uri)", "presence", 2, "$xcapuri(u=>uri_adoc)", "$xcapuri(u=>file)");
}
exit;
break;
case "GET":
xcaps_get("$var(uri)", "$var(doc_uri)");
exit;
break;
case "DELETE":
xcaps_del("$var(uri)", "$var(doc_uri)");
if ($xcapuri(u=>auid) =~ "pres-rules") {
pres_update_watchers("$var(uri)", "presence");
pres_refresh_watchers("$var(uri)", "presence", 1);
# } else if ($xcapuri(u=>auid) =~ "rls-services" || $xcapuri(u=>auid) =~ "resource-lists") {
# rls_update_subs("$var(uri)", "presence");
} else if ($xcapuri(u=>auid) =~ "pidf-manipulation") {
pres_refresh_watchers("$var(uri)", "presence", 2, "$xcapuri(u=>uri_adoc)", "$xcapuri(u=>file)");
}
exit;
break;
case "POST":
if ($xcapuri(u=>auid) =~ "search") {
xhttp_reply("501", "Not Implemented", "", "");
} else {
if ($xcapuri(u=>auid) =~ "xcap-directory") {
append_to_reply("Allow: GET\r\n");
} else {
append_to_reply("Allow: DELETE, GET, PUT\r\n");
}
xhttp_reply("405", "Method Not Allowed", "", "");
}
exit;
break;
}
# other http requests
xhttp_reply("404", "Not Found", "", "");
exit;
}
#!endif
Hi,
is there any way to return values from a call to python_exec function
orther than the default returned integer?
Following code generates this error:
Oct 1 09:08:23 zskio /usr/sbin/kamailio[21789]: ERROR: app_python
[python_support.c:38]: python_exec2: Unhandled exception in the Python
code:
Oct 1 09:08:23 zskio /usr/sbin/kamailio[21789]: ERROR: app_python
[python_support.c:78]: #011RuntimeError: no such function
if (!python_exec("get_provider",
$(var(clean_uri){s.prefixes}))) {
xlog("L_ERR","Can not choose a provider for $rU\n");
sl_send_reply("503","Can not choose a provider
for $rU");
exit;
}
def get_provider(self, msg, param):
# snipped code...
result = self.util.get_provider(prefixes, position, mode)
if result is not None:
LM_ERR("mode: %s position: %d result: %s" % (mode,
position, result))
# this raises error
msg.call_function('rewritehost', result['provider']['ip'])
return 1
return -1
I tried to use headers as transport but this simple code does not work:
Oct 1 09:45:31 zskio /usr/sbin/kamailio[22303]: ERROR: <script>: No header
if (!is_present_hf("X-Test-header")) {
xlog("L_ERROR", "No header\n");
}
else {
xlog("L_INFO", "Header added\n");
}
def test_set_header(self, msg):
msg.call_function('append_hf', 'X-Test-header: test\r\n')
return 1
Thanks in advance.
Hello,
I'm running Kamailio 4.1.3 and having a strange issue.
After a restart of Kamailio, some username are still in memory and updated
accordingly with usual re-REGISTER flow. But the entries in location db is
deleted. Kamailio tries to do a SQL UPDATE which fails because of that.
So, for each username which are not in location DB, I must do a "kamctl ul
rm" and wait for the next REGISTER. The new REGISTER will challenge the UAC
for a new Authorization which should result in an INSERT INTO instead of an
UPDATE.
Can someone help me to solve this?
Regards,
Igor.
Hello,
Kamailio crashes with this message:
May 29 12:03:45 kamfree-manager kamailio[8705]: : <core>
[mem/q_malloc.c:159]: qm_debug_frag(): BUG: qm_*: prev. fragm. tail
overwritten(c0c0c000, abcdefed)[0x7ff5a5031a98:0x7ff5a5031ac8]!
May 29 12:03:45 kamfree-manager kamailio[8697]: ALERT: <core> [main.c:775]:
handle_sigs(): child process 8705 exited by a signal 6
May 29 12:03:45 kamfree-manager kamailio[8697]: ALERT: <core> [main.c:778]:
handle_sigs(): core was generated
The problem is produced in this line of the script:
$rU = $dbr(ra=>[0,0]);
I'm using last commit in 4.1 branch
(ad5235229f59ba5d1f4216e144291e110fee0211) on Debian wheezy.
The backtrace:
#0 0x00007ff5a538b475 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ff5a538e6f0 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x0000000000546a00 in qm_debug_frag (qm=0x7ff5a4f58010,
f=0x7ff5a5031a98) at mem/q_malloc.c:161
#3 0x000000000054796d in qm_malloc (qm=0x7ff5a4f58010, size=1024,
file=0x5c9ec1 "<core>: action.c", func=0x5cb1d8 "do_action", line=832) at
mem/q_malloc.c:386
#4 0x000000000041affa in do_action (h=0x7fff810cd2b0, a=0x7fff810cd390,
msg=0x7ff5a502ed28) at action.c:832
#5 0x00007ff5a2295d88 in pv_set_ruri_user (msg=0x7ff5a502ed28,
param=0x7ff5a4fb3750, op=254, val=0x7fff810cd4e0) at pv_core.c:2073
#6 0x0000000000467bbf in lval_pvar_assign (h=0x7fff810d0200,
msg=0x7ff5a502ed28, lv=0x7ff5a501ea00, rv=0x7ff5a501f110) at lvalue.c:362
#7 0x00000000004680a5 in lval_assign (h=0x7fff810d0200,
msg=0x7ff5a502ed28, lv=0x7ff5a501ea00, rve=0x7ff5a501f108) at lvalue.c:410
#8 0x0000000000423fec in do_action (h=0x7fff810d0200, a=0x7ff5a501eb68,
msg=0x7ff5a502ed28) at action.c:1478
#9 0x0000000000424d70 in run_actions (h=0x7fff810d0200, a=0x7ff5a5013ee0,
msg=0x7ff5a502ed28) at action.c:1599
#10 0x000000000041c18d in do_action (h=0x7fff810d0200, a=0x7ff5a5020a10,
msg=0x7ff5a502ed28) at action.c:1090
#11 0x0000000000424d70 in run_actions (h=0x7fff810d0200, a=0x7ff5a5020a10,
msg=0x7ff5a502ed28) at action.c:1599
#12 0x000000000041c18d in do_action (h=0x7fff810d0200, a=0x7ff5a5020e50,
msg=0x7ff5a502ed28) at action.c:1090
#13 0x0000000000424d70 in run_actions (h=0x7fff810d0200, a=0x7ff5a50119b0,
msg=0x7ff5a502ed28) at action.c:1599
#14 0x000000000041a2b7 in do_action (h=0x7fff810d0200, a=0x7ff5a4fd3fc0,
msg=0x7ff5a502ed28) at action.c:715
#15 0x0000000000424d70 in run_actions (h=0x7fff810d0200, a=0x7ff5a4fd2800,
msg=0x7ff5a502ed28) at action.c:1599
#16 0x0000000000422c70 in do_action (h=0x7fff810d0200, a=0x7ff5a4fd7af0,
msg=0x7ff5a502ed28) at action.c:1235
#17 0x0000000000424d70 in run_actions (h=0x7fff810d0200, a=0x7ff5a4fd1ed8,
msg=0x7ff5a502ed28) at action.c:1599
#18 0x000000000041c18d in do_action (h=0x7fff810d0200, a=0x7ff5a4fd7d10,
msg=0x7ff5a502ed28) at action.c:1090
#19 0x0000000000424d70 in run_actions (h=0x7fff810d0200, a=0x7ff5a4fcf1d8,
msg=0x7ff5a502ed28) at action.c:1599
#20 0x000000000041a2b7 in do_action (h=0x7fff810d0200, a=0x7ff5a4fb7d88,
msg=0x7ff5a502ed28) at action.c:715
#21 0x0000000000424d70 in run_actions (h=0x7fff810d0200, a=0x7ff5a4fb6b68,
msg=0x7ff5a502ed28) at action.c:1599
#22 0x000000000041c18d in do_action (h=0x7fff810d0200, a=0x7ff5a4fb9838,
msg=0x7ff5a502ed28) at action.c:1090
#23 0x0000000000424d70 in run_actions (h=0x7fff810d0200, a=0x7ff5a4faf5a0,
msg=0x7ff5a502ed28) at action.c:1599
#24 0x0000000000425524 in run_top_route (a=0x7ff5a4faf5a0,
msg=0x7ff5a502ed28, c=0x0) at action.c:1685
#25 0x00000000004a6fdb in receive_msg (
buf=0x921920 "INVITE sip:2000@vpbx2.ur SIP/2.0\r\nVia: SIP/2.0/UDP
192.168.0.101;rport;branch=z9hG4bK14cFrXZ0N53jS\r\nMax-Forwards:
67\r\nFrom: \"1000\" <sip:1000@vpbx1.ur>;tag=FjmFN79ZrXH0e\r\nTo:
<sip:2000@vpbx2.ur>\r\nCall-"..., len=1061, rcv_info=0x7fff810d04b0) at
receive.c:212
#26 0x000000000053c544 in udp_rcv_loop () at udp_server.c:536
---Type <return> to continue, or q <return> to quit---
#27 0x000000000046ee54 in main_loop () at main.c:1617
#28 0x0000000000471df4 in main (argc=3, argv=0x7fff810d07e8) at main.c:2533
Complete log: http://pastebin.com/YZirUkfe
Thanks.
Regards,
--
*Andrés Souto*
VoIP Engineer @ Quobis <http://www.quobis.com/> | e: andres.souto(a)quobis.com |
t: +34902999465
Is there any way to extract Expires from 200 OK (response to REGISTER) ? I will need to re-use this value in 3rd party registration being sent to application server.
Thanks for any hints ..
--
Daniel Ciprus
Integration engineer
http://www.acision.com
9954 Mayland Dr
Suite 3100
Richmond, VA 23233
USA
T: +1 804 762 5601
E: daniel.ciprus(a)acision.com<mailto:daniel.ciprus@acision.com>
________________________________
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you for understanding.
Dear Sir/Madam,
We setup the Linksys SPA3000 to make a call via IPTEL.ORG in between
my family members around the world.
But recently, we found out that we cannot dial out.
So, would you please help to check this ?
Regards,
Tommy.
Hi,
I am first in kamailio,I have installed the kamailio from source code
and added a user using kamctl,Now I can connect with that user from soft
phone.
My task is making a Load balancer and fail over for asterisk servers, I
have some other asterisk servers, I need make the kamailio as a Load
balancer, How can I do that?
1. I need to forward all calls to asterisks servers.
2. I have created a Dispatcher list in db, how can I configure that?
Please help me on this.
Hopefully,
Bajeesh T.B
Hi,
I tried to compile Kamailio on Freescale P2020RDB-PCA.And I'm getting the
following error
bison -d -b cfg cfg.y
make: *** [cfg.tab.h] Broken Pipe
When i run that command without running 'make'. Just 'bison -d -b cfg
cfg.y'.It was working.So found from Internet that it could be the problem
with memory when the bison process is running.So I allocated a swap file
for the build process.
dd if=/dev/zero of=swapfile.1 bs=1048576 count=100 ; mkswap ./swapfile.1 ;
swapon ./swapfile.1
But after that attempt also I'm still getting the make: *** [cfg.tab.h]
Broken Pipe when Im doing the compilation.
Yours recommendations will be very helpful.
Thanks
Ashwin
--
View this message in context: http://sip-router.1086192.n5.nabble.com/Kamailio-on-PPC-tp128097.html
Sent from the Users mailing list archive at Nabble.com.