Re: [OpenSIPS-Users] Opensips as outbound proxy for asterisk client
Hi Nauman, when sending the REGISTER to sipgate, in script, set a failure route - you need to catch the 401 coming from sipgate and to answer to the authentication answer using the UAC module (http://www.opensips.org/html/docs/modules/1.6.x/uac.html). See the uac_auth() function: http://www.opensips.org/html/docs/modules/1.6.x/uac.html#id270866 Regards, Bogdan Nauman Sulaiman wrote: Hi, making progress we now have this so the REGISTER is passed to the Sipgate proxy transparently it could be any proxy server so if (is_method(REGISTER)) { ##$du = sip:sipgate.co.uk:5060; t_relay(); exit(); } We can see via Wireshark trace that REGISTER is reaching the sipgate proxy but OpenSIPS is returning a 403 to our Asterisk (acting as the SIP client) its because of this code, so then upon receiving the 403 from Opensips it doesn't respond to the 401 from the sipgate proxy. What should we be doing below if (!is_uri_host_local()) { if(is_from_local()) { route(1); } else { sl_send_reply(403,Not here); } ##append_hf(P-hint: outbound\r\n); # if you have some interdomain connections via TLS ##if($rd==tls_domain1.net) { ## t_relay(tls:domain1.net); ## exit; ##} else if($rd==tls_domain2.net) { ## t_relay(tls:domain2.net); ## exit; ##} ##route(1); } Thanks --- On *Sat, 24/7/10, Nauman Sulaiman /nauman762-h...@yahoo.co.uk/* wrote: From: Nauman Sulaiman nauman762-h...@yahoo.co.uk Subject: Re: [OpenSIPS-Users] Opensips as outbound proxy for asterisk client To: OpenSIPS users mailling list users@lists.opensips.org, Laszlo las...@voipfreak.net Date: Saturday, 24 July, 2010, 19:48 Hi, many thanks we don't follow this line $du = sip:sipgate_ip_goes_here:port where do we get the sipgate ip, should this just be $du = sip:sipgate.co.uk:5060 at least it explains why we saw the REGISTER being gobbled --- On *Sat, 24/7/10, Laszlo /las...@voipfreak.net/* wrote: From: Laszlo las...@voipfreak.net Subject: Re: [OpenSIPS-Users] Opensips as outbound proxy for asterisk client To: nauman762-h...@yahoo.co.uk, OpenSIPS users mailling list users@lists.opensips.org Date: Saturday, 24 July, 2010, 19:28 You can relay the register to sipgate, so when auth is done, then you can forward it. consume_credentials(); $du = sip:sipgate_ip_goes_here:port; t_relay(); exit; so instead of doing if (!save(location)) etc -Laszlo 2010/7/24 Nauman Sulaiman nauman762-h...@yahoo.co.uk Hi, We have Asterisk 1.6.2.9 and Opensips 1.6.2 in the same Linux box and we want to have OpenSIPS as the out/inbound proxy for Asterisk when running as UAC. We have Asterisk registered with Sipgate ok when sending REGISTER directly to the Sipgate domain but would like to send the Register via OpenSIPS so it's in the path for incoming invites Opensips.cfg as follows listen=udp:192.168.0.20:5060 http://192.168.0.20:5060 register code: we have removed the authentication for now to get this working first if (is_method(REGISTER)) { if (!db_check_to()) { sl_send_reply(403,Forbidden auth ID); exit; } if (!save(location)) sl_reply_error(); exit; } we have astersik sip.conf file as follows [general] port=5062 bindaddr=0.0.0.0 context=default outboundproxy=192.168.0.20 outboundproxyport=5060 register = username:sec...@sipgate.co.uk/username http://username:sec...@sipgate.co.uk/username [username] type=friend context=incoming username=username secret=secret host=sipgate.co.uk http://sipgate.co.uk host=dynamic fromdomain=sipgate.co.uk http://sipgate.co.uk insecure=port,invite nat=yes disallow=all allow=alaw canreinvite=no However the REGISTER messages are sent by Astersik but ther is no response fron OpenSIPS
Re: [OpenSIPS-Users] Opensips as outbound proxy for asterisk client
You can relay the register to sipgate, so when auth is done, then you can forward it. consume_credentials(); $du = sip:sipgate_ip_goes_here:port; t_relay(); exit; so instead of doing if (!save(location)) etc -Laszlo 2010/7/24 Nauman Sulaiman nauman762-h...@yahoo.co.uk Hi, We have Asterisk 1.6.2.9 and Opensips 1.6.2 in the same Linux box and we want to have OpenSIPS as the out/inbound proxy for Asterisk when running as UAC. We have Asterisk registered with Sipgate ok when sending REGISTER directly to the Sipgate domain but would like to send the Register via OpenSIPS so it's in the path for incoming invites Opensips.cfg as follows listen=udp:192.168.0.20:5060 register code: we have removed the authentication for now to get this working first if (is_method(REGISTER)) { if (!db_check_to()) { sl_send_reply(403,Forbidden auth ID); exit; } if (!save(location)) sl_reply_error(); exit; } we have astersik sip.conf file as follows [general] port=5062 bindaddr=0.0.0.0 context=default outboundproxy=192.168.0.20 outboundproxyport=5060 register = username:sec...@sipgate.co.uk/username [username] type=friend context=incoming username=username secret=secret host=sipgate.co.uk host=dynamic fromdomain=sipgate.co.uk insecure=port,invite nat=yes disallow=all allow=alaw canreinvite=no However the REGISTER messages are sent by Astersik but ther is no response fron OpenSIPS and it is not routing them either . Is it because they are both on the same IP? We do have then on different ports so though it would be ok ___ 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
Re: [OpenSIPS-Users] Opensips as outbound proxy for asterisk client
Hi, many thanks we don't follow this line $du = sip:sipgate_ip_goes_here:port where do we get the sipgate ip, should this just be $du = sip:sipgate.co.uk:5060 at least it explains why we saw the REGISTER being gobbled --- On Sat, 24/7/10, Laszlo las...@voipfreak.net wrote: From: Laszlo las...@voipfreak.net Subject: Re: [OpenSIPS-Users] Opensips as outbound proxy for asterisk client To: nauman762-h...@yahoo.co.uk, OpenSIPS users mailling list users@lists.opensips.org Date: Saturday, 24 July, 2010, 19:28 You can relay the register to sipgate, so when auth is done, then you can forward it. consume_credentials(); $du = sip:sipgate_ip_goes_here:port; t_relay(); exit; so instead of doing if (!save(location)) etc -Laszlo 2010/7/24 Nauman Sulaiman nauman762-h...@yahoo.co.uk Hi, We have Asterisk 1.6.2.9 and Opensips 1.6.2 in the same Linux box and we want to have OpenSIPS as the out/inbound proxy for Asterisk when running as UAC. We have Asterisk registered with Sipgate ok when sending REGISTER directly to the Sipgate domain but would like to send the Register via OpenSIPS so it's in the path for incoming invites Opensips.cfg as follows listen=udp:192.168.0.20:5060 register code: we have removed the authentication for now to get this working first if (is_method(REGISTER)) { if (!db_check_to()) { sl_send_reply(403,Forbidden auth ID); exit; } if (!save(location)) sl_reply_error(); exit; } we have astersik sip.conf file as follows [general] port=5062 bindaddr=0.0.0.0 context=default outboundproxy=192.168.0.20 outboundproxyport=5060 register = username:sec...@sipgate.co.uk/username [username] type=friend context=incoming username=username secret=secret host=sipgate.co.uk host=dynamic fromdomain=sipgate.co.uk insecure=port,invite nat=yes disallow=all allow=alaw canreinvite=no However the REGISTER messages are sent by Astersik but ther is no response fron OpenSIPS and it is not routing them either . Is it because they are both on the same IP? We do have then on different ports so though it would be ok ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users #yiv373057038 #avg_ls_inline_popup {padding:0px 0px;margin-left:0px;margin-top:0px;width:240px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:13px;} ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Re: [OpenSIPS-Users] Opensips as outbound proxy for asterisk client
Hi, making progress we now have this so the REGISTER is passed to the Sipgate proxy transparently it could be any proxy server so if (is_method(REGISTER)) { ##$du = sip:sipgate.co.uk:5060; t_relay(); exit(); } We can see via Wireshark trace that REGISTER is reaching the sipgate proxy but OpenSIPS is returning a 403 to our Asterisk (acting as the SIP client) its because of this code, so then upon receiving the 403 from Opensips it doesn't respond to the 401 from the sipgate proxy. What should we be doing below if (!is_uri_host_local()) { if(is_from_local()) { route(1); } else { sl_send_reply(403,Not here); } ##append_hf(P-hint: outbound\r\n); # if you have some interdomain connections via TLS ##if($rd==tls_domain1.net) { ## t_relay(tls:domain1.net); ## exit; ##} else if($rd==tls_domain2.net) { ## t_relay(tls:domain2.net); ## exit; ##} ##route(1); } Thanks --- On Sat, 24/7/10, Nauman Sulaiman nauman762-h...@yahoo.co.uk wrote: From: Nauman Sulaiman nauman762-h...@yahoo.co.uk Subject: Re: [OpenSIPS-Users] Opensips as outbound proxy for asterisk client To: OpenSIPS users mailling list users@lists.opensips.org, Laszlo las...@voipfreak.net Date: Saturday, 24 July, 2010, 19:48 Hi, many thanks we don't follow this line $du = sip:sipgate_ip_goes_here:port where do we get the sipgate ip, should this just be $du = sip:sipgate.co.uk:5060 at least it explains why we saw the REGISTER being gobbled --- On Sat, 24/7/10, Laszlo las...@voipfreak.net wrote: From: Laszlo las...@voipfreak.net Subject: Re: [OpenSIPS-Users] Opensips as outbound proxy for asterisk client To: nauman762-h...@yahoo.co.uk, OpenSIPS users mailling list users@lists.opensips.org Date: Saturday, 24 July, 2010, 19:28 You can relay the register to sipgate, so when auth is done, then you can forward it. consume_credentials(); $du = sip:sipgate_ip_goes_here:port; t_relay(); exit; so instead of doing if (!save(location)) etc -Laszlo 2010/7/24 Nauman Sulaiman nauman762-h...@yahoo.co.uk Hi, We have Asterisk 1.6.2.9 and Opensips 1.6.2 in the same Linux box and we want to have OpenSIPS as the out/inbound proxy for Asterisk when running as UAC. We have Asterisk registered with Sipgate ok when sending REGISTER directly to the Sipgate domain but would like to send the Register via OpenSIPS so it's in the path for incoming invites Opensips.cfg as follows listen=udp:192.168.0.20:5060 register code: we have removed the authentication for now to get this working first if (is_method(REGISTER)) { if (!db_check_to()) { sl_send_reply(403,Forbidden auth ID); exit; } if (!save(location)) sl_reply_error(); exit; } we have astersik sip.conf file as follows [general] port=5062 bindaddr=0.0.0.0 context=default outboundproxy=192.168.0.20 outboundproxyport=5060 register = username:sec...@sipgate.co.uk/username [username] type=friend context=incoming username=username secret=secret host=sipgate.co.uk host=dynamic fromdomain=sipgate.co.uk insecure=port,invite nat=yes disallow=all allow=alaw canreinvite=no However the REGISTER messages are sent by Astersik but ther is no response fron OpenSIPS and it is not routing them either . Is it because they are both on the same IP? We do have then on different ports so though it would be ok ___ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users #yiv363631247 #yiv373057038 #avg_ls_inline_popup {padding:0px 0px;margin-left:0px;margin-top:0px;width:240px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:13px;} -Inline Attachment Follows- ___ 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