| 846 | |
| 847 | |
| 848 | int 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; |
nothing calls this directly
no test coverage detected