[SR-Users] RFC: best way to create dialogs

2015-01-22 Thread Klaus Darilion
Hi!

I use the dialog module to count and limit concurrent calls per user. It
worked fine with 4.1.7 but fails with 4.2.2.

My config basically looks like:
route{
  ...
  dlg_manage()
  ...
  authentication (stateless replies + exit)
  ...
  t_on_reply()
  t_on_branch()
  ...
  t_relay()
  exit;
}

initial_cbs_inscript uses the default value 1.


Using 4.1.7, after stateless reply+exit, Kamailio executes dialog
callbacks and deletes the dialog:
[dlg_var.c:55]: dlg_cfg_cb(): new dialog with no trasaction after config
execution
[dlg_hash.c:872]: dlg_unref(): unref dlg 0xb233c3a0 with 1 - 1
[dlg_hash.c:872]: dlg_unref(): unref dlg 0xb233c3a0 with 1 - 0
[dlg_hash.c:872]: dlg_unref(): ref =0 for dialog 0xb233c3a0
[dlg_hash.c:355]: destroy_dlg(): destroying dialog 0xb233c3a0 (ref 0)


With 4.2.2, after stateless reply+exit, Kamailio just exits without
calling any dialog callback (to destroy the dialog)

I think I could work around the problem by creating the transaction
later. Here are some ideas and I would be happy about your comments and
best practices.

- set initial_cbs_inscript to 0

- call dlg_manage() just before t_relay

- do not use dlg_manage() but use the dialog flag and set the flag
somewhere before t_relay


Finally, do t_on_reply() and t_on_branch() already create the
transaction or is it created with t_relay()?

Thanks
Klaus


___
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


Re: [SR-Users] Dialog module generates error since upgrade to 4.2.2

2015-01-22 Thread Klaus Darilion
Nice, I have the same problem after upgrading from 4.1.7 to 4.2.2. 
. in my case it seems the dialog callbacks are not executed for
responses ... I am still debugging .

On 22.01.2015 13:25, Jan Hazenberg wrote:
 Hi All,
 
 I'm running into a issue with the dialog module since the upgrade from
 4.2.1 to 4.2.2. I use the dialog module to add extra vars to the cdr's
 generated by the ACC module.
 
 I use the following config:
 
 # - dialog params -
 modparam(dialog, enable_stats, 1)
 modparam(dialog, dlg_match_mode, 1)
 modparam(dialog, dlg_flag, FLT_DLG)
 modparam(dialog, rr_param, did)
 modparam(dialog, wait_ack, 1)
 
 # Create dialog
 if (method==INVITE) {
  # Create Dialog
  dlg_manage();
 
  # Add test dialog var
  $dlg_var(src_ua) = $hdr(User-Agent);
 }
 
 
 This seems to work fine on kamailio 4.2.1 but after the upgrade i see
 the following errors in the logs:
 
 Jan 22 13:16:57 sip /usr/sbin/kamailio[2773]: CRITICAL: dialog
 [dlg_hash.c:901]: log_next_state_dlg(): bogus event 6 in state 1 for dlg
 0x7f2f0332ed40 [3693:11222] with clid
 '9192c5fc24627a14c2ec42f084a96587@192.168.149.126' and tags '4017642921' ''
 Jan 22 13:17:01 sip /usr/sbin/kamailio[2770]: CRITICAL: dialog
 [dlg_hash.c:901]: log_next_state_dlg(): bogus event 7 in state 1 for dlg
 0x7f2f0332ed40 [3693:11222] with clid
 '9192c5fc24627a14c2ec42f084a96587@192.168.149.126' and tags '4017642921' ''
 
 If i'm correct bogus event 6 in state 1 indicates that a ACK whas
 received while the dialog still was in unconfirmed state. Should i catch
 the 200 OK on the INVITE to update the dialog?
 
 Thanks,
 
 Jan Hazenberg
 
 
 
 
 
 
 
 
 
 
 
 ___
 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

___
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


[SR-Users] RedHat 7 packages issue

