[OpenSIPS-Users] opensips sip_capture + homer with postgres

Jennifer Hashimoto jennifer.hashimoto at caztel.com
Tue Aug 22 11:40:13 EDT 2017


Hi Liviu,
Thanks :)
Postgres is very happy with your patch. I have non zero ID’s and my messages are now getting inserted.

Jennifer

---------------------------------------------------
Jennifer Akemi Hashimoto
Caztel Communications
jennifer.hashimoto at caztel.com <mailto:jennifer.hashimoto at caztel.com>
905-836-5445 

> On Aug 22, 2017, at 7:39 AM, Liviu Chircu <liviu at opensips.org> wrote:
> 
> Hi Jennifer,
> 
> Thanks for the awesome report! Would you mind testing out this patch [1] to see if it makes Postgres happy?
> 
> [1]: http://chunk.io/liviuc/d64d605a335144709667f4647f4a7369 <http://chunk.io/liviuc/d64d605a335144709667f4647f4a7369>
> Best regards,
> Liviu Chircu
> OpenSIPS Developer
> http://www.opensips-solutions.com <http://www.opensips-solutions.com/>
> On 21.08.2017 23:25, Jennifer Hashimoto wrote:
>> HI everyone,
>> 
>> 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.
>> 
>> I use postgres as the backend.
>> 
>> I am experiencing a problem where many sip messages are not getting inserted into the database due to key violations.
>> 
>> 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)
>> 
>> 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)
>> 
>> I am using opensips.cfg from https://github.com/sipcapture/homer-api/blob/da13a87b8eda55d4c597ce32270521249ab21dc4/examples/sipcapture/sipcapture.opensips <https://github.com/sipcapture/homer-api/blob/da13a87b8eda55d4c597ce32270521249ab21dc4/examples/sipcapture/sipcapture.opensips>
>> 
>> (I put … for the non valid information)
>> 
>> from my opensips log file:
>> 
>> 	 2017-08-21 14:26:15) already exists.#012 Query: insert into sip_capture_rest_20170821 (id,date, ... ) values (0,’2017-08...
>> 
>> my database is defined as:
>> 
>> CREATE TABLE public.sip_capture_call_20170821 (
>> 	id int8 NOT NULL DEFAULT nextval('sip_capture_call_20170821_id_seq'::regclass),
>> 	"date" timestamp NOT NULL DEFAULT now(),
>> 	micro_ts int8 NOT NULL DEFAULT 0::bigint,
>> 	...
>> 	CONSTRAINT sip_capture_call_20170821_pkey PRIMARY KEY (id,"date")
>> )
>> WITH (
>> 	OIDS=FALSE
>> ) ;
>> CREATE INDEX sip_capture_call_20170821_auth_user ON public.sip_capture_call_20170821 (auth_user) ;
>> CREATE INDEX sip_capture_call_20170821_callid ON public.sip_capture_call_20170821 (callid) ;
>> CREATE INDEX sip_capture_call_20170821_callid_aleg ON public.sip_capture_call_20170821 (callid_aleg) ;
>> CREATE INDEX sip_capture_call_20170821_date ON public.sip_capture_call_20170821 (date) ;
>> CREATE INDEX sip_capture_call_20170821_from_user ON public.sip_capture_call_20170821 (from_user) ;
>> CREATE INDEX sip_capture_call_20170821_pid_user ON public.sip_capture_call_20170821 (pid_user) ;
>> CREATE INDEX sip_capture_call_20170821_ruri_user ON public.sip_capture_call_20170821 (ruri_user) ;
>> CREATE INDEX sip_capture_call_20170821_to_user ON public.sip_capture_call_20170821 (to_user) ;
>> 
>> 
>> CREATE SEQUENCE public.sip_capture_call_20170821_id_seq
>> INCREMENT BY 1
>> MINVALUE 1
>> MAXVALUE 9223372036854775807
>> START 1;
>> 
>> 
>> Thanks,
>> Jennifer
>> ---------------------------------------------------
>> Jennifer Akemi Hashimoto
>> Caztel Communications
>> jennifer.hashimoto at caztel.com <mailto:jennifer.hashimoto at caztel.com>
>> 905-836-5445 
>> 
>> 
>> 
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org <mailto:Users at lists.opensips.org>
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users <http://lists.opensips.org/cgi-bin/mailman/listinfo/users>
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20170822/be4f3f05/attachment-0001.html>


More information about the Users mailing list