<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><tt>Hi Jennifer,</tt></p>
<p><tt>Thanks for the awesome report! Would you mind testing out
this patch [1] to see if it makes Postgres happy?</tt></p>
<p><tt>[1]: <a class="moz-txt-link-freetext" href="http://chunk.io/liviuc/d64d605a335144709667f4647f4a7369">http://chunk.io/liviuc/d64d605a335144709667f4647f4a7369</a></tt></p>
<p><tt>Best regards,</tt><br>
</p>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 21.08.2017 23:25, Jennifer Hashimoto
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:A88C7582-93C8-4A96-B63A-219C535C78B5@caztel.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
HI everyone,
<div class=""><br class="">
<div class="">I decided to setup homer sip capture with opensips
as the program that inserts into my homer database because I
use opensips everywhere else so it makes sense.</div>
<div class=""><br class="">
</div>
<div class="">I use postgres as the backend.</div>
<div class=""><br class="">
</div>
<div class="">I am experiencing a problem where many sip
messages are not getting inserted into the database due to key
violations.</div>
<div class=""><br class="">
</div>
<div class="">I do get some rows in my tables, all with id 0
since the primary key is id + date (but as we know sip message
happen very fast and can be exactly the same including
timestamp)</div>
<div class=""><br class="">
</div>
<div class="">I made a test of the database auto increment by
manually inserting a row without specifying the id field (ie.
insert into sip_capture_rest_20170821 (date, ... ) values
(’2017-08… and it correctly put the id as 1 (auto incremented
it as all the others were 0)</div>
<div class=""><br class="">
</div>
<div class="">I am using opensips.cfg from <a
href="https://github.com/sipcapture/homer-api/blob/da13a87b8eda55d4c597ce32270521249ab21dc4/examples/sipcapture/sipcapture.opensips"
class="" moz-do-not-send="true">https://github.com/sipcapture/homer-api/blob/da13a87b8eda55d4c597ce32270521249ab21dc4/examples/sipcapture/sipcapture.opensips</a></div>
<div class=""><br class="">
</div>
<div class="">(I put … for the non valid information)</div>
<div class=""><br class="">
</div>
<div class="">from my opensips log file:</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span> 2017-08-21
14:26:15) already exists.#012 Query: insert into
sip_capture_rest_20170821 (id,date, ... ) values
(0,’2017-08...</div>
<div class="">
<div class=""><br class="">
</div>
<div class="">my database is defined as:</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">CREATE TABLE public.sip_capture_call_20170821
(</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>id
int8 NOT NULL DEFAULT
nextval('sip_capture_call_20170821_id_seq'::regclass),</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>"date"
timestamp NOT NULL DEFAULT now(),</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>micro_ts
int8 NOT NULL DEFAULT 0::bigint,</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>...</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>CONSTRAINT
sip_capture_call_20170821_pkey PRIMARY KEY (id,"date")</div>
<div class="">)</div>
<div class="">WITH (</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>OIDS=FALSE</div>
<div class="">) ;</div>
<div class="">CREATE INDEX
sip_capture_call_20170821_auth_user ON
public.sip_capture_call_20170821 (auth_user) ;</div>
<div class="">CREATE INDEX sip_capture_call_20170821_callid
ON public.sip_capture_call_20170821 (callid) ;</div>
<div class="">CREATE INDEX
sip_capture_call_20170821_callid_aleg ON
public.sip_capture_call_20170821 (callid_aleg) ;</div>
<div class="">CREATE INDEX sip_capture_call_20170821_date ON
public.sip_capture_call_20170821 (date) ;</div>
<div class="">CREATE INDEX
sip_capture_call_20170821_from_user ON
public.sip_capture_call_20170821 (from_user) ;</div>
<div class="">CREATE INDEX
sip_capture_call_20170821_pid_user ON
public.sip_capture_call_20170821 (pid_user) ;</div>
<div class="">CREATE INDEX
sip_capture_call_20170821_ruri_user ON
public.sip_capture_call_20170821 (ruri_user) ;</div>
<div class="">CREATE INDEX sip_capture_call_20170821_to_user
ON public.sip_capture_call_20170821 (to_user) ;</div>
</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><br class="">
</div>
<div class="">CREATE SEQUENCE
public.sip_capture_call_20170821_id_seq</div>
<div class="">INCREMENT BY 1</div>
<div class="">MINVALUE 1</div>
<div class="">MAXVALUE 9223372036854775807</div>
<div class="">START 1;</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class="">Jennifer</div>
<div class="">
<div class=""><span style="orphans: 2; widows: 2;" class="">---------------------------------------------------</span><br
style="orphans: 2; widows: 2;" class="">
<span style="orphans: 2; widows: 2;" class="">Jennifer
Akemi Hashimoto</span><br style="orphans: 2; widows: 2;"
class="">
<span style="orphans: 2; widows: 2;" class="">Caztel
Communications</span><br style="orphans: 2; widows: 2;"
class="">
<a href="mailto:jennifer.hashimoto@caztel.com"
style="orphans: 2; widows: 2;" class=""
moz-do-not-send="true">jennifer.hashimoto@caztel.com</a><br
style="orphans: 2; widows: 2;" class="">
<span style="orphans: 2; widows: 2;" class="">905-836-5445 </span></div>
</div>
<br class="">
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>