2015-01-22 Thread Alberto Panizzo
Hi all,
Thanks for your hard working on Kamailio!

I was just trying to install kamailio 4.2.X on a RedHat 7 machine but I got
checksum mismatch:

I took the yum configuration from:
http://rpm.kamailio.org/

[kamailio]
name=RPMs for Kamailio on RHEL 7
type=rpm-md
baseurl=http://rpm.kamailio.org/stable/RHEL_7/
gpgcheck=1
gpgkey=http://rpm.kamailio.org/stable/RHEL_7/repodata/repomd.xml.key
enabled=1

Than started yum update


$ sudo yum update
Loaded plugins: amazon-id, rhui-lb
kamailio
   | 1.2 kB  00:00:00
kamailio/primary   FAILED
   ]  0.0 B/s |0 B  --:--:-- ETA
http://rpm.kamailio.org/stable/RHEL_7/repodata/primary.xml.gz: [Errno -1]
Metadata file does not match checksum]  0.0 B/s |0 B  --:--:-- ETA
Trying other mirror.
kamailio/primary
   | 7.4 kB  00:00:00
http://rpm.kamailio.org/stable/RHEL_7/repodata/primary.xml.gz: [Errno -1]
Metadata file does not match checksum
Trying other mirror.


Indeed http://rpm.kamailio.org/stable/RHEL_7/repodata/repomd.xml says:
data type=primary
checksum type=sha4cc322a95d4a978e383903feaf8fbbe8ccc2ff9e/checksum
open-checksum
type=sha9fd04e59185a8e844133b834a662cae3cc0837b7/open-checksum
location href=repodata/primary.xml.gz/
timestamp1413465311/timestamp
size7344/size
open-size70829/open-size
/data

while  http://rpm.kamailio.org/stable/RHEL_7/repodata/primary.xml.gz I can
download is:

$ ls -l primary.xml.gz
-rw-rw-r-- 1 alberto alberto 7562 gen 22 10:58 primary.xml.gz
$ shasum primary.xml.gz
e8e052970984feb0cdb16b98f05aefc516295aba  primary.xml.gz

Do I have to switch to other repository?

Thank you,
Best Regards
--
Alberto Panizzo
CTO  -  Co-Founder

Amarula Solutions BV
Cruquiuskade 47
Amsterdam 1018 AM NL
T. +31(0)851119171
F. +31(0)204106211
www.amarulasolutions.com
___
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


Re: [SR-Users] topoh ACK Call-ID mismatch

2015-01-22 Thread Daniel Tryba
On Wednesday 21 January 2015 23:52:46 Daniel-Constantin Mierla wrote:
 It is an ACK for a negative response, therefore it is hop-by-hop
 (received and discared by kamailio, then a new one is generated to the
 next hop). The information of direction which was detected with Route
 header ftag cannot be done in this case. I will try to figure out how
 can be solved...

Am I to naive to think that these ACKs to negatives always (callid masking and 
whether topoh is active or not) need to use the Call-ID from the negative (in 
this case 488) response? Call-ID has only to be rewritten in forwarding the 
negative response towards the endpoint that triggered it (which is done 
correctly in my call trace)

-- 

Telefoon: 088 0100 700
Sales: sa...@pocos.nl | Service: serviced...@pocos.nl
http://www.pocos.nl/ | Croy 9c, 5653 LC Eindhoven | Kamer van Koophandel 
17097024

___
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


[SR-Users] reINVITE with uac_req_send()

2015-01-22 Thread Le Truong Giang
Hi !
I have the following simple scenario
A --- Kamailio --- Asterisk --- B
now i'm trying to handle Timeout reply when B is unavailable. First i suspend 
transaction and wait for B available.
i use uac_reg_send() to reINVITE B .The problem is when B available, it receive 
INVITE but A doesn't receive ACK therefore the call is incomplete
I guess the reason is source IP in reINVITE is Kamailio's not A's IP, so ACK 
can't reach A.
How can i set this source IP to A's IP ?
Any idea is appreciated
Thank you !
___
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


Re: [SR-Users] fix_nated_contact and IPv6

