Hello,
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I'd like to automate the process of reloading the table. Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside? Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command "kamctl dispatcher reload" then exit? Not that hard either, but there might be a finer solution available.
Regards,
Grant
2013/9/25 Grant Bagdasarian GB@cm.nl:
Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside?
Maybe this[0]?
[0] http://kamailio.org/docs/modules/4.0.x/modules/mi_xmlrpc.html
Hi,
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,
Charles
On 25 September 2013 11:40, Grant Bagdasarian GB@cm.nl wrote:
Hello,****
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I’d like to automate the process of reloading the table.****
Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside?****
Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command “kamctl dispatcher reload” then exit? Not that hard either, but there might be a finer solution available.****
Regards,****
Grant****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Thanks, I'll have a look at it. Looks much easier than setting up Ssh connections programmatically.
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Wednesday, September 25, 2013 1:12 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,
Charles
On 25 September 2013 11:40, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I'd like to automate the process of reloading the table. Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside? Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command "kamctl dispatcher reload" then exit? Not that hard either, but there might be a finer solution available.
Regards,
Grant
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
What am I doing wrong here?
# ----- xhttp params ------ modparam("xhttp", "url_match", "null")
# ----- xhttp_rpc params ------ modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")
####### Routing Logic ########
event_route[xhttp:request] { xlog("L_INFO", "************************************** RECEIVED NEW HTTP REQUEST: $hu *********************************"); xhttp_reply("200", "OK", "text/html","<html><body>OK - Request Received</body></html>"); }
It seems like Kamailio isn't receiving the HTTP requests. Im doing a simple HTTP GET (http://192.168.1.10/http_rpc) using my browser to see if it hits the event_route.
From what I understand, the RCP command is in the url of the HTTP request, and is extracted using string transformations.
I've never done anything with RPC directly, so maybe I'm just wrong.
Also, I don't see Kamailio binding to the HTTP port. The xhttp_rpc_root param only allows alphanumeric values, so I can't specify a full URL.
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 10:04 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Thanks, I'll have a look at it. Looks much easier than setting up Ssh connections programmatically.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Wednesday, September 25, 2013 1:12 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,
Charles
On 25 September 2013 11:40, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I'd like to automate the process of reloading the table. Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside? Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command "kamctl dispatcher reload" then exit? Not that hard either, but there might be a finer solution available.
Regards,
Grant
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
Hi,
Have you added the appropriate listen= and/or port= directive to your config?
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen http://www.kamailio.org/wiki/cookbooks/4.0.x/core#port
Also make sure you have not disabled TCP.
Regards,
Charles
On 27 September 2013 12:27, Grant Bagdasarian GB@cm.nl wrote:
What am I doing wrong here?****
# ----- xhttp params ------****
modparam("xhttp", "url_match", "null")****
# ----- xhttp_rpc params ------****
modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")****
####### Routing Logic ########****
event_route[xhttp:request] {****
xlog("L_INFO", "************************************** RECEIVED
NEW HTTP REQUEST: $hu *********************************");****
xhttp_reply("200", "OK", "text/html","<html><body>OK – Request
Received</body></html>");****
}****
It seems like Kamailio isn’t receiving the HTTP requests.****
Im doing a simple HTTP GET (http://192.168.1.10/http_rpc) using my browser to see if it hits the event_route.****
From what I understand, the RCP command is in the url of the HTTP request, and is extracted using string transformations.****
I’ve never done anything with RPC directly, so maybe I’m just wrong.****
Also, I don’t see Kamailio binding to the HTTP port.****
The xhttp_rpc_root param only allows alphanumeric values, so I can’t specify a full URL.****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Grant Bagdasarian *Sent:* Friday, September 27, 2013 10:04 AM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Thanks, I’ll have a look at it. ****
Looks much easier than setting up Ssh connections programmatically. ****
*From:* sr-users-bounces@lists.sip-router.org [ mailto:sr-users-bounces@lists.sip-router.orgsr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Wednesday, September 25, 2013 1:12 PM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.****
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,****
Charles****
On 25 September 2013 11:40, Grant Bagdasarian GB@cm.nl wrote:****
Hello,****
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I’d like to automate the process of reloading the table.****
Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside?****
Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command “kamctl dispatcher reload” then exit? Not that hard either, but there might be a finer solution available.****
Regards,****
Grant****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Right! Totally forgot about that.
Thanks, Kamailio is now receiving the requests!
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 1:35 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Have you added the appropriate listen= and/or port= directive to your config?
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen http://www.kamailio.org/wiki/cookbooks/4.0.x/core#port
Also make sure you have not disabled TCP.
Regards,
Charles
On 27 September 2013 12:27, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: What am I doing wrong here?
# ----- xhttp params ------ modparam("xhttp", "url_match", "null")
# ----- xhttp_rpc params ------ modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")
####### Routing Logic ########
event_route[xhttp:request] { xlog("L_INFO", "************************************** RECEIVED NEW HTTP REQUEST: $hu *********************************"); xhttp_reply("200", "OK", "text/html","<html><body>OK - Request Received</body></html>"); }
It seems like Kamailio isn't receiving the HTTP requests. Im doing a simple HTTP GET (http://192.168.1.10/http_rpc) using my browser to see if it hits the event_route.
From what I understand, the RCP command is in the url of the HTTP request, and is extracted using string transformations.
I've never done anything with RPC directly, so maybe I'm just wrong.
Also, I don't see Kamailio binding to the HTTP port. The xhttp_rpc_root param only allows alphanumeric values, so I can't specify a full URL.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 10:04 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Thanks, I'll have a look at it. Looks much easier than setting up Ssh connections programmatically.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Wednesday, September 25, 2013 1:12 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,
Charles
On 25 September 2013 11:40, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I'd like to automate the process of reloading the table. Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside? Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command "kamctl dispatcher reload" then exit? Not that hard either, but there might be a finer solution available.
Regards,
Grant
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
What kind of DB handler do I need for the dispatcher module?
When executing the dispatcher.reload command I'm receiving the following error: 8(10201) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler
root@proxy01:~# kamctl dispatcher reload ERROR: This command requires a database engine - none was loaded
My Dispatcher table is loaded using db_unixodbc, because we are using MSSQL.
loadmodule "mi_fifo.so" loadmodule "kex.so" loadmodule "corex.so" loadmodule "tm.so" loadmodule "tmx.so" loadmodule "sl.so" loadmodule "rr.so" loadmodule "pv.so" loadmodule "maxfwd.so" loadmodule "textops.so" loadmodule "textopsx.so" loadmodule "siputils.so" loadmodule "xlog.so" loadmodule "sanity.so" loadmodule "db_unixodbc.so" loadmodule "sqlops.so" loadmodule "dispatcher.so" loadmodule "siptrace.so" loadmodule "avp.so" loadmodule "cfgutils.so" loadmodule "xhttp.so" loadmodule "xhttp_rpc.so"
# ----- db_unixodbc params ----- modparam("db_unixodbc", "ping_interval", 600) modparam("db_unixodbc", "auto_reconnect", 0) modparam("db_unixodbc", "use_escape_common", 1)
modparam("dispatcher", "db_url","unixodbc://domain\myusername:mypassword@10.0.0.1/Kamailio") modparam("dispatcher", "table_name", "Dispatcher") modparam("dispatcher", "setid_col", "SetID") modparam("dispatcher", "destination_col", "Destination") modparam("dispatcher", "priority_col", "[Priority]") modparam("dispatcher", "flags_col", "Flags") modparam("dispatcher", "attrs_col", "Attributes") modparam("dispatcher", "flags", 2) modparam("dispatcher", "dst_avp", "$avp(dsdst)") modparam("dispatcher", "grp_avp", "$avp(dsgrp)") modparam("dispatcher", "cnt_avp", "$avp(dscnt)") modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")
The Dispatcher table is loaded just fine on startup of Kamailio. kamctl fifo ds_list shows the table data.
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 1:39 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Right! Totally forgot about that.
Thanks, Kamailio is now receiving the requests!
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 1:35 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Have you added the appropriate listen= and/or port= directive to your config?
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen http://www.kamailio.org/wiki/cookbooks/4.0.x/core#port
Also make sure you have not disabled TCP.
Regards,
Charles
On 27 September 2013 12:27, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: What am I doing wrong here?
# ----- xhttp params ------ modparam("xhttp", "url_match", "null")
# ----- xhttp_rpc params ------ modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")
####### Routing Logic ########
event_route[xhttp:request] { xlog("L_INFO", "************************************** RECEIVED NEW HTTP REQUEST: $hu *********************************"); xhttp_reply("200", "OK", "text/html","<html><body>OK - Request Received</body></html>"); }
It seems like Kamailio isn't receiving the HTTP requests. Im doing a simple HTTP GET (http://192.168.1.10/http_rpc) using my browser to see if it hits the event_route.
From what I understand, the RCP command is in the url of the HTTP request, and is extracted using string transformations.
I've never done anything with RPC directly, so maybe I'm just wrong.
Also, I don't see Kamailio binding to the HTTP port. The xhttp_rpc_root param only allows alphanumeric values, so I can't specify a full URL.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 10:04 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Thanks, I'll have a look at it. Looks much easier than setting up Ssh connections programmatically.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Wednesday, September 25, 2013 1:12 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,
Charles
On 25 September 2013 11:40, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I'd like to automate the process of reloading the table. Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside? Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command "kamctl dispatcher reload" then exit? Not that hard either, but there might be a finer solution available.
Regards,
Grant
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
Hi,
I think you are mixing up the MI and RPC commands.
Try:
kamctl fifo ds_reload
or
kamcmd dispatcher.reload
(note the difference between kamctl and kamcmd)
Regards,
Charles
On 27 September 2013 12:57, Grant Bagdasarian GB@cm.nl wrote:
What kind of DB handler do I need for the dispatcher module?****
When executing the dispatcher.reload command I’m receiving the following error: ****
8(10201) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler****
root@proxy01:~# kamctl dispatcher reload****
ERROR: This command requires a database engine - none was loaded****
My Dispatcher table is loaded using db_unixodbc, because we are using MSSQL.****
loadmodule "mi_fifo.so"****
loadmodule "kex.so"****
loadmodule "corex.so"****
loadmodule "tm.so"****
loadmodule "tmx.so"****
loadmodule "sl.so"****
loadmodule "rr.so"****
loadmodule "pv.so"****
loadmodule "maxfwd.so"****
loadmodule "textops.so"****
loadmodule "textopsx.so"****
loadmodule "siputils.so"****
loadmodule "xlog.so"****
loadmodule "sanity.so"****
loadmodule "db_unixodbc.so"****
loadmodule "sqlops.so"****
loadmodule "dispatcher.so"****
loadmodule "siptrace.so"****
loadmodule "avp.so"****
loadmodule "cfgutils.so"****
loadmodule "xhttp.so"****
loadmodule "xhttp_rpc.so"****
# ----- db_unixodbc params -----****
modparam("db_unixodbc", "ping_interval", 600)****
modparam("db_unixodbc", "auto_reconnect", 0)****
modparam("db_unixodbc", "use_escape_common", 1)****
modparam("dispatcher", "db_url","unixodbc://domain\ myusername:mypassword@10.0.0.1/Kamailio")****
modparam("dispatcher", "table_name", "Dispatcher")****
modparam("dispatcher", "setid_col", "SetID")****
modparam("dispatcher", "destination_col", "Destination")****
modparam("dispatcher", "priority_col", "[Priority]")****
modparam("dispatcher", "flags_col", "Flags")****
modparam("dispatcher", "attrs_col", "Attributes")****
modparam("dispatcher", "flags", 2)****
modparam("dispatcher", "dst_avp", "$avp(dsdst)")****
modparam("dispatcher", "grp_avp", "$avp(dsgrp)")****
modparam("dispatcher", "cnt_avp", "$avp(dscnt)")****
modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")****
The Dispatcher table is loaded just fine on startup of Kamailio.****
kamctl fifo ds_list shows the table data. ****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Grant Bagdasarian *Sent:* Friday, September 27, 2013 1:39 PM
*To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Right! Totally forgot about that.****
Thanks, Kamailio is now receiving the requests!****
*From:* sr-users-bounces@lists.sip-router.org [ mailto:sr-users-bounces@lists.sip-router.orgsr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Friday, September 27, 2013 1:35 PM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
Have you added the appropriate listen= and/or port= directive to your config?****
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen****
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#port****
Also make sure you have not disabled TCP.****
Regards,****
Charles****
On 27 September 2013 12:27, Grant Bagdasarian GB@cm.nl wrote:****
What am I doing wrong here?****
# ----- xhttp params ------****
modparam("xhttp", "url_match", "null")****
# ----- xhttp_rpc params ------****
modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")****
####### Routing Logic ########****
event_route[xhttp:request] {****
xlog("L_INFO", "************************************** RECEIVED
NEW HTTP REQUEST: $hu *********************************");****
xhttp_reply("200", "OK", "text/html","<html><body>OK – Request
Received</body></html>");****
}****
It seems like Kamailio isn’t receiving the HTTP requests.****
Im doing a simple HTTP GET (http://192.168.1.10/http_rpc) using my browser to see if it hits the event_route.****
From what I understand, the RCP command is in the url of the HTTP request, and is extracted using string transformations.****
I’ve never done anything with RPC directly, so maybe I’m just wrong.****
Also, I don’t see Kamailio binding to the HTTP port.****
The xhttp_rpc_root param only allows alphanumeric values, so I can’t specify a full URL.****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Grant Bagdasarian *Sent:* Friday, September 27, 2013 10:04 AM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Thanks, I’ll have a look at it. ****
Looks much easier than setting up Ssh connections programmatically. ****
*From:* sr-users-bounces@lists.sip-router.org [ mailto:sr-users-bounces@lists.sip-router.orgsr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Wednesday, September 25, 2013 1:12 PM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.****
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,****
Charles****
On 25 September 2013 11:40, Grant Bagdasarian GB@cm.nl wrote:****
Hello,****
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I’d like to automate the process of reloading the table.****
Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside?****
Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command “kamctl dispatcher reload” then exit? Not that hard either, but there might be a finer solution available.****
Regards,****
Grant****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
The kamctl fifo ds_reload command works when I use it in putty. The kamcmd dispatcher.reload command does NOT work.
Gives me the following error: root@proxy01:~# kamcmd dispatcher.reload ERROR: connect_unix_sock: connect(/tmp/kamailio_ctl): Connection refused [111]
http://192.168.1.10/http_rpc/dispatcher/dispatcher.reload?arg=dispatcher.rel...
10(10232) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler .... HTTP/1.1 500 Reload Failed Via: SIP/2.0/TCP 192.168.1.11:51065 Content-Type: text/html Server: kamailio (4.0.2 (x86_64/linux)) Content-Length: 2095
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 2:10 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
I think you are mixing up the MI and RPC commands.
Try:
kamctl fifo ds_reload
or
kamcmd dispatcher.reload
(note the difference between kamctl and kamcmd)
Regards,
Charles
On 27 September 2013 12:57, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: What kind of DB handler do I need for the dispatcher module?
When executing the dispatcher.reload command I'm receiving the following error: 8(10201) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler
root@proxy01:~# kamctl dispatcher reload ERROR: This command requires a database engine - none was loaded
My Dispatcher table is loaded using db_unixodbc, because we are using MSSQL.
loadmodule "mi_fifo.so" loadmodule "kex.so" loadmodule "corex.so" loadmodule "tm.so" loadmodule "tmx.so" loadmodule "sl.so" loadmodule "rr.so" loadmodule "pv.so" loadmodule "maxfwd.so" loadmodule "textops.so" loadmodule "textopsx.so" loadmodule "siputils.so" loadmodule "xlog.so" loadmodule "sanity.so" loadmodule "db_unixodbc.so" loadmodule "sqlops.so" loadmodule "dispatcher.so" loadmodule "siptrace.so" loadmodule "avp.so" loadmodule "cfgutils.so" loadmodule "xhttp.so" loadmodule "xhttp_rpc.so"
# ----- db_unixodbc params ----- modparam("db_unixodbc", "ping_interval", 600) modparam("db_unixodbc", "auto_reconnect", 0) modparam("db_unixodbc", "use_escape_common", 1)
modparam("dispatcher", "db_url","unixodbc://domain\myusername:mypassword@10.0.0.1/Kamailiohttp://myusername:mypassword@10.0.0.1/Kamailio") modparam("dispatcher", "table_name", "Dispatcher") modparam("dispatcher", "setid_col", "SetID") modparam("dispatcher", "destination_col", "Destination") modparam("dispatcher", "priority_col", "[Priority]") modparam("dispatcher", "flags_col", "Flags") modparam("dispatcher", "attrs_col", "Attributes") modparam("dispatcher", "flags", 2) modparam("dispatcher", "dst_avp", "$avp(dsdst)") modparam("dispatcher", "grp_avp", "$avp(dsgrp)") modparam("dispatcher", "cnt_avp", "$avp(dscnt)") modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")
The Dispatcher table is loaded just fine on startup of Kamailio. kamctl fifo ds_list shows the table data.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 1:39 PM
To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Right! Totally forgot about that.
Thanks, Kamailio is now receiving the requests!
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 1:35 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Have you added the appropriate listen= and/or port= directive to your config?
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen http://www.kamailio.org/wiki/cookbooks/4.0.x/core#port
Also make sure you have not disabled TCP.
Regards,
Charles
On 27 September 2013 12:27, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: What am I doing wrong here?
# ----- xhttp params ------ modparam("xhttp", "url_match", "null")
# ----- xhttp_rpc params ------ modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")
####### Routing Logic ########
event_route[xhttp:request] { xlog("L_INFO", "************************************** RECEIVED NEW HTTP REQUEST: $hu *********************************"); xhttp_reply("200", "OK", "text/html","<html><body>OK - Request Received</body></html>"); }
It seems like Kamailio isn't receiving the HTTP requests. Im doing a simple HTTP GET (http://192.168.1.10/http_rpc) using my browser to see if it hits the event_route.
From what I understand, the RCP command is in the url of the HTTP request, and is extracted using string transformations.
I've never done anything with RPC directly, so maybe I'm just wrong.
Also, I don't see Kamailio binding to the HTTP port. The xhttp_rpc_root param only allows alphanumeric values, so I can't specify a full URL.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 10:04 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Thanks, I'll have a look at it. Looks much easier than setting up Ssh connections programmatically.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Wednesday, September 25, 2013 1:12 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,
Charles
On 25 September 2013 11:40, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I'd like to automate the process of reloading the table. Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside? Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command "kamctl dispatcher reload" then exit? Not that hard either, but there might be a finer solution available.
Regards,
Grant
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
Hi,
Regarding kamcmd failure - do you have the ctl module loaded?
Regards,
Charles
On 27 September 2013 13:18, Grant Bagdasarian GB@cm.nl wrote:
Hello,****
The kamctl fifo ds_reload command works when I use it in putty.****
The kamcmd dispatcher.reload command does NOT work.****
Gives me the following error:****
root@proxy01:~# kamcmd dispatcher.reload****
ERROR: connect_unix_sock: connect(/tmp/kamailio_ctl): Connection refused [111]****
http://192.168.1.10/http_rpc/dispatcher/dispatcher.reload?arg=dispatcher.rel...
10(10232) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler****
….****
HTTP/1.1 500 Reload Failed****
Via: SIP/2.0/TCP 192.168.1.11:51065****
Content-Type: text/html****
Server: kamailio (4.0.2 (x86_64/linux))****
Content-Length: 2095****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Friday, September 27, 2013 2:10 PM
*To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
I think you are mixing up the MI and RPC commands.****
Try:****
kamctl fifo ds_reload****
or****
kamcmd dispatcher.reload****
(note the difference between kamctl and kamcmd)****
Regards,****
Charles****
On 27 September 2013 12:57, Grant Bagdasarian GB@cm.nl wrote:****
What kind of DB handler do I need for the dispatcher module?****
When executing the dispatcher.reload command I’m receiving the following error: ****
8(10201) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler****
root@proxy01:~# kamctl dispatcher reload****
ERROR: This command requires a database engine - none was loaded****
My Dispatcher table is loaded using db_unixodbc, because we are using MSSQL.****
loadmodule "mi_fifo.so"****
loadmodule "kex.so"****
loadmodule "corex.so"****
loadmodule "tm.so"****
loadmodule "tmx.so"****
loadmodule "sl.so"****
loadmodule "rr.so"****
loadmodule "pv.so"****
loadmodule "maxfwd.so"****
loadmodule "textops.so"****
loadmodule "textopsx.so"****
loadmodule "siputils.so"****
loadmodule "xlog.so"****
loadmodule "sanity.so"****
loadmodule "db_unixodbc.so"****
loadmodule "sqlops.so"****
loadmodule "dispatcher.so"****
loadmodule "siptrace.so"****
loadmodule "avp.so"****
loadmodule "cfgutils.so"****
loadmodule "xhttp.so"****
loadmodule "xhttp_rpc.so"****
# ----- db_unixodbc params -----****
modparam("db_unixodbc", "ping_interval", 600)****
modparam("db_unixodbc", "auto_reconnect", 0)****
modparam("db_unixodbc", "use_escape_common", 1)****
modparam("dispatcher", "db_url","unixodbc://domain\ myusername:mypassword@10.0.0.1/Kamailio")****
modparam("dispatcher", "table_name", "Dispatcher")****
modparam("dispatcher", "setid_col", "SetID")****
modparam("dispatcher", "destination_col", "Destination")****
modparam("dispatcher", "priority_col", "[Priority]")****
modparam("dispatcher", "flags_col", "Flags")****
modparam("dispatcher", "attrs_col", "Attributes")****
modparam("dispatcher", "flags", 2)****
modparam("dispatcher", "dst_avp", "$avp(dsdst)")****
modparam("dispatcher", "grp_avp", "$avp(dsgrp)")****
modparam("dispatcher", "cnt_avp", "$avp(dscnt)")****
modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")****
The Dispatcher table is loaded just fine on startup of Kamailio.****
kamctl fifo ds_list shows the table data. ****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Grant Bagdasarian *Sent:* Friday, September 27, 2013 1:39 PM****
*To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Right! Totally forgot about that.****
Thanks, Kamailio is now receiving the requests!****
*From:* sr-users-bounces@lists.sip-router.org [ mailto:sr-users-bounces@lists.sip-router.orgsr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Friday, September 27, 2013 1:35 PM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
Have you added the appropriate listen= and/or port= directive to your config?****
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen****
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#port****
Also make sure you have not disabled TCP.****
Regards,****
Charles****
On 27 September 2013 12:27, Grant Bagdasarian GB@cm.nl wrote:****
What am I doing wrong here?****
# ----- xhttp params ------****
modparam("xhttp", "url_match", "null")****
# ----- xhttp_rpc params ------****
modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")****
####### Routing Logic ########****
event_route[xhttp:request] {****
xlog("L_INFO", "************************************** RECEIVED
NEW HTTP REQUEST: $hu *********************************");****
xhttp_reply("200", "OK", "text/html","<html><body>OK – Request
Received</body></html>");****
}****
It seems like Kamailio isn’t receiving the HTTP requests.****
Im doing a simple HTTP GET (http://192.168.1.10/http_rpc) using my browser to see if it hits the event_route.****
From what I understand, the RCP command is in the url of the HTTP request, and is extracted using string transformations.****
I’ve never done anything with RPC directly, so maybe I’m just wrong.****
Also, I don’t see Kamailio binding to the HTTP port.****
The xhttp_rpc_root param only allows alphanumeric values, so I can’t specify a full URL.****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Grant Bagdasarian *Sent:* Friday, September 27, 2013 10:04 AM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Thanks, I’ll have a look at it. ****
Looks much easier than setting up Ssh connections programmatically. ****
*From:* sr-users-bounces@lists.sip-router.org [ mailto:sr-users-bounces@lists.sip-router.orgsr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Wednesday, September 25, 2013 1:12 PM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.****
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,****
Charles****
On 25 September 2013 11:40, Grant Bagdasarian GB@cm.nl wrote:****
Hello,****
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I’d like to automate the process of reloading the table.****
Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside?****
Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command “kamctl dispatcher reload” then exit? Not that hard either, but there might be a finer solution available.****
Regards,****
Grant****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
I didn't, but I just loaded it, but I haven't set any modparams yet.
Now it's giving me more error output:
root@prox01:~# kamcmd dispatcher.reload 8(11010) DEBUG: ctl [../../io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x7f9211dab440, 11, 3, 0xa02cf0), fd_no=1 8(11010) DEBUG: ctl [io_listener.c:453]: handle_new_connect(): handle_stream read: new connection (1) on /tmp/kamailio_ctl 8(11010) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler error: 500 - Reload Failed 8(11010) DEBUG: ctl [io_listener.c:506]: handle_stream_read(): handle_stream read: eof on /tmp/kamailio_ctl 8(11010) DEBUG: ctl [../../io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x7f9211dab440, 11, -1, 0x10) fd_no=2 called
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 2:36 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Regarding kamcmd failure - do you have the ctl module loaded?
Regards,
Charles
On 27 September 2013 13:18, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
The kamctl fifo ds_reload command works when I use it in putty. The kamcmd dispatcher.reload command does NOT work.
Gives me the following error: root@proxy01:~# kamcmd dispatcher.reload ERROR: connect_unix_sock: connect(/tmp/kamailio_ctl): Connection refused [111]
http://192.168.1.10/http_rpc/dispatcher/dispatcher.reload?arg=dispatcher.rel...
10(10232) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler .... HTTP/1.1 500 Reload Failed Via: SIP/2.0/TCP 192.168.1.11:51065http://192.168.1.11:51065 Content-Type: text/html Server: kamailio (4.0.2 (x86_64/linux)) Content-Length: 2095
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 2:10 PM
To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
I think you are mixing up the MI and RPC commands.
Try:
kamctl fifo ds_reload
or
kamcmd dispatcher.reload
(note the difference between kamctl and kamcmd)
Regards,
Charles
On 27 September 2013 12:57, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: What kind of DB handler do I need for the dispatcher module?
When executing the dispatcher.reload command I'm receiving the following error: 8(10201) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler
root@proxy01:~# kamctl dispatcher reload ERROR: This command requires a database engine - none was loaded
My Dispatcher table is loaded using db_unixodbc, because we are using MSSQL.
loadmodule "mi_fifo.so" loadmodule "kex.so" loadmodule "corex.so" loadmodule "tm.so" loadmodule "tmx.so" loadmodule "sl.so" loadmodule "rr.so" loadmodule "pv.so" loadmodule "maxfwd.so" loadmodule "textops.so" loadmodule "textopsx.so" loadmodule "siputils.so" loadmodule "xlog.so" loadmodule "sanity.so" loadmodule "db_unixodbc.so" loadmodule "sqlops.so" loadmodule "dispatcher.so" loadmodule "siptrace.so" loadmodule "avp.so" loadmodule "cfgutils.so" loadmodule "xhttp.so" loadmodule "xhttp_rpc.so"
# ----- db_unixodbc params ----- modparam("db_unixodbc", "ping_interval", 600) modparam("db_unixodbc", "auto_reconnect", 0) modparam("db_unixodbc", "use_escape_common", 1)
modparam("dispatcher", "db_url","unixodbc://domain\myusername:mypassword@10.0.0.1/Kamailiohttp://myusername:mypassword@10.0.0.1/Kamailio") modparam("dispatcher", "table_name", "Dispatcher") modparam("dispatcher", "setid_col", "SetID") modparam("dispatcher", "destination_col", "Destination") modparam("dispatcher", "priority_col", "[Priority]") modparam("dispatcher", "flags_col", "Flags") modparam("dispatcher", "attrs_col", "Attributes") modparam("dispatcher", "flags", 2) modparam("dispatcher", "dst_avp", "$avp(dsdst)") modparam("dispatcher", "grp_avp", "$avp(dsgrp)") modparam("dispatcher", "cnt_avp", "$avp(dscnt)") modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")
The Dispatcher table is loaded just fine on startup of Kamailio. kamctl fifo ds_list shows the table data.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 1:39 PM
To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Right! Totally forgot about that.
Thanks, Kamailio is now receiving the requests!
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 1:35 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Have you added the appropriate listen= and/or port= directive to your config?
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen http://www.kamailio.org/wiki/cookbooks/4.0.x/core#port
Also make sure you have not disabled TCP.
Regards,
Charles
On 27 September 2013 12:27, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: What am I doing wrong here?
# ----- xhttp params ------ modparam("xhttp", "url_match", "null")
# ----- xhttp_rpc params ------ modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")
####### Routing Logic ########
event_route[xhttp:request] { xlog("L_INFO", "************************************** RECEIVED NEW HTTP REQUEST: $hu *********************************"); xhttp_reply("200", "OK", "text/html","<html><body>OK - Request Received</body></html>"); }
It seems like Kamailio isn't receiving the HTTP requests. Im doing a simple HTTP GET (http://192.168.1.10/http_rpc) using my browser to see if it hits the event_route.
From what I understand, the RCP command is in the url of the HTTP request, and is extracted using string transformations.
I've never done anything with RPC directly, so maybe I'm just wrong.
Also, I don't see Kamailio binding to the HTTP port. The xhttp_rpc_root param only allows alphanumeric values, so I can't specify a full URL.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 10:04 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Thanks, I'll have a look at it. Looks much easier than setting up Ssh connections programmatically.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Wednesday, September 25, 2013 1:12 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,
Charles
On 25 September 2013 11:40, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I'd like to automate the process of reloading the table. Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside? Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command "kamctl dispatcher reload" then exit? Not that hard either, but there might be a finer solution available.
Regards,
Grant
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
Hi,
So now only the one error. Which version of Kamailio are you running?
Regards,
Charles
On 27 September 2013 13:44, Grant Bagdasarian GB@cm.nl wrote:
Hello,****
I didn’t, but I just loaded it, but I haven’t set any modparams yet. ****
Now it’s giving me more error output:****
root@prox01:~# kamcmd dispatcher.reload****
8(11010) DEBUG: ctl [../../io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x7f9211dab440, 11, 3, 0xa02cf0), fd_no=1****
8(11010) DEBUG: ctl [io_listener.c:453]: handle_new_connect(): handle_stream read: new connection (1) on /tmp/kamailio_ctl****
8(11010) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler****
error: 500 - Reload Failed****
8(11010) DEBUG: ctl [io_listener.c:506]: handle_stream_read(): handle_stream read: eof on /tmp/kamailio_ctl****
8(11010) DEBUG: ctl [../../io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x7f9211dab440, 11, -1, 0x10) fd_no=2 called****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Friday, September 27, 2013 2:36 PM
*To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
Regarding kamcmd failure - do you have the ctl module loaded?****
Regards,****
Charles****
On 27 September 2013 13:18, Grant Bagdasarian GB@cm.nl wrote:****
Hello,****
The kamctl fifo ds_reload command works when I use it in putty.****
The kamcmd dispatcher.reload command does NOT work.****
Gives me the following error:****
root@proxy01:~# kamcmd dispatcher.reload****
ERROR: connect_unix_sock: connect(/tmp/kamailio_ctl): Connection refused [111]****
http://192.168.1.10/http_rpc/dispatcher/dispatcher.reload?arg=dispatcher.rel...
10(10232) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler****
….****
HTTP/1.1 500 Reload Failed****
Via: SIP/2.0/TCP 192.168.1.11:51065****
Content-Type: text/html****
Server: kamailio (4.0.2 (x86_64/linux))****
Content-Length: 2095****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Friday, September 27, 2013 2:10 PM****
*To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
I think you are mixing up the MI and RPC commands.****
Try:****
kamctl fifo ds_reload****
or****
kamcmd dispatcher.reload****
(note the difference between kamctl and kamcmd)****
Regards,****
Charles****
On 27 September 2013 12:57, Grant Bagdasarian GB@cm.nl wrote:****
What kind of DB handler do I need for the dispatcher module?****
When executing the dispatcher.reload command I’m receiving the following error: ****
8(10201) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler****
root@proxy01:~# kamctl dispatcher reload****
ERROR: This command requires a database engine - none was loaded****
My Dispatcher table is loaded using db_unixodbc, because we are using MSSQL.****
loadmodule "mi_fifo.so"****
loadmodule "kex.so"****
loadmodule "corex.so"****
loadmodule "tm.so"****
loadmodule "tmx.so"****
loadmodule "sl.so"****
loadmodule "rr.so"****
loadmodule "pv.so"****
loadmodule "maxfwd.so"****
loadmodule "textops.so"****
loadmodule "textopsx.so"****
loadmodule "siputils.so"****
loadmodule "xlog.so"****
loadmodule "sanity.so"****
loadmodule "db_unixodbc.so"****
loadmodule "sqlops.so"****
loadmodule "dispatcher.so"****
loadmodule "siptrace.so"****
loadmodule "avp.so"****
loadmodule "cfgutils.so"****
loadmodule "xhttp.so"****
loadmodule "xhttp_rpc.so"****
# ----- db_unixodbc params -----****
modparam("db_unixodbc", "ping_interval", 600)****
modparam("db_unixodbc", "auto_reconnect", 0)****
modparam("db_unixodbc", "use_escape_common", 1)****
modparam("dispatcher", "db_url","unixodbc://domain\ myusername:mypassword@10.0.0.1/Kamailio")****
modparam("dispatcher", "table_name", "Dispatcher")****
modparam("dispatcher", "setid_col", "SetID")****
modparam("dispatcher", "destination_col", "Destination")****
modparam("dispatcher", "priority_col", "[Priority]")****
modparam("dispatcher", "flags_col", "Flags")****
modparam("dispatcher", "attrs_col", "Attributes")****
modparam("dispatcher", "flags", 2)****
modparam("dispatcher", "dst_avp", "$avp(dsdst)")****
modparam("dispatcher", "grp_avp", "$avp(dsgrp)")****
modparam("dispatcher", "cnt_avp", "$avp(dscnt)")****
modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")****
The Dispatcher table is loaded just fine on startup of Kamailio.****
kamctl fifo ds_list shows the table data. ****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Grant Bagdasarian *Sent:* Friday, September 27, 2013 1:39 PM****
*To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Right! Totally forgot about that.****
Thanks, Kamailio is now receiving the requests!****
*From:* sr-users-bounces@lists.sip-router.org [ mailto:sr-users-bounces@lists.sip-router.orgsr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Friday, September 27, 2013 1:35 PM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
Have you added the appropriate listen= and/or port= directive to your config?****
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen****
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#port****
Also make sure you have not disabled TCP.****
Regards,****
Charles****
On 27 September 2013 12:27, Grant Bagdasarian GB@cm.nl wrote:****
What am I doing wrong here?****
# ----- xhttp params ------****
modparam("xhttp", "url_match", "null")****
# ----- xhttp_rpc params ------****
modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")****
####### Routing Logic ########****
event_route[xhttp:request] {****
xlog("L_INFO", "************************************** RECEIVED
NEW HTTP REQUEST: $hu *********************************");****
xhttp_reply("200", "OK", "text/html","<html><body>OK – Request
Received</body></html>");****
}****
It seems like Kamailio isn’t receiving the HTTP requests.****
Im doing a simple HTTP GET (http://192.168.1.10/http_rpc) using my browser to see if it hits the event_route.****
From what I understand, the RCP command is in the url of the HTTP request, and is extracted using string transformations.****
I’ve never done anything with RPC directly, so maybe I’m just wrong.****
Also, I don’t see Kamailio binding to the HTTP port.****
The xhttp_rpc_root param only allows alphanumeric values, so I can’t specify a full URL.****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Grant Bagdasarian *Sent:* Friday, September 27, 2013 10:04 AM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Thanks, I’ll have a look at it. ****
Looks much easier than setting up Ssh connections programmatically. ****
*From:* sr-users-bounces@lists.sip-router.org [ mailto:sr-users-bounces@lists.sip-router.orgsr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Wednesday, September 25, 2013 1:12 PM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.****
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,****
Charles****
On 25 September 2013 11:40, Grant Bagdasarian GB@cm.nl wrote:****
Hello,****
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I’d like to automate the process of reloading the table.****
Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside?****
Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command “kamctl dispatcher reload” then exit? Not that hard either, but there might be a finer solution available.****
Regards,****
Grant****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Using 4.0.2. But I think I found the problem.
I've already sent the mail explaining it, but it's waiting approval because it's too big.
In short: Open [kamailio_source]/utils/kamctl/kamctl Go to line 93.
We haven't loaded any db engines except for db_unixodbc, which is not part of this list.
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 3:00 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
So now only the one error. Which version of Kamailio are you running?
Regards,
Charles
On 27 September 2013 13:44, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
I didn't, but I just loaded it, but I haven't set any modparams yet.
Now it's giving me more error output:
root@prox01:~# kamcmd dispatcher.reload 8(11010) DEBUG: ctl [../../io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x7f9211dab440, 11, 3, 0xa02cf0), fd_no=1 8(11010) DEBUG: ctl [io_listener.c:453]: handle_new_connect(): handle_stream read: new connection (1) on /tmp/kamailio_ctl 8(11010) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler error: 500 - Reload Failed 8(11010) DEBUG: ctl [io_listener.c:506]: handle_stream_read(): handle_stream read: eof on /tmp/kamailio_ctl 8(11010) DEBUG: ctl [../../io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x7f9211dab440, 11, -1, 0x10) fd_no=2 called
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 2:36 PM
To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Regarding kamcmd failure - do you have the ctl module loaded?
Regards,
Charles
On 27 September 2013 13:18, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
The kamctl fifo ds_reload command works when I use it in putty. The kamcmd dispatcher.reload command does NOT work.
Gives me the following error: root@proxy01:~# kamcmd dispatcher.reload ERROR: connect_unix_sock: connect(/tmp/kamailio_ctl): Connection refused [111]
http://192.168.1.10/http_rpc/dispatcher/dispatcher.reload?arg=dispatcher.rel...
10(10232) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler .... HTTP/1.1 500 Reload Failed Via: SIP/2.0/TCP 192.168.1.11:51065http://192.168.1.11:51065 Content-Type: text/html Server: kamailio (4.0.2 (x86_64/linux)) Content-Length: 2095
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 2:10 PM
To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
I think you are mixing up the MI and RPC commands.
Try:
kamctl fifo ds_reload
or
kamcmd dispatcher.reload
(note the difference between kamctl and kamcmd)
Regards,
Charles
On 27 September 2013 12:57, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: What kind of DB handler do I need for the dispatcher module?
When executing the dispatcher.reload command I'm receiving the following error: 8(10201) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler
root@proxy01:~# kamctl dispatcher reload ERROR: This command requires a database engine - none was loaded
My Dispatcher table is loaded using db_unixodbc, because we are using MSSQL.
loadmodule "mi_fifo.so" loadmodule "kex.so" loadmodule "corex.so" loadmodule "tm.so" loadmodule "tmx.so" loadmodule "sl.so" loadmodule "rr.so" loadmodule "pv.so" loadmodule "maxfwd.so" loadmodule "textops.so" loadmodule "textopsx.so" loadmodule "siputils.so" loadmodule "xlog.so" loadmodule "sanity.so" loadmodule "db_unixodbc.so" loadmodule "sqlops.so" loadmodule "dispatcher.so" loadmodule "siptrace.so" loadmodule "avp.so" loadmodule "cfgutils.so" loadmodule "xhttp.so" loadmodule "xhttp_rpc.so"
# ----- db_unixodbc params ----- modparam("db_unixodbc", "ping_interval", 600) modparam("db_unixodbc", "auto_reconnect", 0) modparam("db_unixodbc", "use_escape_common", 1)
modparam("dispatcher", "db_url","unixodbc://domain\myusername:mypassword@10.0.0.1/Kamailiohttp://myusername:mypassword@10.0.0.1/Kamailio") modparam("dispatcher", "table_name", "Dispatcher") modparam("dispatcher", "setid_col", "SetID") modparam("dispatcher", "destination_col", "Destination") modparam("dispatcher", "priority_col", "[Priority]") modparam("dispatcher", "flags_col", "Flags") modparam("dispatcher", "attrs_col", "Attributes") modparam("dispatcher", "flags", 2) modparam("dispatcher", "dst_avp", "$avp(dsdst)") modparam("dispatcher", "grp_avp", "$avp(dsgrp)") modparam("dispatcher", "cnt_avp", "$avp(dscnt)") modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")
The Dispatcher table is loaded just fine on startup of Kamailio. kamctl fifo ds_list shows the table data.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 1:39 PM
To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Right! Totally forgot about that.
Thanks, Kamailio is now receiving the requests!
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 1:35 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Have you added the appropriate listen= and/or port= directive to your config?
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen http://www.kamailio.org/wiki/cookbooks/4.0.x/core#port
Also make sure you have not disabled TCP.
Regards,
Charles
On 27 September 2013 12:27, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: What am I doing wrong here?
# ----- xhttp params ------ modparam("xhttp", "url_match", "null")
# ----- xhttp_rpc params ------ modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")
####### Routing Logic ########
event_route[xhttp:request] { xlog("L_INFO", "************************************** RECEIVED NEW HTTP REQUEST: $hu *********************************"); xhttp_reply("200", "OK", "text/html","<html><body>OK - Request Received</body></html>"); }
It seems like Kamailio isn't receiving the HTTP requests. Im doing a simple HTTP GET (http://192.168.1.10/http_rpc) using my browser to see if it hits the event_route.
From what I understand, the RCP command is in the url of the HTTP request, and is extracted using string transformations.
I've never done anything with RPC directly, so maybe I'm just wrong.
Also, I don't see Kamailio binding to the HTTP port. The xhttp_rpc_root param only allows alphanumeric values, so I can't specify a full URL.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 10:04 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Thanks, I'll have a look at it. Looks much easier than setting up Ssh connections programmatically.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Wednesday, September 25, 2013 1:12 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,
Charles
On 25 September 2013 11:40, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I'd like to automate the process of reloading the table. Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside? Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command "kamctl dispatcher reload" then exit? Not that hard either, but there might be a finer solution available.
Regards,
Grant
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
Hi,
It would appear then that unixodbc support is not currently available in kamctl directly, so you are in fact limited to MI command ds_reload.
For your case, you could try loading MI_RPC module which exports an additional RPC command: mi.
Then issue your command like:
kamcmd mi ds_reload
If that works for you, then the same command passed via xhttp_rpc should also work.
Cheers,
Charles
On 27 September 2013 14:04, Grant Bagdasarian GB@cm.nl wrote:
Using 4.0.2. But I think I found the problem.****
I’ve already sent the mail explaining it, but it’s waiting approval because it’s too big.****
In short: ****
Open [kamailio_source]/utils/kamctl/kamctl****
Go to line 93. ****
We haven’t loaded any db engines except for db_unixodbc, which is not part of this list.****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Friday, September 27, 2013 3:00 PM
*To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
So now only the one error. Which version of Kamailio are you running?****
Regards,****
Charles****
On 27 September 2013 13:44, Grant Bagdasarian GB@cm.nl wrote:****
Hello,****
I didn’t, but I just loaded it, but I haven’t set any modparams yet. ****
Now it’s giving me more error output:****
root@prox01:~# kamcmd dispatcher.reload****
8(11010) DEBUG: ctl [../../io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x7f9211dab440, 11, 3, 0xa02cf0), fd_no=1****
8(11010) DEBUG: ctl [io_listener.c:453]: handle_new_connect(): handle_stream read: new connection (1) on /tmp/kamailio_ctl****
8(11010) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler****
error: 500 - Reload Failed****
8(11010) DEBUG: ctl [io_listener.c:506]: handle_stream_read(): handle_stream read: eof on /tmp/kamailio_ctl****
8(11010) DEBUG: ctl [../../io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x7f9211dab440, 11, -1, 0x10) fd_no=2 called****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Friday, September 27, 2013 2:36 PM****
*To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
Regarding kamcmd failure - do you have the ctl module loaded?****
Regards,****
Charles****
On 27 September 2013 13:18, Grant Bagdasarian GB@cm.nl wrote:****
Hello,****
The kamctl fifo ds_reload command works when I use it in putty.****
The kamcmd dispatcher.reload command does NOT work.****
Gives me the following error:****
root@proxy01:~# kamcmd dispatcher.reload****
ERROR: connect_unix_sock: connect(/tmp/kamailio_ctl): Connection refused [111]****
http://192.168.1.10/http_rpc/dispatcher/dispatcher.reload?arg=dispatcher.rel...
10(10232) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler****
….****
HTTP/1.1 500 Reload Failed****
Via: SIP/2.0/TCP 192.168.1.11:51065****
Content-Type: text/html****
Server: kamailio (4.0.2 (x86_64/linux))****
Content-Length: 2095****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Friday, September 27, 2013 2:10 PM****
*To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
I think you are mixing up the MI and RPC commands.****
Try:****
kamctl fifo ds_reload****
or****
kamcmd dispatcher.reload****
(note the difference between kamctl and kamcmd)****
Regards,****
Charles****
On 27 September 2013 12:57, Grant Bagdasarian GB@cm.nl wrote:****
What kind of DB handler do I need for the dispatcher module?****
When executing the dispatcher.reload command I’m receiving the following error: ****
8(10201) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler****
root@proxy01:~# kamctl dispatcher reload****
ERROR: This command requires a database engine - none was loaded****
My Dispatcher table is loaded using db_unixodbc, because we are using MSSQL.****
loadmodule "mi_fifo.so"****
loadmodule "kex.so"****
loadmodule "corex.so"****
loadmodule "tm.so"****
loadmodule "tmx.so"****
loadmodule "sl.so"****
loadmodule "rr.so"****
loadmodule "pv.so"****
loadmodule "maxfwd.so"****
loadmodule "textops.so"****
loadmodule "textopsx.so"****
loadmodule "siputils.so"****
loadmodule "xlog.so"****
loadmodule "sanity.so"****
loadmodule "db_unixodbc.so"****
loadmodule "sqlops.so"****
loadmodule "dispatcher.so"****
loadmodule "siptrace.so"****
loadmodule "avp.so"****
loadmodule "cfgutils.so"****
loadmodule "xhttp.so"****
loadmodule "xhttp_rpc.so"****
# ----- db_unixodbc params -----****
modparam("db_unixodbc", "ping_interval", 600)****
modparam("db_unixodbc", "auto_reconnect", 0)****
modparam("db_unixodbc", "use_escape_common", 1)****
modparam("dispatcher", "db_url","unixodbc://domain\ myusername:mypassword@10.0.0.1/Kamailio")****
modparam("dispatcher", "table_name", "Dispatcher")****
modparam("dispatcher", "setid_col", "SetID")****
modparam("dispatcher", "destination_col", "Destination")****
modparam("dispatcher", "priority_col", "[Priority]")****
modparam("dispatcher", "flags_col", "Flags")****
modparam("dispatcher", "attrs_col", "Attributes")****
modparam("dispatcher", "flags", 2)****
modparam("dispatcher", "dst_avp", "$avp(dsdst)")****
modparam("dispatcher", "grp_avp", "$avp(dsgrp)")****
modparam("dispatcher", "cnt_avp", "$avp(dscnt)")****
modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")****
The Dispatcher table is loaded just fine on startup of Kamailio.****
kamctl fifo ds_list shows the table data. ****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Grant Bagdasarian *Sent:* Friday, September 27, 2013 1:39 PM****
*To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Right! Totally forgot about that.****
Thanks, Kamailio is now receiving the requests!****
*From:* sr-users-bounces@lists.sip-router.org [ mailto:sr-users-bounces@lists.sip-router.orgsr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Friday, September 27, 2013 1:35 PM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
Have you added the appropriate listen= and/or port= directive to your config?****
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen****
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#port****
Also make sure you have not disabled TCP.****
Regards,****
Charles****
On 27 September 2013 12:27, Grant Bagdasarian GB@cm.nl wrote:****
What am I doing wrong here?****
# ----- xhttp params ------****
modparam("xhttp", "url_match", "null")****
# ----- xhttp_rpc params ------****
modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")****
####### Routing Logic ########****
event_route[xhttp:request] {****
xlog("L_INFO", "************************************** RECEIVED
NEW HTTP REQUEST: $hu *********************************");****
xhttp_reply("200", "OK", "text/html","<html><body>OK – Request
Received</body></html>");****
}****
It seems like Kamailio isn’t receiving the HTTP requests.****
Im doing a simple HTTP GET (http://192.168.1.10/http_rpc) using my browser to see if it hits the event_route.****
From what I understand, the RCP command is in the url of the HTTP request, and is extracted using string transformations.****
I’ve never done anything with RPC directly, so maybe I’m just wrong.****
Also, I don’t see Kamailio binding to the HTTP port.****
The xhttp_rpc_root param only allows alphanumeric values, so I can’t specify a full URL.****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Grant Bagdasarian *Sent:* Friday, September 27, 2013 10:04 AM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Thanks, I’ll have a look at it. ****
Looks much easier than setting up Ssh connections programmatically. ****
*From:* sr-users-bounces@lists.sip-router.org [ mailto:sr-users-bounces@lists.sip-router.orgsr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Wednesday, September 25, 2013 1:12 PM *To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.****
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,****
Charles****
On 25 September 2013 11:40, Grant Bagdasarian GB@cm.nl wrote:****
Hello,****
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I’d like to automate the process of reloading the table.****
Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside?****
Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command “kamctl dispatcher reload” then exit? Not that hard either, but there might be a finer solution available.****
Regards,****
Grant****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users****
www.sipcentric.com
Follow us on twitter @sipcentric http://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
I've loaded the mi_rpc module and configured the rpc_url param, but I can't issue the kamcmd mi ds_reload command from the web interface. Executing the command in the console works just fine, but only when I leave the binrpc modparam as default. I'm probably doing something wrong.
# ----- xhttp params ------ modparam("xhttp", "url_match", "^/http_rpc")
# ----- xhttp_rpc params ------ modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")
# ----- mi_rpc params ------ modparam("mi_rpc","rpc_url","tcp:192.168.1.10:2046")
The mi_rpc documentation says: "rpc_url". This parameter is required if you need to run RPC commands from the MI. It must match a URL to which the RPC is bound. Is this referring to the binrpc modparam?
Any tips?
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Saturday, September 28, 2013 9:42 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
It would appear then that unixodbc support is not currently available in kamctl directly, so you are in fact limited to MI command ds_reload.
For your case, you could try loading MI_RPC module which exports an additional RPC command: mi.
Then issue your command like:
kamcmd mi ds_reload
If that works for you, then the same command passed via xhttp_rpc should also work.
Cheers,
Charles
Hi,
You are not doing anything wrong - on very quick inspection of the code it appears you won't be able to issue the command via the xhttp_rpc module.
So other than changing DB (although I assume you are using MSSQL for a very specific reason), it looks like you may have to stick to the original remote SSH connection idea. Until someone has time and inclination to add the unixodbc support that is.
Unless anyone else can offer some alternative...
Regards,
Charles
On 30 September 2013 08:01, Grant Bagdasarian GB@cm.nl wrote:
Hello,****
I’ve loaded the mi_rpc module and configured the rpc_url param, but I can’t issue the kamcmd mi ds_reload command from the web interface. Executing the command in the console works just fine, but only when I leave the binrpc modparam as default.****
I’m probably doing something wrong.****
# ----- xhttp params ------****
modparam("xhttp", "url_match", "^/http_rpc")****
# ----- xhttp_rpc params ------****
modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")****
# ----- mi_rpc params ------****
modparam("mi_rpc","rpc_url","tcp:192.168.1.10:2046")****
The mi_rpc documentation says: “rpc_url”. This parameter is required if you need to run RPC commands from the MI. It must match a URL to which the RPC is bound.****
Is this referring to the binrpc modparam?****
Any tips?****
*From:* sr-users-bounces@lists.sip-router.org [mailto: sr-users-bounces@lists.sip-router.org] *On Behalf Of *Charles Chance *Sent:* Saturday, September 28, 2013 9:42 AM
*To:* Kamailio (SER) - Users Mailing List *Subject:* Re: [SR-Users] Communicate with Kamailio through external application****
Hi,****
It would appear then that unixodbc support is not currently available in kamctl directly, so you are in fact limited to MI command ds_reload.****
For your case, you could try loading MI_RPC module which exports an additional RPC command: mi.****
Then issue your command like:****
kamcmd mi ds_reload****
If that works for you, then the same command passed via xhttp_rpc should also work.****
Cheers,****
Charles****
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
I'll go for the remote Ssh idea for now and keep an eye on future releases. Thank you for your help!
Regards,
Grant
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Monday, September 30, 2013 2:57 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
You are not doing anything wrong - on very quick inspection of the code it appears you won't be able to issue the command via the xhttp_rpc module.
So other than changing DB (although I assume you are using MSSQL for a very specific reason), it looks like you may have to stick to the original remote SSH connection idea. Until someone has time and inclination to add the unixodbc support that is.
Unless anyone else can offer some alternative...
Regards,
Charles
On 30 September 2013 08:01, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
I've loaded the mi_rpc module and configured the rpc_url param, but I can't issue the kamcmd mi ds_reload command from the web interface. Executing the command in the console works just fine, but only when I leave the binrpc modparam as default. I'm probably doing something wrong.
# ----- xhttp params ------ modparam("xhttp", "url_match", "^/http_rpc")
# ----- xhttp_rpc params ------ modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")
# ----- mi_rpc params ------ modparam("mi_rpc","rpc_url","tcp:192.168.1.10:2046http://192.168.1.10:2046")
The mi_rpc documentation says: "rpc_url". This parameter is required if you need to run RPC commands from the MI. It must match a URL to which the RPC is bound. Is this referring to the binrpc modparam?
Any tips?
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Saturday, September 28, 2013 9:42 AM
To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
It would appear then that unixodbc support is not currently available in kamctl directly, so you are in fact limited to MI command ds_reload.
For your case, you could try loading MI_RPC module which exports an additional RPC command: mi.
Then issue your command like:
kamcmd mi ds_reload
If that works for you, then the same command passed via xhttp_rpc should also work.
Cheers,
Charles
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
I think I found the problem.
Open /usr/src/kamailio-4.0.2/utils/kamctl/kamctl. Go to line 1540 (Dispatcher) This executes the require_dbengine function.
The db_unixodbc isn't part of this dbengine list. So when no other db engine is loaded(as in our case) you can't execute the kamctl dispatcher reload command.
require_dbengine() { if [ $DBENGINELOADED -eq 0 ] ; then merr "This command requires a database engine - none was loaded" exit -1 fi }
### DBENGINE # DBENGINELOADED=0 case $DBENGINE in MYSQL|mysql|MySQL) if [ -f "$MYLIBDIR/kamctl.mysql" ]; then . "$MYLIBDIR/kamctl.mysql" DBENGINELOADED=1 fi ;; PGSQL|pgsql|postgres|postgresql|POSTGRESQL) if [ -f "$MYLIBDIR/kamctl.pgsql" ]; then . "$MYLIBDIR/kamctl.pgsql" DBENGINELOADED=1 fi ;; ORACLE|oracle|Oracle) if [ -f "$MYLIBDIR/kamctl.oracle" ]; then . "$MYLIBDIR/kamctl.oracle" DBENGINELOADED=1 fi ;;
DBTEXT|dbtext|textdb) if [ -f "$MYLIBDIR/kamctl.dbtext" ]; then . "$MYLIBDIR/kamctl.dbtext" DBENGINELOADED=1 fi ;; DB_BERKELEY|db_berkeley|BERKELEY|berkeley) if [ -f "$MYLIBDIR/kamctl.db_berkeley" ]; then . "$MYLIBDIR/kamctl.db_berkeley" DBENGINELOADED=1 fi ;; SQLITE|sqlite) if [ -f "$MYLIBDIR/kamctl.sqlite" ]; then . "$MYLIBDIR/kamctl.sqlite" DBENGINELOADED=1 fi ;;
esac
From: sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 2:44 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hello,
I didn't, but I just loaded it, but I haven't set any modparams yet.
Now it's giving me more error output:
root@prox01:~# kamcmd dispatcher.reload 8(11010) DEBUG: ctl [../../io_wait.h:390]: io_watch_add(): DBG: io_watch_add(0x7f9211dab440, 11, 3, 0xa02cf0), fd_no=1 8(11010) DEBUG: ctl [io_listener.c:453]: handle_new_connect(): handle_stream read: new connection (1) on /tmp/kamailio_ctl 8(11010) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler error: 500 - Reload Failed 8(11010) DEBUG: ctl [io_listener.c:506]: handle_stream_read(): handle_stream read: eof on /tmp/kamailio_ctl 8(11010) DEBUG: ctl [../../io_wait.h:617]: io_watch_del(): DBG: io_watch_del (0x7f9211dab440, 11, -1, 0x10) fd_no=2 called
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 2:36 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Regarding kamcmd failure - do you have the ctl module loaded?
Regards,
Charles
On 27 September 2013 13:18, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
The kamctl fifo ds_reload command works when I use it in putty. The kamcmd dispatcher.reload command does NOT work.
Gives me the following error: root@proxy01:~# kamcmd dispatcher.reload ERROR: connect_unix_sock: connect(/tmp/kamailio_ctl): Connection refused [111]
http://192.168.1.10/http_rpc/dispatcher/dispatcher.reload?arg=dispatcher.rel...
10(10232) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler .... HTTP/1.1 500 Reload Failed Via: SIP/2.0/TCP 192.168.1.11:51065http://192.168.1.11:51065 Content-Type: text/html Server: kamailio (4.0.2 (x86_64/linux)) Content-Length: 2095
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 2:10 PM
To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
I think you are mixing up the MI and RPC commands.
Try:
kamctl fifo ds_reload
or
kamcmd dispatcher.reload
(note the difference between kamctl and kamcmd)
Regards,
Charles
On 27 September 2013 12:57, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: What kind of DB handler do I need for the dispatcher module?
When executing the dispatcher.reload command I'm receiving the following error: 8(10201) ERROR: dispatcher [dispatch.c:725]: ds_load_db(): invalid DB handler
root@proxy01:~# kamctl dispatcher reload ERROR: This command requires a database engine - none was loaded
My Dispatcher table is loaded using db_unixodbc, because we are using MSSQL.
loadmodule "mi_fifo.so" loadmodule "kex.so" loadmodule "corex.so" loadmodule "tm.so" loadmodule "tmx.so" loadmodule "sl.so" loadmodule "rr.so" loadmodule "pv.so" loadmodule "maxfwd.so" loadmodule "textops.so" loadmodule "textopsx.so" loadmodule "siputils.so" loadmodule "xlog.so" loadmodule "sanity.so" loadmodule "db_unixodbc.so" loadmodule "sqlops.so" loadmodule "dispatcher.so" loadmodule "siptrace.so" loadmodule "avp.so" loadmodule "cfgutils.so" loadmodule "xhttp.so" loadmodule "xhttp_rpc.so"
# ----- db_unixodbc params ----- modparam("db_unixodbc", "ping_interval", 600) modparam("db_unixodbc", "auto_reconnect", 0) modparam("db_unixodbc", "use_escape_common", 1)
modparam("dispatcher", "db_url","unixodbc://domain\myusername:mypassword@10.0.0.1/Kamailiohttp://myusername:mypassword@10.0.0.1/Kamailio") modparam("dispatcher", "table_name", "Dispatcher") modparam("dispatcher", "setid_col", "SetID") modparam("dispatcher", "destination_col", "Destination") modparam("dispatcher", "priority_col", "[Priority]") modparam("dispatcher", "flags_col", "Flags") modparam("dispatcher", "attrs_col", "Attributes") modparam("dispatcher", "flags", 2) modparam("dispatcher", "dst_avp", "$avp(dsdst)") modparam("dispatcher", "grp_avp", "$avp(dsgrp)") modparam("dispatcher", "cnt_avp", "$avp(dscnt)") modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")
The Dispatcher table is loaded just fine on startup of Kamailio. kamctl fifo ds_list shows the table data.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 1:39 PM
To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Right! Totally forgot about that.
Thanks, Kamailio is now receiving the requests!
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Friday, September 27, 2013 1:35 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Have you added the appropriate listen= and/or port= directive to your config?
http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen http://www.kamailio.org/wiki/cookbooks/4.0.x/core#port
Also make sure you have not disabled TCP.
Regards,
Charles
On 27 September 2013 12:27, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: What am I doing wrong here?
# ----- xhttp params ------ modparam("xhttp", "url_match", "null")
# ----- xhttp_rpc params ------ modparam("xhttp_rpc", "xhttp_rpc_root", "http_rpc")
####### Routing Logic ########
event_route[xhttp:request] { xlog("L_INFO", "************************************** RECEIVED NEW HTTP REQUEST: $hu *********************************"); xhttp_reply("200", "OK", "text/html","<html><body>OK - Request Received</body></html>"); }
It seems like Kamailio isn't receiving the HTTP requests. Im doing a simple HTTP GET (http://192.168.1.10/http_rpc) using my browser to see if it hits the event_route.
From what I understand, the RCP command is in the url of the HTTP request, and is extracted using string transformations.
I've never done anything with RPC directly, so maybe I'm just wrong.
Also, I don't see Kamailio binding to the HTTP port. The xhttp_rpc_root param only allows alphanumeric values, so I can't specify a full URL.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Grant Bagdasarian Sent: Friday, September 27, 2013 10:04 AM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Thanks, I'll have a look at it. Looks much easier than setting up Ssh connections programmatically.
From: sr-users-bounces@lists.sip-router.orgmailto:sr-users-bounces@lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Charles Chance Sent: Wednesday, September 25, 2013 1:12 PM To: Kamailio (SER) - Users Mailing List Subject: Re: [SR-Users] Communicate with Kamailio through external application
Hi,
Take a look at http://www.kamailio.org/docs/modules/stable/modules/xhttp_rpc.html, which allows you to receive/handle RPC commands over HTTP.
Then use the appropriate RPC command in dispatcher module to reload table: http://www.kamailio.org/docs/modules/stable/modules/dispatcher.html#idp16998...
Regards,
Charles
On 25 September 2013 11:40, Grant Bagdasarian <GB@cm.nlmailto:GB@cm.nl> wrote: Hello,
When adding rows to the dispatcher table, the table in memory needs to be refreshed. Since we have multiple Kamailio instances running on different machines, I'd like to automate the process of reloading the table. Is there an easy way of doing this with an already existing module, which provides easy connectivity from the outside? Or do I need to write an application which basically sets up a SSH socket connection with the machine and sends the command "kamctl dispatcher reload" then exit? Not that hard either, but there might be a finer solution available.
Regards,
Grant
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.orgmailto:sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
www.sipcentric.comhttp://www.sipcentric.com/
Follow us on twitter @sipcentrichttp://twitter.com/sipcentric
Sipcentric Ltd. Company registered in England & Wales no. 7365592. Registered office: Unit 10 iBIC, Birmingham Science Park, Holt Court South, Birmingham B7 4EJ.