<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div><div>mysql debug log with same setup.<span><br></span><div><br><div><br><span>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:sipcapture:db_sync_store: storing info...</span></div></div></div><span>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:has_stmt_ctx: ctx found for rtcp_capture<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_do_prepared_query: conn=0x7f610eda28c8 (tail=140054837734000) MC=0x7f610eda2ae8<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_do_prepared_query: set values for the statement run<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_val2bind: added val (0): len=40; type=12; is_null=0<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_val2bind: added val (1): len=8; type=8; is_null=0<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_val2bind: added val (2): len=121; type=254; is_null=0<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_val2bind: added val (3): len=12; type=254; is_null=0<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_val2bind: added val (4): len=4; type=3; is_null=0<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_val2bind: added val (5): len=13; type=254; is_null=0<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_val2bind: added val (6): len=4; type=3; is_null=0<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_val2bind: added val (7): len=4; type=3; is_null=0<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_val2bind: added val (8): len=4; type=3; is_null=0<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_val2bind: added val (9): len=4; type=3; is_null=0<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_val2bind: added val (10): len=9; type=254; is_null=0<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_val2bind: added val (11): len=338; type=252; is_null=0<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:db_mysql_do_prepared_query: doing BIND_PARAM in...<br>Jul 2 20:15:48 voip2-homer /usr/sbin/opensips[19488]: DBG:db_mysql:mysql_raise_event: MySQL status has not changed: connected<br><br></span><br><div><br><br></div></div><div></div>
<div><br></div><div><br></div>
</div><div id="yahoo_quoted_0754357636" class="yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Monday, 2 July 2018, 1:20:31 PM GMT+5:30, Pasan Meemaduma via Users <users@lists.opensips.org> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div id="yiv1890744008"><div><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">Hi Guys,<br><div><br><div>I'm dumping my rtcp data which collect over hep interface of my opensips in to postgres and it doesn't store the json string in the database instead it pushes an encoded string which blows homer api when querying rtcp data. Same setup with mysql DB works perfectly fine, and data is saved as json string. It appears it stores the hep encoded msg into db without decoding. :/ Appreciate if you can look in to this. Let me know if you need any more info<br><div><br><div>OS: debian stretch<br><div>opensips : <span>2.3.3<br></span><span></span><div><br><div><div><div><br><div><span>/etc/opensips/opensips.cfg<br></span><span></span><div><br><div><span>listen=hep_udp:10.3.1.150:9060<br><span>loadmodule "db_postgres.so"<br><span>loadmodule "sipcapture.so"<br>loadmodule "proto_hep.so"<br><br></span><br></span><br></span></div></div></div></div><span>modparam("sipcapture", "db_url", "postgres://sipcapture:Apo31f24vna@127.0.0.1/homer_data")<br>modparam("sipcapture", "capture_on", 1)<br>modparam("sipcapture", "hep_capture_on", 1)<br>modparam("sipcapture", "hep_route", "my_hep_route")<br>modparam("sipcapture", "rtcp_table_name", "rtcp_capture")<br><br></span><div><br><br></div></div><div><br><span>route[my_hep_route] {<br><br> ### hep_get([data type,] chunk_id, vendor_id_pvar, chunk_data_pvar)<br> ### data type is optional for most of the generic chunks<br> ### Full list here: http://www.opensips.org/html/docs/modules/2.2.x/sipcapture#hep_set_id<br><br> #Protocol ID<br> hep_get("11", "$var(vid)", "$var(data)");<br><br> $var(proto) = $(var(data){s.int});<br><br> #xlog("L_INFO", "Dumping $var(data) pkts via HEP");<br> #Logs Or Stats<br> if($var(proto) == 100 || $var(proto) == 99) {<br> #hep_set("uint8", "2", , "1");<br> hep_get("utf8-string", "0x11", "$var(vid)", "$var(correlation_id)");<br> report_capture("logs_capture", "$var(correlation_id)", "1");<br> exit;<br> } else if ( $var(data) == "RTCP") {<br> hep_get("utf8-string", "0x11", "$var(vid)", "$var(correlation_id)");<br> report_capture("rtcp_capture", "$var(correlation_id)", "5");<br> exit;<br> }<br><br><br> if($var(data) == "SIP") {<br> hep_resume_sip();<br> } else {<br> exit;<br> }<br><br>}<br></span><span></span><div><br><div><br><div>debug log<br><div><br><span>Jul 2 17:42:39 voip2-homer /usr/sbin/opensips[17258]: DBG:sipcapture:db_sync_store: storing info...<br>Jul 2 17:42:39 voip2-homer /usr/sbin/opensips[17258]: DBG:db_postgres:db_postgres_val2str: PQescapeStringConn: in: 121 chars, out: 121 chars<br>Jul 2 17:42:39 voip2-homer /usr/sbin/opensips[17258]: DBG:db_postgres:db_postgres_val2str: PQescapeStringConn: in: 12 chars, out: 12 chars<br>Jul 2 17:42:39 voip2-homer /usr/sbin/opensips[17258]: DBG:db_postgres:db_postgres_val2str: PQescapeStringConn: in: 13 chars, out: 13 chars<br>Jul 2 17:42:39 voip2-homer /usr/sbin/opensips[17258]: DBG:db_postgres:db_postgres_val2str: PQescapeStringConn: in: 9 chars, out: 9 chars<br>Jul 2 17:42:39 voip2-homer /usr/sbin/opensips[17258]: DBG:db_postgres:db_postgres_submit_query: 0x7fcc64b62a98 PQsendQuery(insert into rtcp_capture (date,micro_ts,correlation_id,source_ip,source_port,destination_ip,destination_port,proto,family,type,node,msg ) values ('2018-07-02 17:42:39',1530517359466892,'0gQAAC8WAAACBAAALxYAALesqTJJyH2xO7MoiUXzBE8wM7k5guQDJr3dDDdK19yGM3EIud2vT1YL3QYtviLXYUkO7n48a2Qtwkv2C38+rns-@210.87.44.32','210.87.44.32',58871,'10.239.238.68',15997,1,2,5,'homer01:2','\x7b2273737263223a313630353339313435302c2274797065223a3230302c227265706f72745f636f756e74223a312c2273656e6465725f696e666f726d6174696f6e223a7b226e74705f74696d657374616d705f736563223a2232303835393739303632222c226e74705f74696d657374616d705f75736563223a22363334343939222c227274705f74696d657374616d70223a2d36323238383439332c227061636b657473223a31383231362c226f6374657473223a323931343536307d2c227265706f72745f626c6f636b73223a5b7b22736f757263655f73737263223a3937353539343236322c226672616374696f6e5f6c6f7374223a302c227061636b6574735f6c6f7374223a312c22686967686573745f7365715f6e6f223a34373337312c2269615f6a6974746572223a302c226c7372223a2231343431363437323835222c22646c7372223a3130383932307d5d7d'))<br><br></span><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>_______________________________________________<br>Users mailing list<br><a ymailto="mailto:Users@lists.opensips.org" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br><a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br></div>
</div>
</div></div></body></html>