<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></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>
        <div>Hi Guys,<br></div><div>Would you please confirm this change ?<br></div>
        
        </div><div id="yahoo_quoted_0797404743" class="yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Tuesday, 3 July 2018, 10:29:05 AM GMT+5:30, Pasan Meemaduma via Users <users@lists.opensips.org> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="yiv2818401123"><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;"><div>We were able to fix this with following change. Let me know if you need a pull request if you are happy with that change.<br clear="none"><div><br clear="none"><span>--- opensips-2.3.4.orig/modules/sipcapture/sipcapture.c<br clear="none">+++ opensips-2.3.4/modules/sipcapture/sipcapture.c<br clear="none">@@ -5070,7 +5070,7 @@ static int report_capture(struct sip_msg<br clear="none">         db_vals[10].val.str_val = capture_node;<br clear="none">     }<br clear="none"> <br clear="none">-    db_vals[11].type = DB_BLOB;<br clear="none">+    db_vals[11].type = DB_STR;<br clear="none"> <br clear="none"> <br clear="none">     /* we can have other pyload than sip only for hepv3 */<br clear="none"><br clear="none"></span><br clear="none"></div></div><div></div>
        <div><br clear="none"></div><div><br clear="none"></div>
        
        </div><div class="yiv2818401123yahoo_quoted" id="yiv2818401123yahoo_quoted_0673319726">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div class="yiv2818401123yqt5230104781" id="yiv2818401123yqt82121"><div>
                    On Tuesday, 3 July 2018, 8:16:50 AM GMT+5:30, Pasan Meemaduma via Users <users@lists.opensips.org> wrote:
                </div>
                <div><br clear="none"></div>
                <div><br clear="none"></div>
                <div><div id="yiv2818401123"><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;">I figured its json data encoded in hex, so it appears DB_BLOB in <a rel="nofollow" shape="rect" class="yiv2818401123enhancr_card_1433811969" target="_blank" href="https://github.com/OpenSIPS/opensips/blob/master/modules/sipcapture/sipcapture.c#L5074">OpenSIPS/opensips</a><div></div>
        <div><br clear="none"></div><div><br clear="none"></div>
        
        </div><div><br clear="none"></div><div class="yiv2818401123ydpa8dc3380yahoo-link-enhancr-card yiv2818401123ydpa8dc3380ymail-preserve-class yiv2818401123ydpa8dc3380ymail-preserve-style" id="yiv2818401123ydpa8dc3380enhancr_card_1433811969" style="max-width:400px;" data-url="https://github.com/OpenSIPS/opensips/blob/master/modules/sipcapture/sipcapture.c#L5074" data-type="YENHANCER" data-size="MEDIUM"><a rel="nofollow" shape="rect" class="yiv2818401123ydpa8dc3380yahoo-enhancr-cardlink" target="_blank" href="https://github.com/OpenSIPS/opensips/blob/master/modules/sipcapture/sipcapture.c#L5074" style="text-decoration:none;color:#000;"><table class="yiv2818401123ydpa8dc3380card-wrapper yiv2818401123ydpa8dc3380yahoo-ignore-table" style="max-width:400px;" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" width="400"><table class="yiv2818401123ydpa8dc3380card yiv2818401123ydpa8dc3380yahoo-ignore-table" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px;" cellspacing="0" cellpadding="0" width="100%" border="0"><tbody><tr><td colspan="1" rowspan="1" class="yiv2818401123ydpa8dc3380card-primary-image-cell" style="background-color:rgb(0, 0, 0);background-repeat:no-repeat;background-size:cover;position:relative;border-radius:2px 2px 0px 0px;min-height:175px;" valign="top" bgcolor="#000000" background="https://s.yimg.com/lo/api/res/1.2/HCshfSVdcCEPGGOEhWqjJA--~A/Zmk9ZmlsbDt3PTQwMDtoPTIwMDthcHBpZD1pZXh0cmFjdA--/https://avatars3.githubusercontent.com/u/3853758?s=400&v=4.cf.jpg" height="175"><table class="yiv2818401123ydpa8dc3380card-overlay-container-table yiv2818401123ydpa8dc3380yahoo-ignore-table" style="width:100%;" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" class="yiv2818401123ydpa8dc3380card-overlay-cell" style="background-color:transparent;border-radius:2px 2px 0px 0px;min-height:175px;" valign="top" bgcolor="transparent" background="https://s.yimg.com/cv/ae/nq/storm/assets/enhancrV21/1/enhancr_gradient-400x175.png"><table class="yiv2818401123ydpa8dc3380yahoo-ignore-table" style="width:100%;min-height:175px;" border="0" height="175"><tbody><tr><td colspan="1" rowspan="1" class="yiv2818401123ydpa8dc3380card-richInfo2" style="text-align:left;padding:15px 0 0 15px;vertical-align:top;"></td><td colspan="1" rowspan="1" class="yiv2818401123ydpa8dc3380card-actions" style="text-align:right;padding:15px 15px 0 0;vertical-align:top;"><div class="yiv2818401123ydpa8dc3380card-share-container"></div></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td colspan="1" rowspan="1"><table class="yiv2818401123ydpa8dc3380card-info yiv2818401123ydpa8dc3380yahoo-ignore-table" style="background-color:rgb(255, 255, 255);background-image:none;background-repeat:repeat;background-attachment:scroll;background-size:auto auto;position:relative;z-index:2;width:100%;max-width:400px;border-radius:0px 0px 2px 2px;border-top:1px solid rgb(224, 228, 233);" cellspacing="0" cellpadding="0" align="center" border="0"><tbody><tr><td colspan="1" rowspan="1" style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px;"><img class="yiv2818401123ydpa8dc3380card-object-1 yiv2818401123ydpa8dc3380yahoo-ignore-inline-image yiv2818401123ydpa8dc3380ymail-preserve-class" src="https://s.yimg.com/nq/storm/assets/enhancrV2/23/logos/github.png" style="min-width:36px;margin-top:3px;" height="36"></td><td colspan="1" rowspan="1" style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;"><h2 class="yiv2818401123ydpa8dc3380card-title" style="font-size:14px;line-height:19px;margin:0 0 6px 0;">OpenSIPS/opensips</h2><p class="yiv2818401123ydpa8dc3380card-description" style="font-size:12px;line-height:16px;margin:0px;color:#979ba7;">opensips - OpenSIPS is a GPL implementation of a multi-functionality SIP Server that targets to deliver a high-l...</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a></div><div><br clear="none"></div><div><br clear="none"></div><div class="yiv2818401123yahoo_quoted" id="yiv2818401123yahoo_quoted_0673043864">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div class="yiv2818401123yqt6018533036" id="yiv2818401123yqt66167"><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 clear="none"></div>
                <div><br clear="none"></div>
                <div><div id="yiv2818401123"><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 clear="none"><div><br clear="none"><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 clear="none"><div><br clear="none"><div>OS: debian stretch<br clear="none"><div>opensips : <span>2.3.3<br clear="none"></span><span></span><div><br clear="none"><div><div><div><br clear="none"><div><span>/etc/opensips/opensips.cfg<br clear="none"></span><span></span><div><br clear="none"><div><span>listen=hep_udp:10.3.1.150:9060<br clear="none"><span>loadmodule "db_postgres.so"<br clear="none"><span>loadmodule "sipcapture.so"<br clear="none">loadmodule "proto_hep.so"<br clear="none"><br clear="none"></span><br clear="none"></span><br clear="none"></span></div></div></div></div><span>modparam("sipcapture", "db_url", "postgres://sipcapture:Apo31f24vna@127.0.0.1/homer_data")<br clear="none">modparam("sipcapture", "capture_on", 1)<br clear="none">modparam("sipcapture", "hep_capture_on", 1)<br clear="none">modparam("sipcapture", "hep_route", "my_hep_route")<br clear="none">modparam("sipcapture", "rtcp_table_name", "rtcp_capture")<br clear="none"><br clear="none"></span><div><br clear="none"><br clear="none"></div></div><div><br clear="none"><span>route[my_hep_route] {<br clear="none"><br clear="none">        ### hep_get([data type,] chunk_id, vendor_id_pvar, chunk_data_pvar)<br clear="none">        ### data type is optional for most of the generic chunks<br clear="none">        ### Full list here: http://www.opensips.org/html/docs/modules/2.2.x/sipcapture#hep_set_id<br clear="none"><br clear="none">        #Protocol ID<br clear="none">        hep_get("11", "$var(vid)", "$var(data)");<br clear="none"><br clear="none">        $var(proto) = $(var(data){s.int});<br clear="none"><br clear="none">        #xlog("L_INFO", "Dumping $var(data) pkts via HEP");<br clear="none">        #Logs Or Stats<br clear="none">        if($var(proto) == 100 || $var(proto) == 99) {<br clear="none">                #hep_set("uint8", "2", , "1");<br clear="none">                hep_get("utf8-string", "0x11", "$var(vid)", "$var(correlation_id)");<br clear="none">                report_capture("logs_capture", "$var(correlation_id)", "1");<br clear="none">                exit;<br clear="none">        } else if ( $var(data) == "RTCP") {<br clear="none">                hep_get("utf8-string", "0x11", "$var(vid)", "$var(correlation_id)");<br clear="none">                report_capture("rtcp_capture", "$var(correlation_id)", "5");<br clear="none">                exit;<br clear="none">        }<br clear="none"><br clear="none"><br clear="none">        if($var(data) == "SIP") {<br clear="none">                hep_resume_sip();<br clear="none">        } else {<br clear="none">                exit;<br clear="none">        }<br clear="none"><br clear="none">}<br clear="none"></span><span></span><div><br clear="none"><div><br clear="none"><div>debug log<br clear="none"><div><br clear="none"><span>Jul  2 17:42:39 voip2-homer /usr/sbin/opensips[17258]: DBG:sipcapture:db_sync_store: storing info...<br clear="none">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 clear="none">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 clear="none">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 clear="none">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 clear="none">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 clear="none"><br clear="none"></span><br clear="none"></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>_______________________________________________<br clear="none">Users mailing list<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:Users@lists.opensips.org" target="_blank" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br clear="none"></div></div>
            </div>
        </div></div></div></div><div class="yiv2818401123yqt6018533036" id="yiv2818401123yqt05384">_______________________________________________<br clear="none">Users mailing list<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:Users@lists.opensips.org" target="_blank" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br clear="none"></div></div></div>
            </div>
        </div></div></div></div><div class="yqt5230104781" id="yqt71046">_______________________________________________<br clear="none">Users mailing list<br clear="none"><a shape="rect" ymailto="mailto:Users@lists.opensips.org" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br clear="none"><a shape="rect" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br clear="none"></div></div>
            </div>
        </div></div></body></html>