[SR-Users] dlg_manage() and add_contact_alias() problem

Pavel Miskov miskov.pavel at gmail.com
Mon Dec 17 12:47:48 CET 2012


Hi Daniel,

sorry for delay, I was out of office.

here are dialog attributes for this to cases, with ngrep output and
configuration at the end.


Thanks

Pavel


1. add_contact_alias()
--------------------------------

./kamctl fifo profile_list_dlgs caller
dialog::  hash=3965:7641
        state:: 4
        ref_count:: 2
        timestart:: 1355743238
        timeout:: 60993875
        callid:: d4e9b8c4b17c2f8001704dedccc78e4c at 0:0:0:0:0:0:0:0
        from_uri:: sip:alice at example.load
        from_tag:: fe895d80
        caller_contact::
sip:alice at 10.2.5.112:5060;transport=udp;registering_acc=example_load
        caller_cseq:: 2
        caller_route_set::
        caller_bind_addr:: udp:11.22.111.222:5060
        callee_bind_addr:: udp:11.22.111.222:5060
        to_uri:: sip:bob at testing.load
        to_tag:: e9648c0277e15011i0
        callee_contact:: sip:bob at 10.2.4.130:5060
        callee_cseq:: 2
        callee_route_set::

ngrep output:
#
U 11.22.111.222:5060 -> 10.2.5.112:5060
  BYE sip:alice at 10.2.5.112:5060;transport=udp;registering_acc=example_load
SIP/2.0..Via: SIP/2.0/UDP
11.22.111.222;branch=z9hG4bK2bfc.ace765f3.0..To: sip:
  alice at example.load;tag=fe895d80..From:
sip:bob at testing.load;tag=e9648c0277e15011i0..CSeq: 3 BYE..Call-ID:
d4e9b8c4b17c2f8001704dedccc78e4c at 0:0:0:0:0:0
  :0:0..Content-Length: 0..User-Agent: kamailio (3.3.2
(x86_64/linux))..Max-Forwards: 70....
#
U 11.22.111.222:5060 -> 10.2.4.130:5060
  BYE sip:bob at 10.2.4.130:5060 SIP/2.0..Via: SIP/2.0/UDP
11.22.111.222;branch=z9hG4bK2bfc.bce765f3.0..To:
sip:bob at testing.load;tag=e9648c0277e15011i0..
  From: sip:alice at example.load;tag=fe895d80..CSeq: 3 BYE..Call-ID:
d4e9b8c4b17c2f8001704dedccc78e4c at 0:0:0:0:0:0:0:0..Content-Length:
0..User-Agent: kamai
  lio (3.3.2 (x86_64/linux))..Max-Forwards: 70....


2. fix_nated_contact()
-------------------------------

./kamctl fifo profile_list_dlgs caller
dialog::  hash=3688:11727
        state:: 4
        ref_count:: 2
        timestart:: 1355741746
        timeout:: 53323007
        callid:: e0e6443a46b8448121e731390ec255e2 at 0:0:0:0:0:0:0:0
        from_uri:: sip:alice at example.load
        from_tag:: 85acc1ab
        caller_contact::
sip:alice at 3.4.5.6:52556;transport=udp;registering_acc=example_load
        caller_cseq:: 2
        caller_route_set::
        caller_bind_addr:: udp:11.22.111.222:5060
        callee_bind_addr:: udp:11.22.111.222:5060
        to_uri:: sip:bob at testing.load
        to_tag:: 56c9050dcfebc91i0
        callee_contact:: sip:bob at 7.8.9.0:5060
        callee_cseq:: 2
        callee_route_set::

ngrep output:
#
U 11.22.111.222:5060 -> 3.4.5.6:52556
  BYE sip:alice at 3.4.5.6:52556;transport=udp;registering_acc=example_load
SIP/2.0..Via: SIP/2.0/UDP
11.22.111.222;branch=z9hG4bKd9ee.f0980c15.0..To:
   sip:alice at example.load;tag=85acc1ab..From:
sip:bob at testing.load;tag=56c9050dcfebc91i0..CSeq: 3 BYE..Call-ID:
e0e6443a46b8448121e731390ec255e2 at 0:0:0:0
  :0:0:0:0..Content-Length: 0..User-Agent: kamailio (3.3.2
(x86_64/linux))..Max-Forwards: 70....
#
U 11.22.111.222:5060 -> 7.8.9.0:5060
  BYE sip:bob at 7.8.9.0:5060 SIP/2.0..Via: SIP/2.0/UDP