2015-01-22 Thread Klaus Darilion
Sounds like a bug.

Anyway, as fix_nated_contact is not standard conform, it is better to
use handle_ruri_alias() and add_contact_alias() (see the Kamailio
default config file). Maybe they handle also IPv6 correct.

regards
Klaus

On 22.01.2015 16:26, Sebastian Damm wrote:
 Hi,
 
 I'm trying to set up a Kamailio (4.1.3) server which converts between
 IPv6 and IPv4. Everything looks pretty good. Now I have a test client
 which sends packets via IPv6, but in contact header, SDP etc. there are
 still IPv4 addresses. (This comes from some converting from v4 to v6
 earlier.) Thus, Kamailio tries to do a fix_nated_contact(). But after
 fixing, the Contact URI is wrong.
 
 Example:
 inbound
 Contact: sip:bob@192.168.8.132 mailto:sip%3Abob@192.168.8.132
 
 outbound
 Contact: sip:bob@1234:1234:0:1234:0:0:0:2
 
 The correct way of transforming the Contact URI would be:
 Contact: sip:bob@[1234:1234:0:1234:0:0:0:2]
 
 This incorrect Contact URI doesn't hurt first, but when the called party
 wants to hang up the call, it addresses the URI from Contact header, and
 Kamailio can't parse the Request URI:
 
 
 Jan 22 12:03:48 router /usr/sbin/kamailio[21309]: ERROR: pv
 [pv_core.c:304]: pv_get_ruri_attr(): failed to parse the R-URI
 Jan 22 12:03:48 router /usr/sbin/kamailio[21309]: ERROR: rr
 [loose.c:934]: loose_route(): failed to parse Request URI
 Jan 22 12:03:48 router /usr/sbin/kamailio[21309]: ERROR: domain
 [domain.c:140]: is_uri_host_local(): error while parsing R-URI
 
 
 Is this a bug in the nathelper module? Was it never meant to handle IPv6
 addresses? Or do I understand something wrong?
 
 Best Regards,
 Sebastian
 
 
 ___
 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
 

___
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


Re: [SR-Users] fix_nated_contact and IPv6

2015-01-22 Thread Daniel-Constantin Mierla
Couple of remarks:

1) I guess the initial author know there is no nat in ipv6, so he didn't
bother with. I just pushed a patch for it in master (814c08f3), if
tested and reported to work ok, it can be backported

2) the contact uri example in the first email is perhaps not properly
reflecting the contact uri that was generated, because it should have
been with the ip address and the port. It seems to be only the ip
address. If there was an omission, that's ok, because I expect the uri
parsing error is due to hostpart having the port following the ipv6
address -- that requires the ipv6 between []. If the port was missing,
that can be another issue, but the code shows the port is always added
and it wouldn't worked at all so far without it.

3) use set_contact_alias() if use modules that need the new contact
(like dialog, presence, ...) for later usage. The *contact_alias()
function don't change the host/port part, they just add a new parameter,
so it would have been safe with or without []. Anyhow, the code adds []
if the address is ipv6

Cheers,
Daniel

