SearchSearch  Log in to check your private messagesLog in to check your private messages  recent posts Recent Posts
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jps.sinningOffline



Joined: Dec 16, 2009
Posts: 3

Status: Offline
Posted: Dec 16, 2009 - 01:50 PM Reply with quote Back to top
Hi,

I trying to setup Kamailio as a back to back user agent (b2bua), I'm trying to use the dialog module to keep track of the dialog, but I have tried to write the database changing the configuration many times but it seems something wrong with the module, because the dialog information is never written. Do you have any successful configuration file where you have written the database and the dialog table?
View user's profile Send private message
fcois93Offline



Joined: Oct 02, 2007
Posts: 106
Location: france
Status: Offline
Posted: Dec 21, 2009 - 07:49 AM Reply with quote Back to top
kamailio is not a B2BUA!?
where could you see it?
View user's profile Send private message MSN Messenger
jps.sinningOffline



Joined: Dec 16, 2009
Posts: 3

Status: Offline
Posted: Dec 21, 2009 - 02:11 PM Reply with quote Back to top
Hi,

The problem is that I tried the same configuration in Opensips, and it works, please refer to the following configuration file:

####### Global Parameters #########

debug=3
log_stderror=no
log_facility=LOG_LOCAL0

fork=yes
children=4

listen=udp:[hide]
user_agent_header="User-Agent: [hide]"

/* uncomment the following lines to enable debugging */
debug=3
fork=no
log_stderror=yes




mpath="/usr/local/lib64/opensips/modules/"
loadmodule "db_mysql.so"
loadmodule "signaling.so"
loadmodule "mi_fifo.so"
loadmodule "tm.so"
loadmodule "sl.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "xlog.so"
loadmodule "acc.so"
loadmodule "nathelper.so"
loadmodule "dialog.so"
loadmodule "uri.so"

modparam("rr", "enable_full_lr", 1)

modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")

# ----- nathelper -----
modparam("nathelper", "rtpproxy_sock", "unix:/var/run/rtpproxy.sock")
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "sipping_bflag", 7)
modparam("nathelper", "sipping_from", "sip:sbc@telintel.net")
modparam("nathelper", "received_avp", "$avp(i:80)")
modparam("registrar", "received_avp", "$avp(i:80)")
modparam("usrloc", "nat_bflag", 6)
modparam("dialog", "dlg_flag", 4)
modparam("dialog", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam("dialog", "db_mode", 1)
modparam("dialog", "dlg_match_mode", 2)
modparam("usrloc", "db_url", "mysql://opensips:opensipsrw@localhost/opensips")
modparam("dialog", "default_timeout", 21600)
modparam("dialog", "timeout_avp", "$avp(i:5)")



route{
log(1,"####Inicio de transaccion####\n\n");

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many hops");
exit;
}


else if(!uri == myself){
log(1,"!uri == myself\n");
sl_send_reply("503","El paquete debe estar destinado para mi");
exit;
}
else{
if(!(src_ip==[hide] || src_ip==[hide] || src_ip==[hide] || src_ip==[hide])){
log(1,"!(src_ip==[hide] || src_ip==[hide] || src_ip==[hide] || src_ip==[hide])\n");
if (!has_totag()){
log(1,"!has_totag()\n");
if (is_method("INVITE")){
log(1,"is_method(INVITE)\n");
force_rtp_proxy();
route(5);
t_on_reply("3");
create_dialog();
setflag(4);
route(15);
route(16);
xlog("La IP de origen es $var(ip_origen_v) con puerto $var(Pto_origen_v)\n");
xlog("La IP de destino es $var(ip_destino_v) con puerto $var(Pto_destino_v)\n");
#$avp(i:5)=1;
xlog("El tiempo del timeout=$avp(i:5)\n");
t_relay();
}
if(is_method("REGISTER")){
log(1,"is_method(REGISTER)\n");
# route(7);
route(5);
t_relay();
}
}

if (has_totag()){
log(1,"has_totag()\n");
if (is_method("ACK")){
log(1,"is_method(ACK)\n");
# route(7);
route(5);
t_relay();
}
}
}

if (src_ip==[hide] || src_ip==[hide] || src_ip==[hide] || src_ip==[hide]){
log(1,"src_ip==[hide] || src_ip==[hide] || src_ip==[hide] || src_ip==[hide]\n");
if(is_method("INVITE")){
log(1,"is_method(INVITE)\n");
if(loose_route()){
log(1,"loose_route()\n");
route(1);
}
}
else if(!(is_method("BYE") || is_method("CANCEL"))){
log(1,"else is_method(INVITE)\n");
sl_send_reply("404","No lo Encuentro");
}
}

if (is_method("BYE") || is_method("CANCEL")){
log(1,"is_method(BYE) || is_method(CANCEL)\n");
route(16);
xlog("La IP de origen es $var(ip_origen_v) con puerto $var(Pto_origen_v) y Usuario origen $var(usuario_origen_v)\n");
xlog("La IP de destino es $var(ip_destino_v) con puerto $var(Pto_destino_v) y Usuario Destino $var(usuario_destino_v)\n");
xlog("La IP tiene origen es $si\n");
xlog("El tiempo del timeout=$avp(i:5)\n");
create_dialog();
if($var(ip_origen_v)==$si){
route(13);
unforce_rtp_proxy();
t_relay();
}
else if($var(ip_destino_v)==$si){
route(14);
unforce_rtp_proxy();
t_relay();
}
else{
sl_send_reply("481","No tengo registro de esa llamada");
}
}
}

log(1,"####Fin de transaccion####\n\n\n");
exit;
}