11.22.111.222;branch=z9hG4bKd9ee.01980c15.0..To:
sip:bob at testing.load;tag=56c9050dcfebc91i
  0..From: sip:alice at example.load;tag=85acc1ab..CSeq: 3 BYE..Call-ID:
e0e6443a46b8448121e731390ec255e2 at 0:0:0:0:0:0:0:0..Content-Length:
0..User-Agent: ka
  mailio (3.3.2 (x86_64/linux))..Max-Forwards: 70....
#
U 7.8.9.0:5060 -> 11.22.111.222:5060
  SIP/2.0 200 OK..To:
sip:bob at testing.load;tag=56c9050dcfebc91i0..From:
sip:alice at example.load;tag=85acc1ab..Call-ID:
e0e6443a46b8448121e731390ec255e2 at 0
  :0:0:0:0:0:0:0..CSeq: 3 BYE..Via: SIP/2.0/UDP
11.22.111.222;branch=z9hG4bKd9ee.01980c15.0..Server:
Linksys/SPA942-5.1.15(a)..Content-Length: 0....
#
U 3.4.5.6:52556 -> 11.22.111.222:5060
  SIP/2.0 200 OK..To: <sip:alice at example.load>;tag=85acc1ab..Via:
SIP/2.0/UDP 11.22.111.222;branch=z9hG4bKd9ee.f0980c15.0..CSeq: 3
BYE..Call-ID: e0e6443a4
  6b8448121e731390ec255e2 at 0:0:0:0:0:0:0:0..From:
<sip:bob at testing.load>;tag=56c9050dcfebc91i0..Contact: "Pero Probna"
<sip:alice at 10.2.5.112:5060;transp
  ort=udp;registering_acc=example_load>..User-Agent:
Jitsi1.0-build.3967Windows 7..Content-Length: 0....



3. configuration is sample configuration in v3.3.2 with addition of dialog part
------------------------------------------------------------------------------------------------------------

#--- dialog ---
modparam("dialog", "db_url", "mysql://xxx:xxx@localhost/xxx")
modparam("dialog", "db_mode", 2)
modparam("dialog", "db_update_period", 60)
modparam("dialog", "dlg_flag", DLGFLAG)
modparam("dialog", "profiles_with_value", "caller")
modparam("dialog", "default_timeout", 60)

...
if (is_method("INVITE")){
   route(CALL_RESTRICTION);
   setflag(FLT_ACC); # do accounting
}

route[CALL_RESTRICTION] {
   setflag(DLGFLAG);
   # call timeout
   $dlg_ctx(timeout_route) = "DIALOG_END";
   $dlg_ctx(timeout_bye) = 1;

   dlg_manage();

   # call limit
   get_profile_size("caller", "$fu", "$var(LIMIT)");
   if( $var(LIMIT) >= 1){
       sl_send_reply("403", "Simultaneous calls limit reached");
       exit;
    }
    set_dlg_profile("caller","$fu");
}

route[DIALOG_END]{
    xlog ("L_INFO", "ROUTE DIALOG_END set: $dlg_ctx(set) h_id:
$dlg(h_id) h_entry: $dlg(h_entry) \n");
    exit;
}
...

On Thu, Dec 13, 2012 at 12:19 PM, Daniel-Constantin Mierla
<miconda at gmail.com> wrote:
> Hello,
>
> can you dump the dialog attributes (via mi/kamctl or from database) for the
> two cases? Just to see what is stored different there.
>
> Cheers,
> Daniel
>
>
> On 12/6/12 3:55 PM, Pavel Miskov wrote:
>
> Hi all,
>
> I want to end dialog (Kamailio sends BYE to both parties) that is lasting
> longer then some defined time. everything is working fine when using old
> fix_nated_contact function, but when using new add_contact_alias function
> kamailio sends BYE to private addresses.
>
> 1. "kamctl fifo dlg_list" output when using fix_nated_contact():
>
>  caller_contact:: sip:bob at PUBLIC_IP:50784
>  callee_contact:: sip:alice at PUBLIC_IP:64472
>
> 2. "kamctl fifo dlg_list" output when using add_contact_alias():
>
> caller_contact:: sip:bob at 10.2.5.206:10000
> callee_contact:: sip:alice at 10.2.5.205:20000
>
>
> dlg_manag() doesn't store contact alias for caller and callee so Kamailio is
> sending BYE to private addresses. Am I doing something wrong or I can't use
> possibility of ending dialog with contact aliases?
>
> Thank you
>
> Pavel
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
> --
> Daniel-Constantin Mierla - http://www.asipto.com
> http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda



More information about the sr-users mailing list