On 22/01/15 16:43, Klaus Darilion wrote:
 Sounds like a bug.

 Anyway, as fix_nated_contact is not standard conform, it is better to
 use handle_ruri_alias() and add_contact_alias() (see the Kamailio
 default config file). Maybe they handle also IPv6 correct.

 regards
 Klaus

 On 22.01.2015 16:26, Sebastian Damm wrote:
 Hi,

 I'm trying to set up a Kamailio (4.1.3) server which converts between
 IPv6 and IPv4. Everything looks pretty good. Now I have a test client
 which sends packets via IPv6, but in contact header, SDP etc. there are
 still IPv4 addresses. (This comes from some converting from v4 to v6
 earlier.) Thus, Kamailio tries to do a fix_nated_contact(). But after
 fixing, the Contact URI is wrong.

 Example:
 inbound
 Contact: sip:bob@192.168.8.132 mailto:sip%3Abob@192.168.8.132

 outbound
 Contact: sip:bob@1234:1234:0:1234:0:0:0:2

 The correct way of transforming the Contact URI would be:
 Contact: sip:bob@[1234:1234:0:1234:0:0:0:2]

 This incorrect Contact URI doesn't hurt first, but when the called party
 wants to hang up the call, it addresses the URI from Contact header, and
 Kamailio can't parse the Request URI:


 Jan 22 12:03:48 router /usr/sbin/kamailio[21309]: ERROR: pv
 [pv_core.c:304]: pv_get_ruri_attr(): failed to parse the R-URI
 Jan 22 12:03:48 router /usr/sbin/kamailio[21309]: ERROR: rr
 [loose.c:934]: loose_route(): failed to parse Request URI
 Jan 22 12:03:48 router /usr/sbin/kamailio[21309]: ERROR: domain
 [domain.c:140]: is_uri_host_local(): error while parsing R-URI


 Is this a bug in the nathelper module? Was it never meant to handle IPv6
 addresses? Or do I understand something wrong?

 Best Regards,
 Sebastian


 ___
 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

 ___
 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

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda


___
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


Re: [SR-Users] Dialog module generates error since upgrade to 4.2.2

2015-01-22 Thread Klaus Darilion
Hi Jan!

I replaced dlg_manage with setflag(dialog flag). This way the dialog is
created only when a transaction is created. It solved my problems.

regards
Klaus



On 22.01.2015 14:47, Klaus Darilion wrote:
 Nice, I have the same problem after upgrading from 4.1.7 to 4.2.2. 
 . in my case it seems the dialog callbacks are not executed for
 responses ... I am still debugging .
 
 On 22.01.2015 13:25, Jan Hazenberg wrote:
 Hi All,

 I'm running into a issue with the dialog module since the upgrade from
 4.2.1 to 4.2.2. I use the dialog module to add extra vars to the cdr's
 generated by the ACC module.

 I use the following config:

 # - dialog params -
 modparam(dialog, enable_stats, 1)
 modparam(dialog, dlg_match_mode, 1)
 modparam(dialog, dlg_flag, FLT_DLG)
 modparam(dialog, rr_param, did)
 modparam(dialog, wait_ack, 1)

 # Create dialog
 if (method==INVITE) {
  # Create Dialog
  dlg_manage();

  # Add test dialog var
  $dlg_var(src_ua) = $hdr(User-Agent);
 }


 This seems to work fine on kamailio 4.2.1 but after the upgrade i see
 the following errors in the logs:

 Jan 22 13:16:57 sip /usr/sbin/kamailio[2773]: CRITICAL: dialog
 [dlg_hash.c:901]: log_next_state_dlg(): bogus event 6 in state 1 for dlg
 0x7f2f0332ed40 [3693:11222] with clid
 '9192c5fc24627a14c2ec42f084a96587@192.168.149.126' and tags '4017642921' ''
 Jan 22 13:17:01 sip /usr/sbin/kamailio[2770]: CRITICAL: dialog
 [dlg_hash.c:901]: log_next_state_dlg(): bogus event 7 in state 1 for dlg
 0x7f2f0332ed40 [3693:11222] with clid
 '9192c5fc24627a14c2ec42f084a96587@192.168.149.126' and tags '4017642921' ''

 If i'm correct bogus event 6 in state 1 indicates that a ACK whas
 received while the dialog still was in unconfirmed state. Should i catch
 the 200 OK on the INVITE to update the dialog?

 Thanks,

 Jan Hazenberg











 ___
 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
 
 ___
 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
 

___
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


[SR-Users] fix_nated_contact and IPv6

2015-01-22 Thread Sebastian Damm
Hi,

I'm trying to set up a Kamailio (4.1.3) server which converts between IPv6
and IPv4. Everything looks pretty good. Now I have a test client which
sends packets via IPv6, but in contact header, SDP etc. there are still
IPv4 addresses. (This comes from some converting from v4 to v6 earlier.)
Thus, Kamailio tries to do a fix_nated_contact(). But after fixing, the
Contact URI is wrong.

