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

Function b2b_prescript_f

modules/b2b_entities/dlg.c:848–1619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

846
847
848int b2b_prescript_f(struct sip_msg *msg, void *uparam)
849{
850 str b2b_key;
851 b2b_dlg_t* dlg = 0, *aux_dlg;
852 unsigned int hash_index, local_index;
853 b2b_notify_t b2b_cback;
854 str logic_key= {NULL,0};
855 b2b_table table = NULL;
856 int method_value;
857 str from_tag;
858 str to_tag;
859 str callid;
860 struct cell* tm_tran;
861 int ret;
862 str host;
863 int port;
864 int etype= B2B_NONE;
865 int dlg_state = 0;
866 struct sip_uri puri;
867 struct hdr_field *route_hdr;
868 rr_t *rt;
869 int b2b_ev = -1;
870 bin_packet_t storage;
871 struct b2b_context *ctx;
872 int b2b_cb_flags = 0;
873 unsigned int ua_flags = 0;
874 int ua_ev_type = -1;
875 dlg_leg_t *leg = NULL;
876 int leg_idx = -1;
877
878 storage.buffer.s = NULL;
879
880 profiling_proc_enter( LEVEL_SIP, "B2BE_request_prescript", 0 );
881
882 /* check if a b2b request */
883 if (parse_headers(msg, HDR_EOH_F, 0) < 0)
884 {
885 LM_ERR("failed to parse message\n");
886 goto scb_run_all;
887 }
888 LM_DBG("start - method = %.*s\n", msg->first_line.u.request.method.len,
889 msg->first_line.u.request.method.s);
890
891 if(msg->route)
892 {
893 LM_DBG("Found route headers\n");
894 route_hdr = msg->route;
895 /* we accept Route hdrs only if preloaded route with out IPs */
896 if (parse_rr(route_hdr) < 0) {
897 LM_ERR("failed to parse Route HF\n");
898 goto scb_run_all;
899 }
900 rt = (rr_t*)route_hdr->parsed;
901 /* check if first route is local*/
902 if ( parse_uri(rt->nameaddr.uri.s,rt->nameaddr.uri.len,&puri)!=0 ) {
903 LM_ERR("Route uri is not valid <%.*s>\n",
904 rt->nameaddr.uri.len,rt->nameaddr.uri.s);
905 goto scb_run_all;

Callers

nothing calls this directly

Calls 15

parse_rrFunction · 0.85
parse_uriFunction · 0.85
parse_sip_msg_uriFunction · 0.85
parse_from_headerFunction · 0.85
core_hashFunction · 0.85
b2bl_search_iterativelyFunction · 0.85
b2b_get_contextFunction · 0.85
pkg_str_dupFunction · 0.85
b2b_parse_keyFunction · 0.85
b2b_search_htable_dlgFunction · 0.85
run_top_routeFunction · 0.85

Tested by

no test coverage detected