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

Function new_t

modules/tm/t_lookup.c:987–1016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

985}
986
987static inline int new_t(struct sip_msg *p_msg, int full_uas)
988{
989 struct cell *new_cell;
990
991 /* for ACK-dlw-wise matching, we want From-tags */
992 if (p_msg->REQ_METHOD==METHOD_INVITE && parse_from_header(p_msg)<0) {
993 LM_ERR("no valid From in INVITE\n");
994 return E_BAD_REQ;
995 }
996 /* make sure uri will be parsed before cloning */
997 if (parse_sip_msg_uri(p_msg)<0) {
998 LM_ERR("uri invalid\n");
999 return E_BAD_REQ;
1000 }
1001
1002 /* add new transaction */
1003 new_cell = build_cell( p_msg , full_uas) ;
1004 if ( !new_cell ){
1005 LM_ERR("out of mem\n");
1006 return E_OUT_OF_MEM;
1007 }
1008
1009 insert_into_hash_table_unsafe( new_cell, p_msg->hash_index );
1010 INIT_REF_UNSAFE(T);
1011 /* init pointers to headers needed to construct local
1012 requests such as CANCEL/ACK
1013 */
1014 init_new_t(new_cell, p_msg);
1015 return 1;
1016}
1017
1018
1019/* atomic "new_tran" construct; it returns:

Callers 1

t_newtranFunction · 0.85

Calls 5

parse_from_headerFunction · 0.85
parse_sip_msg_uriFunction · 0.85
build_cellFunction · 0.85
init_new_tFunction · 0.85

Tested by

no test coverage detected