Example:
inbound
Contact: sip:bob@192.168.8.132

outbound
Contact: sip:bob@1234:1234:0:1234:0:0:0:2

The correct way of transforming the Contact URI would be:
Contact: sip:bob@[1234:1234:0:1234:0:0:0:2]

This incorrect Contact URI doesn't hurt first, but when the called party
wants to hang up the call, it addresses the URI from Contact header, and
Kamailio can't parse the Request URI:


Jan 22 12:03:48 router /usr/sbin/kamailio[21309]: ERROR: pv
[pv_core.c:304]: pv_get_ruri_attr(): failed to parse the R-URI
Jan 22 12:03:48 router /usr/sbin/kamailio[21309]: ERROR: rr [loose.c:934]:
loose_route(): failed to parse Request URI
Jan 22 12:03:48 router /usr/sbin/kamailio[21309]: ERROR: domain
[domain.c:140]: is_uri_host_local(): error while parsing R-URI


Is this a bug in the nathelper module? Was it never meant to handle IPv6
addresses? Or do I understand something wrong?

Best Regards,
Sebastian
___
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


Re: [SR-Users] Trouble getting start time / call duration from dialog module

2015-01-22 Thread Will Ferrer
Hi Abdul

I just wanted to check int. Did you have any ideas of things we could try
or more information we could get you to assistance?

Thanks again for your help, the input we have gotten from you and Daniel
has always been invaluable.

All the best.

Will Ferrer
Switchsoft

