Author Topic: no db query after the expires  (Read 11695 times)

jehanzaib_kiani

  • Newbie
  • *
  • Posts: 45
    • View Profile
no db query after the expires
« on: August 19, 2014, 02:44:48 AM »
Hi there,

something i have noticed that the first registration goes fine, but after the expires my soft phone sends the re-registration to yate but i get Not Found.
i am using [user.auth] , [user.register] and [user.unregister] from DB. it works fine when i register first time i have 60 seconds expire time set on my softphone but after this expire my softphone sends the re-register request to yate but the yate response is Not found. It does not happen when i use regfile

any idea please thanks

Monica Tepelus

  • Administrator
  • Full Member
  • *****
  • Posts: 198
    • View Profile
Re: no db query after the expires
« Reply #1 on: August 19, 2014, 05:56:55 AM »
Hi,

Can you please post a log with sniffer activated?

jehanzaib_kiani

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: no db query after the expires
« Reply #2 on: August 20, 2014, 01:55:52 AM »
Please see the attached logs
thanks

paulc

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: no db query after the expires
« Reply #3 on: August 20, 2014, 06:55:04 AM »
Hi!

The register module expects that the UPDATE affects some rows in the database. For MySQL an identical update returns zero affected rows.

Your user.register query seems incorrect, the `expires` column in the database should hold the absolute expire time not the expire interval:

  UPDATE sip_users SET fullcontact='sip/sip:100@xx.xx.xx.xx:9388',expires='60' WHERE username='100'


For MySQL your queries should probably look like:

  [user.register]
  query=UPDATE users SET fullcontact='${data}',expires=DATE_ADD(NOW(), INTERVAL ${expires} SECOND) WHERE username='${username}'
 
  [engine.timer]
  query=UPDATE users SET fullcontact=NULL,expires=NULL WHERE expires IS NOT NULL AND expires<=NOW()


jehanzaib_kiani

  • Newbie
  • *
  • Posts: 45
    • View Profile
Re: no db query after the expires
« Reply #4 on: August 25, 2014, 01:35:34 AM »
woo i think we nailed it ;)
all good much appreciated.