route[1]{
log(1,"route[1]\n");
if($retcode==4){
log(1,"El retcode de 3=4\n");
route(2);
return(4);
}
log(1,"El retcode de 3=5\n");
return(5);
}

route[2] {
log(1,"route[2]\n");
force_rtp_proxy();
return;
}

onreply_route[3]{
log(1,"onreply_route[3]\n");
xlog("El estado es $rs $rr)\n");
if(t_check_status("200") || t_check_status("183")){
subst('/^Contact:(.*)>/Contact: <sip:$var(usuario_origen_v)@[hide]>/ig');
force_rtp_proxy();
return(4);
}
return(5);
}

failure_route[4]{
log(1,"failure_route[4]\n");
t_relay();
return;
}

route[5]{
log(1,"route[5]\n");
rewritehostport("[hide]");
subst('/^Contact:(.*)>/Contact: <sip:$var(usuario_origen_v)@[hide]>/ig');
return;
}

onreply_route[6]{
log(1,"onreply_route[6]\n");
if (!t_check_status("200")){
return;
}
return;
}

route[7] {
log(1,"route[7]\n");
subst('/^Contact:(.*)>/Contact: <sip:$var(usuario_origen_v)@[hide]>/ig');
return;
}

route[8] {
log(1,"route[8]\n");
unforce_rtp_proxy();
subst('/^Contact:(.*)>/Contact: <sip:$var(usuario_origen_v)@[hide]>/ig');
return;
}

onreply_route[9]{
log(1,"onreply_route[9]\n");
unforce_rtp_proxy();
subst('/^Contact:(.*)>/Contact: <sip:$var(usuario_origen_v)@[hide]>/ig');
return;
}

route[10]{
log(1,"onreply_route[10]\n");
xlog("El 10 es $rm\n");
xlog("El estado es $rs $rr)\n");
return;
}

route[11]{
log(1,"onreply_route[11]\n");
xlog("FROM URI $fu\n");
xlog("REQUEST URI $ru)\n");
xlog("IP origen $si)\n");
return;
}

onreply_route[12]{
log(1,"onreply_route[12]\n");
# dlg_bye("all");
# unset_dlg_profile("inboundcall");
return;
# t_relay();
}

route[13]{
log(1,"route[13]\n");
$ru = "sip:" + $var(usuario_destino_v) + "@" + $var(ip_destino_v) + ":" + $var(Pto_destino_v);
xlog("La uri remota es $ru\n");
return;
}

