[reSIProcate] Simple proxy
Byron Campen
bcampen at estacado.net
Wed Nov 29 08:25:23 CST 2006
What revision are you working with? (the line numbers on the logging
statements don't match what's on head, or in the release branch)
Best regards,
Byron Campen
> Greetings.
>
> I try to create simple proxy.
> I created SipStack with UdpTransport and StackThread and own SIPProxy
> which is inherited from TransactionUser and ThreadIf. I registered
> SIPProxy by mStack.registerTransactionUser().
> mFifo gives me SipMessage's ok.
>
> What I don't understand - how to forward the SipMessage to its
> original
> target?
> I tried with this code:
>
> void SIPProxy::thread()
> {
> while (!isShutdown())
> {
> Message* msg=0;
> try
> {
> if ((msg = mFifo.getNext(100)) != 0)
> {
> DebugLog (<< "Got: " << *msg);
> SipMessage* sip = dynamic_cast<SipMessage*>(msg);
> if (sip)
> mStack->send(*sip);
> }
> }
> catch (BaseException& e)
> {
> //WarningLog (<< "Caught: " << e);
> }
> catch (...)
> {
> //WarningLog (<< "Caught unknown exception");
> }
> }
> }
> Yes, I tried to minimize repro code.
>
> Is the mStack->send() right solution?
> As I'm getting the next log :
>
> DEBUG | 20061128-222314.468 | AstaPBX | RESIP | 3872 | sipstack.cxx:
> 283
> | SEND: SipReq: INVITE 600 at 127.0.0.1:5074
> tid=-d87543-9d77205c3511400e-1--d87543- cseq=INVITE
> contact=user at 127.0.0.1:5074 / 1 from(wire)
> DEBUG | 20061128-222314.468 | AstaPBX | RESIP:TRANSACTION | 2996 |
> timerqueue.cxx:85 | Adding timer: Timer B
> tid=-d87543-9d77205c3511400e-1--d87543- ms=32000
> DEBUG | 20061128-222314.515 | AstaPBX | RESIP:TRANSPORT | 2996 |
> transportselector.cxx:312 | Looking up dns entries for
> sip:600 at 127.0.0.1:5074
> DEBUG | 20061128-222314.515 | AstaPBX | RESIP:DNS | 2996 |
> dnsresult.cxx:184 | DnsResult::lookup sip:600 at 127.0.0.1:5074
> DEBUG | 20061128-222314.515 | AstaPBX | RESIP:DNS | 2996 |
> dnsresult.cxx:318 | Numeric result so return immediately: [ V4
> 127.0.0.1:5074 UDP target domain=127.0.0.1 connectionId=0 ]
> DEBUG | 20061128-222314.515 | AstaPBX | RESIP:TRANSACTION | 2996 |
> timerqueue.cxx:85 | Adding timer: Timer A
> tid=-d87543-9d77205c3511400e-1--d87543- ms=500
> DEBUG | 20061128-222314.515 | AstaPBX | RESIP:TRANSPORT | 2996 |
> transportselector.cxx:419 | hint provided by app: SIP/2.0/UDP
> 127.0.0.1:5074;branch=z9hG4bK-d87543-9d77205c3511400e-1--
> d87543-;rport=5074
> DEBUG | 20061128-222314.515 | AstaPBX | RESIP:TRANSPORT | 2996 |
> transportselector.cxx:1111 | findTransportBySource([ V4 127.0.0.1:5074
> UDP target domain=unspecified connectionId=0 ])
> DEBUG | 20061128-222314.515 | AstaPBX | RESIP:TRANSPORT | 2996 |
> transportselector.cxx:1126 | search: [ V4 127.0.0.1:5074 UDP target
> domain=unspecified connectionId=0 ] elem: [ V4 0.0.0.0:5060 UDP target
> domain=unspecified connectionId=0 ]
> DEBUG | 20061128-222314.531 | AstaPBX | RESIP:TRANSPORT | 2996 |
> transportselector.cxx:1229 | Exact interface / Specific port: [[ V4
> 0.0.0.0:5060 UDP target domain=unspecified connectionId=0 ] ->
> 00B78F48]
> DEBUG | 20061128-222314.531 | AstaPBX | RESIP:TRANSPORT | 2996 |
> transportselector.cxx:1230 | Any interface / Specific port: []
> DEBUG | 20061128-222314.531 | AstaPBX | RESIP:TRANSPORT | 2996 |
> transportselector.cxx:1231 | Exact interface / Any port: [[ V4
> 0.0.0.0:5060 UDP target domain=unspecified connectionId=0 ] ->
> 00B78F48]
> DEBUG | 20061128-222314.531 | AstaPBX | RESIP:TRANSPORT | 2996 |
> transportselector.cxx:1232 | Any interface / Any port: []
> WARNING | 20061128-222314.531 | AstaPBX | RESIP:TRANSPORT | 2996 |
> transportselector.cxx:1234 | Can't find matching transport [ V4
> 127.0.0.1:5074 UDP target domain=unspecified connectionId=0 ]
> INFO | 20061128-222314.531 | AstaPBX | RESIP:TRANSPORT | 2996 |
> transportselector.cxx:911 | tid=-d87543-9d77205c3511400e-1--d87543-
> failed to find a transport to [ V4 127.0.0.1:5074 UDP target
> domain=127.0.0.1 connectionId=0 ]
> INFO | 20061128-222314.531 | AstaPBX | RESIP:TRANSACTION | 2996 |
> transactionstate.cxx:1462 | Try sending request to a different dns
> result
> INFO | 20061128-222314.531 | AstaPBX | RESIP:TRANSACTION | 2996 |
> transactionstate.cxx:1421 | Ran out of dns entries for 127.0.0.1.
> Send 503
> DEBUG | 20061128-222314.531 | AstaPBX | RESIP | 2996 | helper.cxx:
> 302 |
> Helper::makeResponse(SipReq: INVITE 600 at 127.0.0.1:5074
> tid=-d87543-9d77205c3511400e-1--d87543- cseq=INVITE
> contact=user at 127.0.0.1:5074 / 1 from(tu) code=503 reason=
> WARNING | 20061128-222314.671 | AstaPBX | RESIP:DNS | 2996 |
> dnsutil.cxx:137 | local hostname does not contain a domain part
>
>
> and 503 packet is here
>
> The incoming packet is INVITE to 127.0.0.1:5074
> and proxy is addressed as 127.0.0.1:5060
>
> Please help!
>
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel at list.resiprocate.org
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
More information about the resiprocate-devel
mailing list