[OpenSIPS-Users] how to forward SIP messages?
Hi. I'd like to use openSIPS proxy (10.0.4.34) for tracing but leave all SIP-handling to a PBX that is on the same network (10.0.2.16) I tried just forwarding the sip-messages on the proxy using forward(10.0.2.16:5060 http://10.0.2.16:5060/ ); but the UAC receives a Moved permanently How can this be achieved? thx Chris ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] how to forward SIP messages?
Hi, You can use this, basically taken from the default OpenSIPS script - at the end of the route check the rewritehostport : ### Routing Logic # main request routing logic route{ if (!mf_process_maxfwd_header(10)) { sl_send_reply(483,Too Many Hops); exit; } if (has_totag()) { # sequential request withing a dialog should # take the path determined by record-routing if (loose_route()) { if (is_method(INVITE)) { # even if in most of the cases is useless, do RR for # re-INVITEs alos, as some buggy clients do change route set # during the dialog. record_route(); } # route it out to whatever destination was set by loose_route() # in $du (destination URI). t_relay(); exit; } else { if ( is_method(ACK) ) { if ( t_check_trans() ) { # non loose-route, but stateful ACK; must be an ACK after # a 487 or e.g. 404 from upstream server t_relay(); exit; } else { # ACK without matching transaction - # ignore and discard exit; } } sl_send_reply(404,Not here); } exit; } # CANCEL processing if (is_method(CANCEL)) { if (t_check_trans()) t_relay(); exit; } t_check_trans(); if (!is_method(INVITE)) { sl_send_reply(500,Method not allowed); exit; } record_route(); rewritehostport(10.0.2.16:5060); t_relay(); exit; } On 11/22/2012 06:04 PM, Christian Cambier wrote: Hi. I'd like to use openSIPS proxy (10.0.4.34) for tracing but leave all SIP-handling to a PBX that is on the same network (10.0.2.16) I tried just forwarding the sip-messages on the proxy using forward(10.0.2.16:5060 http://10.0.2.16:5060/); but the UAC receives a Moved permanently How can this be achieved? thx Chris ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
[OpenSIPS-Users] how to forward SIP messages?
Hello. Direct registration (not passing via the proxy) with extension: 5006@10.0.2.16 works (see SIP trace 1) Registration with the same extension but via the proxy doesn't work (see SIP trace 2) I've added in the proxy as you suggested: record_route(); rewritehostport(10.0.2.16:5060); t_relay(); exit; Interesting to note though is that the message has been forwarded to the PBX (see Server-header in the response) but the PBX didn't accept the registration == SIP trace 1 (OK) REGISTER sip:10.0.2.16:5060 SIP/2.0 Via: SIP/2.0/UDP 10.0.46.1:5082;rport;branch=z9hG4bKPj28b4d6575de442a5afb372fe9ddc47a9 Max-Forwards: 70 From: cid5006 sip:5006@10.0.2.16;tag=43098562225648238bd899bc85994e05 To: cid5006 sip:5006@10.0.2.16 Call-ID: 78017ce971b646e7a6f41bd60601fd9c CSeq: 38561 REGISTER User-Agent: VoxtronSipPhone_01.00.010.000 Contact: cid5006 sip:5006@10.0.46.1:5082;ob Expires: 300 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Content-Length: 0 SIP/2.0 200 OK Via: SIP/2.0/UDP 10.0.46.1:5082;rport;branch=z9hG4bKPj7621a9f9aa544be7b50abc499f68b004 From: cid5006 sip:5006@10.0.2.16;tag=43098562225648238bd899bc85994e05 To: cid5006 sip:5006@10.0.2.16;tag=3609800608 Call-ID: 78017ce971b646e7a6f41bd60601fd9c CSeq: 38562 REGISTER Contact: sip:5006@10.0.46.1:5082;ob;expires=120 Allow: REGISTER,SUBSCRIBE,NOTIFY,INVITE,ACK,PRACK,OPTIONS,BYE,CANCEL,REFER,INFO ,UPDATE,PUBLISH Content-Length: 0 Date: Thu, 22 Nov 2012 19:55:46 GMT Expires: 120 Server: (innovaphone IP6000/8.00 hotfix25 [80500.65/8050065/107]) Allow-Events: reg,dialog,message-summary,presence Presence-State: register-action=added P-Alias: 0,4,5006 P-Alias: 2,6,id5006 == SIP trace 2 (Not OK) REGISTER sip:10.0.2.16:5060 SIP/2.0 Via: SIP/2.0/TCP 10.0.46.1:49370;rport;branch=z9hG4bKPjd606484bdde5459a96175285593932df Route: sip:sip.cca.com:5060;transport=TCP;lr Max-Forwards: 70 From: cid5006 sip:5006@10.0.2.16;tag=9bf43fc5cfb04bce8f6f42150223c301 To: cid5006 sip:5006@10.0.2.16 Call-ID: c6752588892f4ba499ddba6d5d9bc90e CSeq: 26467 REGISTER User-Agent: VoxtronSipPhone_01.00.010.000 Supported: outbound, path Contact: cid5006 sip:5006@10.0.46.1:5082;transport=TCP;ob;reg-id=1;+sip.instance=urn: uuid:----64bc79c6 Expires: 300 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Content-Length: 0 SIP/2.0 301 Moved Permanently Via: SIP/2.0/TCP 10.0.46.1:49370;received=10.0.46.1;rport=49370;branch=z9hG4bKPjd606484bd de5459a96175285593932df From: cid5006 sip:5006@10.0.2.16;tag=9bf43fc5cfb04bce8f6f42150223c301 To: cid5006 sip:5006@10.0.2.16;tag=3609800590 Call-ID: c6752588892f4ba499ddba6d5d9bc90e CSeq: 26467 REGISTER Contact: sip:10.0.2.16:5060;transport=UDP Content-Length: 0 Server: (innovaphone IP6000/8.00 hotfix25 [80500.65/8050065/107]) How to solve this? thx Chris ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] how to forward SIP messages?
It means you are still doing forwarding. Find forward method and comment it. :-) Thank you. On Thu, Nov 22, 2012 at 8:07 PM, Christian Cambier c...@voxtron.com wrote: Hello. Direct registration (not passing via the proxy) with extension: 5006@10.0.2.16 works (see SIP trace 1) Registration with the same extension but via the proxy doesn't work (see SIP trace 2) I've added in the proxy as you suggested: record_route(); rewritehostport(10.0.2.16:5060); t_relay(); exit; Interesting to note though is that the message has been forwarded to the PBX (see Server-header in the response) but the PBX didn't accept the registration == SIP trace 1 (OK) ** ** REGISTER sip:10.0.2.16:5060 SIP/2.0 Via: SIP/2.0/UDP 10.0.46.1:5082;rport;branch=z9hG4bKPj28b4d6575de442a5afb372fe9ddc47a9 Max-Forwards: 70 From: cid5006 sip:5006@10.0.2.16;tag=43098562225648238bd899bc85994e05 To: cid5006 sip:5006@10.0.2.16 Call-ID: 78017ce971b646e7a6f41bd60601fd9c CSeq: 38561 REGISTER User-Agent: VoxtronSipPhone_01.00.010.000 Contact: cid5006 sip:5006@10.0.46.1:5082;ob Expires: 300 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Content-Length: 0 ** ** SIP/2.0 200 OK Via: SIP/2.0/UDP 10.0.46.1:5082;rport;branch=z9hG4bKPj7621a9f9aa544be7b50abc499f68b004 From: cid5006 sip:5006@10.0.2.16;tag=43098562225648238bd899bc85994e05 To: cid5006 sip:5006@10.0.2.16;tag=3609800608 Call-ID: 78017ce971b646e7a6f41bd60601fd9c CSeq: 38562 REGISTER Contact: sip:5006@10.0.46.1:5082;ob;expires=120 Allow: REGISTER,SUBSCRIBE,NOTIFY,INVITE,ACK,PRACK,OPTIONS,BYE,CANCEL,REFER,INFO,UPDATE,PUBLISH Content-Length: 0 Date: Thu, 22 Nov 2012 19:55:46 GMT Expires: 120 Server: (innovaphone IP6000/8.00 hotfix25 [80500.65/8050065/107]) Allow-Events: reg,dialog,message-summary,presence Presence-State: register-action=added P-Alias: 0,4,5006 P-Alias: 2,6,id5006 ** ** == SIP trace 2 (Not OK) REGISTER sip:10.0.2.16:5060 SIP/2.0 Via: SIP/2.0/TCP 10.0.46.1:49370;rport;branch=z9hG4bKPjd606484bdde5459a96175285593932df Route: sip:sip.cca.com:5060;transport=TCP;lr Max-Forwards: 70 From: cid5006 sip:5006@10.0.2.16;tag=9bf43fc5cfb04bce8f6f42150223c301 To: cid5006 sip:5006@10.0.2.16 Call-ID: c6752588892f4ba499ddba6d5d9bc90e CSeq: 26467 REGISTER User-Agent: VoxtronSipPhone_01.00.010.000 Supported: outbound, path Contact: cid5006 sip:5006@10.0.46.1:5082;transport=TCP;ob;reg-id=1;+sip.instance=urn:uuid:----64bc79c6 Expires: 300 Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Content-Length: 0 ** ** SIP/2.0 301 Moved Permanently Via: SIP/2.0/TCP 10.0.46.1:49370;received=10.0.46.1;rport=49370;branch=z9hG4bKPjd606484bdde5459a96175285593932df From: cid5006 sip:5006@10.0.2.16;tag=9bf43fc5cfb04bce8f6f42150223c301 To: cid5006 sip:5006@10.0.2.16;tag=3609800590 Call-ID: c6752588892f4ba499ddba6d5d9bc90e CSeq: 26467 REGISTER Contact: sip:10.0.2.16:5060;transport=UDP Content-Length: 0 Server: (innovaphone IP6000/8.00 hotfix25 [80500.65/8050065/107]) How to solve this? thx Chris ** ** ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users