sipcapture / homer-api

HOMER 5: Back-End (API) DEPRICATED - use sipcapture/homer-app
http://sipcapture.org
27 stars 67 forks source link

Default values for fields of homer DB schema. #11

Closed kvishnivetsky closed 9 years ago

kvishnivetsky commented 9 years ago

Hi, Guys.

Is it critical for application, that some fields of tables have no default values in DB? I made a fixup in my test installation because of sipcapture module of kamailio repoted errors like: ***: Filed 'XXXX' doesn't have a defalt value

If it is not critical, I'l add default to all fields in DB and make a pull request.

adubovikov commented 9 years ago

yes please do, because now, >= mysql 5.6 has strict sql mode by default thank you!

kvishnivetsky commented 9 years ago

Thank you, for reply. I'v dived deeper in an issue and have some quesitons:

  1. Why are there "SIP RESPONSE CODES" written in CSEQ field in STATS queries?
  2. Why are they written for oneMETHODS and are not for another?
adubovikov commented 9 years ago

can you please link it to the kamailio.cfg ?

kvishnivetsky commented 9 years ago

Ok, here we are: Query with 401 status code written to CSEQ db table stats_method field: https://github.com/sipcapture/homer-api/blob/master/examples/sipcapture/kamailio.cfg#L568

Query withot CSEQ field written: https://github.com/sipcapture/homer-api/blob/master/examples/sipcapture/kamailio.cfg#L542

BTW: I can make a patch for DB schema, but I'm afraid of we may miss a logical misstake, that will be hidden by this patch.

adubovikov commented 9 years ago

maybe i don't understand, but we write response codes with their cseq method:

(from_date, to_date, method, cseq, total) VALUES ($var(f_date), $var(t_date), '407', 'INVITE', $sht(a=>response::407::invite))

and for methods (REQUESTS) of course we have same cseq == method, so not needed write it twice.

kvishnivetsky commented 9 years ago

So: method is actually "message type" (METHOD for REQ and STATUS for RESP) cseq is actually a method from SIP message. Right?

adubovikov commented 9 years ago

yep

kvishnivetsky commented 9 years ago

Ok. I'll commit DB schema from kamailio 4.3.X(SVN) sipcapture module sources, there are default values.for all fields.

adubovikov commented 9 years ago

thanks