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

Function remove_body_part_f

modules/sipmsgops/sipmsgops.c:956–981  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

954
955
956static int remove_body_part_f(struct sip_msg *msg, void *type, void *revert)
957{
958 struct sip_msg_body * b;
959 struct body_part * p;
960 int deleted = 0;
961
962 if (parse_sip_body(msg)<0 || (b=msg->body)==NULL) {
963 LM_DBG("no body found\n");
964 return -1;
965 }
966
967 p = &b->first;
968 deleted = -1;
969
970 for ( p=&b->first ; p ; p=p->next) {
971
972 if ( (type==NULL) || ( !revert && (p->mime==((int)(long)type)) )
973 || ( revert && (p->mime!=((int)(long)type)) ) ) {
974 delete_body_part( msg, p);
975 deleted = 1;
976 }
977
978 }
979
980 return deleted;
981}
982
983/*
984 * Function to add a new body

Callers

nothing calls this directly

Calls 2

parse_sip_bodyFunction · 0.85
delete_body_partFunction · 0.85

Tested by

no test coverage detected