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

Function fixup_phostport2proxy

modules/tm/tm.c:628–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

626
627
628static int fixup_phostport2proxy(void** param)
629{
630 struct proxy_l *proxy;
631 str s = *(str*)*param;
632 int port;
633 int proto;
634 str host;
635
636 if (s.s == NULL || s.len == 0) {
637 LM_CRIT("empty parameter\n");
638 return E_UNSPEC;
639 }
640
641 if (parse_phostport(s.s, s.len, &host.s, &host.len, &port, &proto)!=0){
642 LM_CRIT("invalid parameter <%.*s>\n",s.len, s.s);
643 return E_UNSPEC;
644 }
645
646 proxy = mk_proxy( &host, port, proto, 0);
647 if (proxy==0) {
648 LM_ERR("failed to resolve <%.*s>\n", host.len, host.s );
649 return ser_error;
650 }
651 *(param)=proxy;
652 return 0;
653}
654
655static int fixup_free_proxy(void **param)
656{

Callers

nothing calls this directly

Calls 2

parse_phostportFunction · 0.85
mk_proxyFunction · 0.85

Tested by

no test coverage detected