Discussion:
[SR-Users] how to m_store to database not just a "body" with MSILO?
Daniel-Constantin Mierla
2014-07-18 07:27:25 UTC
Permalink
Hello,

perhaps the module needs to be refactored to store the full body for
content-type. Not it doesn't store the parameters in that header.

I will look over it soon if nobody else does it. Maybe you should open
an issue on tracker so we don't forget about it:

- http://sip-router.org/tracker/

Cheers,
Daniel
Hello All,
Subj, need you help,
How to store this type of message to MSILO database?
message/external-body;access-type=URL;URL="Loading Image..."
ERROR: msilo [msilo.c:626]: m_store(): body of the message is empty!
mysql> select * from silo;
+----+-------------------------+-------------------------+-----------+-----------+------------+------------+----------+-----------------------+------+------------+--------+--------+
| id | src_addr | dst_addr | username | domain | inc_time | exp_time |
snd_time | ctype | body | extra_hdrs | callid | status |
+----+-------------------------+-------------------------+-----------+-----------+------------+------------+----------+-----------------------+------+------------+--------+--------+
xxx.in | 1402479947 | 1403479946 | 0 | message/external-body | | | | 0 |
+----+-------------------------+-------------------------+-----------+-----------+------------+------------+----------+-----------------------+------+------------+--------+--------+
1 row in set (0.00 sec)
How can I store to database "access-type=URL" and and URL="xxxx" ?
Thanks All!
--
denis kremov
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Carsten Bock
2014-07-18 07:44:17 UTC
Permalink
Hi,

actually, you can replace the m_store() and m_dump() with some
scripting. This gives you quite some flexibility on message
storage/message retrieval.
I didn't test this too much so far, the basic tests i did with Bria were fine:

m_store
-------------------------------------------------
// xlog("insert into silo (src_addr, dst_addr, username, inc_time,
ctype, body) values ('$fu', '$tu', '$tU', unix_timestamp(), '$cT',
'$rb');\n");
if (sql_query("msilo", "insert into silo (src_addr, dst_addr,
username, inc_time, ctype, body) values ('$fu', '$tu', '$tU',
unix_timestamp(), '$cT', '$rb');")) {
t_reply("202", "Accepted");
} else {
t_reply("503", "Service Unavailable");
}

m_dump
-------------------------------------------------
if (is_method("REGISTER") && is_present_hf("Expires") &&
$(hdr(Expires){s.int})==0) {
xlog("This is an un-registration\n");
return;
} else {
xlog("Dumping offline messages...\n");
async_sleep("3");
// xlog("select src_addr, dst_addr, inc_time, ctype, body from silo
where username='$fU';");
sql_query("msilo", "select src_addr, dst_addr, inc_time, ctype, body
from silo where username='$fU' order by inc_time asc;", "msgs");
// xlog("rows: $dbr(msgs=>rows) cols: $dbr(msgs=>cols)\n");
if($dbr(msgs=>rows)>0) {
$var(i) = 0;
while ($var(i)<$dbr(msgs=>rows)) {
$uac_req(method) = "MESSAGE";
$uac_req(ruri) = $(ct{tobody.uri});
$uac_req(furi) = $dbr(msgs=>[$var(i),0]);
$uac_req(turi) = $dbr(msgs=>[$var(i),1]);
$uac_req(ouri) = "sip:"+$si+":"+$sp;
$uac_req(hdrs) = "Content-Type: "+$dbr(msgs=>[$var(i),3])+"\r\n";
$uac_req(body) = $dbr(msgs=>[$var(i),4]);
uac_req_send();
$var(i) = $var(i) + 1;
}
}
sql_result_free("msgs");
sql_query("msilo", "delete from silo where username='$fU';");
}

Greetings from Singapore,
Carsten
Post by Daniel-Constantin Mierla
Hello,
perhaps the module needs to be refactored to store the full body for
content-type. Not it doesn't store the parameters in that header.
I will look over it soon if nobody else does it. Maybe you should open an
- http://sip-router.org/tracker/
Cheers,
Daniel
Hello All,
Subj, need you help,
How to store this type of message to MSILO database?
message/external-body;access-type=URL;URL="https://xxx.com//download/539c28884_3e071c9db68044f687bf.jpg"
ERROR: msilo [msilo.c:626]: m_store(): body of the message is empty!
mysql> select * from silo;
+----+-------------------------+-------------------------+-----------+-----------+------------+------------+----------+-----------------------+------+------------+--------+--------+
| id | src_addr | dst_addr | username | domain | inc_time | exp_time |
snd_time | ctype | body | extra_hdrs | callid | status |
+----+-------------------------+-------------------------+-----------+-----------+------------+------------+----------+-----------------------+------+------------+--------+--------+
1402479947 | 1403479946 | 0 | message/external-body | | | | 0 |
+----+-------------------------+-------------------------+-----------+-----------+------------+------------+----------+-----------------------+------+------------+--------+--------+
1 row in set (0.00 sec)
How can I store to database "access-type=URL" and and URL="xxxx" ?
Thanks All!
--
denis kremov
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Carsten Bock
CEO (Geschäftsführer)

ng-voice GmbH
Schomburgstr. 80
D-22767 Hamburg / Germany

http://www.ng-voice.com
mailto:***@ng-voice.com

Office +49 40 34927219
Fax +49 40 34927220

Sitz der Gesellschaft: Hamburg
Registergericht: Amtsgericht Hamburg, HRB 120189
Geschäftsführer: Carsten Bock
Ust-ID: DE279344284

Hier finden Sie unsere handelsrechtlichen Pflichtangaben:
http://www.ng-voice.com/imprint/
Loading...