route[14]{
log(1,"route[14]\n");
$ru = "sip:" + $var(usuario_origen_v) + "@" + $var(ip_origen_v) + ":" + $var(Pto_origen_v);
xlog("La uri remota es $ru\n");
return;
}
route[15]{
log(1,"route[15]\n");
store_dlg_value("ip_origen", "$si");
store_dlg_value("Pto_origen", "$sp");
store_dlg_value("ip_destino", "$rd");
store_dlg_value("Pto_destino", "$rp");
store_dlg_value("usuario_destino", "$tU");
store_dlg_value("usuario_origen", "$fU");
return;
}
route[16]{
log(1,"route[16]\n");
fetch_dlg_value("ip_origen","$var(ip_origen_v)");
fetch_dlg_value("Pto_origen","$var(Pto_origen_v)");
fetch_dlg_value("ip_destino","$var(ip_destino_v)");
fetch_dlg_value("Pto_destino","$var(Pto_destino_v)");
fetch_dlg_value("usuario_destino","$var(usuario_destino_v)");
fetch_dlg_value("usuario_origen","$var(usuario_origen_v)");
return;
}

It isn't finish yet, I have to fix many things more, the register is one of then, but surely it may work as an B2BUA
View user's profile Send private message
fcois93Offline



Joined: Oct 02, 2007
Posts: 106
Location: france
Status: Offline
Posted: Dec 21, 2009 - 02:16 PM Reply with quote Back to top
sorry, I never used dialog module.
please refert to http://kamailio.org/docs/modules/1.5.x/dialog.html
View user's profile Send private message MSN Messenger
fcois93Offline



Joined: Oct 02, 2007
Posts: 106
Location: france
Status: Offline
Posted: Dec 21, 2009 - 02:22 PM Reply with quote Back to top
if I can help you : "create_dialog();" don't exist in http://kamailio.org/docs/modules/1.5.x/dialog.html
is it just for opensips?

I think you have to read the module docs
please post your solution when you will find it.
View user's profile Send private message MSN Messenger
jps.sinningOffline



Joined: Dec 16, 2009
Posts: 3

Status: Offline
Posted: Dec 21, 2009 - 02:32 PM Reply with quote Back to top
Yes, the create_dialog(); function isn't implemented in kamailio, but I tried the: setflag("x"), but no luck, other people complains for the same:

Tue, 24 Mar 2009 02:19:17 -0700

On 03/24/2009 11:15 AM, IƱaki Baz Castillo wrote:
> 2009/3/24 Daniel-Constantin Mierla <mico...@******>:
>
>> Hello,
>>
>> do you get any particular error in the syslog?
>>
>> Can you try using dlg_mange() instead of setting the FLAG_DIALOG?
>> http://kamailio.org/docs/modules/1.5.x/ ... #id2531667
>>
>
> Thanks, that works but just if I set "dlg_manage()" before "set_dlg_profile():
>
> dlg_manage();
> set_dlg_profile("topbx");
>
> But the following doesn't work:
>
> setflag(FLAG_DIALOG);
> set_dlg_profile("topbx");
>


I tried the configuration this guy suggested but it didn't work, the dialog is never written in the database.

You may wondering why I'm still looking at Kamailio if opensips works ok, the problem is that the last version of opensips gave me a segmentation fault, and I feel kamailio ir more reliable.
View user's profile Send private message
micondaOffline



Joined: Feb 02, 2007
Posts: 357
Location: Germany
Status: Offline
Posted: Jan 04, 2010 - 08:50 AM Reply with quote Back to top
Are you using latest kamailio 1.5.3? The issues you reported in previous post were fixed. I use it and dialogs are written ok to database - I am using dlg_manage().
View user's profile Send private message


View previous topic Printable version Log in to check your private messages View next topic

Post new topic   Reply to topic
Forum Rules and Guidelines | About VoIP User | Privacy Policy


All logos and trademarks in this site are property of their respective owner.
Comments and posts are property of the poster, all the rest (c) 2003-2008 VoIP User Limited.

VoIP User Limited is incorporated in England and Wales under Company Number 6694577.

No part of this site may be reproduced without our prior consent.