On Fri, Jan 16, 2015 at 7:42 PM, Will Ferrer will.fer...@switchsoft.com
wrote:

 Hi Abdul

 That's great. I look forward to the advice.

 Thanks again for the assistance and I hope you have a great weekend.

 All the best.

 Will

 On Fri, Jan 16, 2015 at 6:44 PM, Abdul Gafar abdul.gafar@gmail.com
 wrote:

 Hi Wiil

 I will be try help you

 //Gafar

 On Sat, Jan 17, 2015 at 4:43 AM, Will Ferrer will.fer...@switchsoft.com
 wrote:

 Hi Adbul

 Thanks, I am glad the information is useful.

 Do you have any thoughts on what I could I try next to get that 
 $dlg(start_ts)
 value populated in the dialog as it is still not working about adding the
 loose_route() function?

 I also tried looking at the logs for any reference to dialog -- tail -f
 /var/log/syslog | grep dialog

 The only thing that came up with rtpengine talking about dialogs so no
 clues there.

 Thanks to you guys for the help.

 All the best.

 Will

 On Fri, Jan 16, 2015 at 1:25 AM, Abdul Gafar abdul.gafar@gmail.com
 wrote:




 *Hi Will,Thanks for sharing very useful information.*


 *//Gafar*


 On Fri, Jan 16, 2015 at 12:48 PM, Will Ferrer 
 will.fer...@switchsoft.com wrote:

 Hi Daniel

 Thanks so much for the response and help as always.

 I tried changing my config to use loose route.

 It looks like this now:

 loadmodule dialog.so

 ...
 modparam(dialog, db_url, DBURL)
 modparam(dialog, db_mode, 1)
 modparam(dialog, dlg_flag, 4)
 modparam(dialog, dlg_match_mode, 1)

 ...

 request_route {
 if (is_method(INVITE)  (! has_totag() ) ) {
 dlg_manage();
 xlog (L_INFO, request_route DIALOG TEST: Dialog initiated);
 }
 if (is_method(BYE)) {
 #dlg_manage();
 loose_route();
 $var(elapsed) = ( $TV(s) - $dlg(start_ts) );
 xlog (L_INFO, request_route DIALOG TEST: Completed $dlg(from_uri)
 to $dlg(to_uri), elapsed: $var(elapsed), now seconds: $TV(s), dlg start
 time: $dlg(start_ts), DLG_lifetime: $DLG_lifetime);
 }
 

 I now get:

 INFO: script: request_route DIALOG TEST: Dialog initiate
 INFO: script: request_route DIALOG TEST: Completed
 sip:willf1976t...@develop-sbc.switchsoft.com to
 sip:+18054515...@develop-sbc.switchsoft.com, elapsed: 1421386898, now
 seconds: 1421386898, dlg start time: 0, DLG_lifetime: 1421386898


 So the $DLG_lifetime is being populated, but it has all the seconds
 since epoch time. You can also see that the $dlg(start_ts) is 0.

 I also tried using the dlg_manage() instead of the loose route in my
 test and got the same result.

 Any idea what might be missing?

 Thanks again for your help.

 All the best.

 Will






 On Thu, Jan 15, 2015 at 5:53 AM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:
 
  Hello,
 
  try to do dlg_manage() or lose_route() before accessing the dialog
 variables.
 
  Cheers,
  Daniel
 
 
  On 15/01/15 08:25, Will Ferrer wrote:
 
  An update on this.
 
  I tried setting my dialog module to the use the db. No db entry is
 ever made.
 
  My config looks like this now:
 
  loadmodule dialog.so
 
  ...
  modparam(dialog, db_url, DBURL)
  modparam(dialog, db_mode, 1)
  modparam(dialog, dlg_flag, 4)
  modparam(dialog, dlg_match_mode, 1)
 
  ...
 
  request_route {
  if (is_method(INVITE)  (! has_totag() ) ) {
  dlg_manage();
  }
  if (is_method(BYE)) {
  $var(elapsed) = ( $TV(s) - $dlg(start_ts) );
  xlog (L_INFO, request_route DIALOG TEST: Completed $dlg(from_uri)
 to $dlg(to_uri), elapsed: $var(elapsed), now seconds: $TV(s), dlg start
 time: $dlg(start_ts), DLG_lifetime: $DLG_lifetime);
  }
  
 
 
  I hope this message finds every one well.
 
  All the best.
 
  Will
 
  On Thu, Jan 15, 2015 at 12:03 AM, Will Ferrer 
 will.fer...@switchsoft.com wrote:
 
  Hi All
 
  I am in need of being able to see what the duration of the call was
 at the time of hang out.
 
  I tried turning on the dialog module, but the result is that the
 values I need are either null or always show as zero.
 
  I tried to follow the suggestions in the thread about this here:
 
 
 http://lists.sip-router.org/pipermail/sr-users/2010-October/065889.html
 
  In the end my config looks like this:
 
  loadmodule dialog.so
 
  ...
 
  modparam(dialog, dlg_flag, 4)
  modparam(dialog, dlg_match_mode, 1)
 
  ...
 
  request_route {
  if (is_method(INVITE)  (! has_totag() ) ) {
  dlg_manage();
  }
  if (is_method(BYE)) {
  $var(elapsed) = ( $TV(s) - $dlg(start_ts) );
  xlog (L_INFO, request_route DIALOG TEST: Completed
 $dlg(from_uri) to $dlg(to_uri), elapsed: $var(elapsed), now seconds:
 $TV(s), dlg start time: $dlg(start_ts), DLG_lifetime: $DLG_lifetime);
  }
  
 
 
 
  Note that I put at the top of the request route just for testing
 purposes
 
  The result I get in 

Re: [SR-Users] Dialog module generates error since upgrade to 4.2.2

2015-01-22 Thread Jan Hazenberg

Klaus,

Yes, that solves the problem here as well.

Thanks,

Jan

Klaus Darilion schreef op 2015-01-22 16:16:

Hi Jan!

I replaced dlg_manage with setflag(dialog flag). This way the dialog is
created only when a transaction is created. It solved my problems.

regards
Klaus



On 22.01.2015 14:47, Klaus Darilion wrote:
Nice, I have the same problem after upgrading from 4.1.7 to 4.2.2. 


. in my case it seems the dialog callbacks are not executed for
responses ... I am still debugging .

On 22.01.2015 13:25, Jan Hazenberg wrote:

Hi All,

I'm running into a issue with the dialog module since the upgrade 
from
4.2.1 to 4.2.2. I use the dialog module to add extra vars to the 
cdr's

generated by the ACC module.

I use the following config:

# - dialog params -
modparam(dialog, enable_stats, 1)
modparam(dialog, dlg_match_mode, 1)
modparam(dialog, dlg_flag, FLT_DLG)
modparam(dialog, rr_param, did)
modparam(dialog, wait_ack, 1)

# Create dialog
if (method==INVITE) {
 # Create Dialog
 dlg_manage();

 # Add test dialog var
 $dlg_var(src_ua) = $hdr(User-Agent);
}


This seems to work fine on kamailio 4.2.1 but after the upgrade i see
the following errors in the logs:

Jan 22 13:16:57 sip /usr/sbin/kamailio[2773]: CRITICAL: dialog
[dlg_hash.c:901]: log_next_state_dlg(): bogus event 6 in state 1 for 
dlg

0x7f2f0332ed40 [3693:11222] with clid
'9192c5fc24627a14c2ec42f084a96587@192.168.149.126' and tags 
'4017642921' ''

Jan 22 13:17:01 sip /usr/sbin/kamailio[2770]: CRITICAL: dialog
[dlg_hash.c:901]: log_next_state_dlg(): bogus event 7 in state 1 for 
dlg

0x7f2f0332ed40 [3693:11222] with clid
'9192c5fc24627a14c2ec42f084a96587@192.168.149.126' and tags 
'4017642921' ''


If i'm correct bogus event 6 in state 1 indicates that a ACK whas
received while the dialog still was in unconfirmed state. Should i 
catch

the 200 OK on the INVITE to update the dialog?

Thanks,

Jan Hazenberg











___
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


___
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



___
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


___
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


Re: [SR-Users] Does forking impact max_inv_lifetime?

2015-01-22 Thread Daniel-Constantin Mierla
I haven't used the feature myself (nor implemented it), but it is what I
expect. Maybe you can run in debug mode and map the logs with the code
to see what happens.

Cheers,
Daniel

On 22/01/15 00:04, Alex Balashov wrote:
 Daniel,

 Will failure_route will be called immediately when the transaction expires? I 
 tried a call where max_inv_lifetime was set at 5 ms and fr_inv_timer at 
 4 ms. Several new branches were attempted, each sending some 183s or 
 180s, and Kamailio did not CANCEL the last pending branch until 83 sec into 
 the call. Is there something I'm missing about how to handle the transaction 
 expiration in real time?

 --
 Sent from my BlackBerry. Please excuse errors and brevity.
   Original Message  
 From: Daniel-Constantin Mierla
 Sent: Wednesday, January 21, 2015 5:59 PM
 To: Kamailio (SER) - Users Mailing List
 Reply To: mico...@gmail.com
 Subject: Re: [SR-Users] Does forking impact max_inv_lifetime?

 Hello,

 somehow your emails are a bit confusing, in first one you say that you
 cannot get max_inv_lifetime as per transaction, being reset by a new
 branch, is that still true?

 The failure route should be called when the transaction is expired.

 Cheers,
 Daniel

 On 21/01/15 18:16, Alex Balashov wrote:
 Maybe I should ask this question another way that is more applicable
 to my end-goal:

 What exactly happens when max_inv_lifetime is reached without a final
 response? Is a failure_route invoked? If so, is the appropriate means
 of dealing with this to check t_is_expired() and handle it at that level?


-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda


___
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


[SR-Users] CDRs and MongoDB

2015-01-22 Thread Mickael Marrache
Hi,

 

Is it possible to write CDRs directly to MongoDB using the new db_mongodb
module?

 

modparam(acc, db_url, DB_MONGO_URL)

modparam(acc, cdr_enable, 1)

modparam(acc, cdr_extra,  . )

modparam(acc, cdr_log_enable, 0)

modparam(acc, cdrs_table, cdrs)

 

 

In the acc module documentation, I found the following statement:

 

Note that CDR generation does not involve any kind of database storage
(yet). In order to persist the CDRs into a database you will have to set up
an exterior process (i.e., a script living outside of Kamailio) and
implement the storage task yourself.

 

Thanks,

Mickael

___
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