MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / m_dump

Function m_dump

modules/msilo/msilo.c:765–995  ·  view source on GitHub ↗

* dump message */

Source from the content-addressed store, hash-verified

763 * dump message
764 */
765static int m_dump(struct sip_msg* msg, str* owner, int* maxmsg)
766{
767 struct to_body *pto = NULL;
768 db_key_t db_keys[3];
769 db_key_t ob_key;
770 db_op_t db_ops[3];
771 db_val_t db_vals[3];
772 db_key_t db_cols[6];
773 db_res_t* db_res = NULL;
774 int i, db_no_cols = 6, db_no_keys = 3, mid, n;
775 unsigned int sent_cnt = 0;
776 unsigned int maxmsg_i = 0;
777 unsigned int mime;
778 static char hdr_buf[1024];
779 static char body_buf[1024];
780 struct sip_uri puri;
781 char *p;
782
783 str str_vals[4], hdr_str , body_str;
784 time_t rtime;
785
786 /* init */
787 ob_key = &sc_mid;
788
789 db_keys[0]=&sc_uri_user;
790 db_keys[1]=&sc_uri_host;
791 db_keys[2]=&sc_snd_time;
792 db_ops[0]=OP_EQ;
793 db_ops[1]=OP_EQ;
794 db_ops[2]=OP_EQ;
795
796 db_cols[0]=&sc_mid;
797 db_cols[1]=&sc_from;
798 db_cols[2]=&sc_to;
799 db_cols[3]=&sc_body;
800 db_cols[4]=&sc_ctype;
801 db_cols[5]=&sc_inc_time;
802
803 hdr_str.s=hdr_buf;
804 hdr_str.len=1024;
805 body_str.s=body_buf;
806 body_str.len=1024;
807
808 if (maxmsg)
809 maxmsg_i = *(unsigned int *)maxmsg;
810
811 /* get the owner */
812 memset(&puri, 0, sizeof(struct sip_uri));
813 if(owner)
814 {
815 if(parse_uri(owner->s, owner->len, &puri)!=0)
816 {
817 LM_ERR("bad owner SIP address!\n");
818 goto error;
819 } else {
820 LM_DBG("using user id [%.*s]\n", owner->len, owner->s);
821 }
822 } else { /* get it from To URI */

Callers

nothing calls this directly

Calls 7

parse_uriFunction · 0.85
check_message_supportFunction · 0.85
msg_list_check_msgFunction · 0.85
m_build_headersFunction · 0.85
msg_list_set_flagFunction · 0.85
decode_mime_typeFunction · 0.85
m_build_bodyFunction · 0.85

Tested by

no test coverage detected