<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: #000000'><style>p { margin: 0; }</style><div style="font-family: Arial,Helvetica,sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Hi David,<br><br>As far as I can tell, the alias module is independent of how the call is authenticated. My understanding is that it will look for a replacement URI based on the current one, and replace if a new one is found. It appears as though this "function" would go into the config file somewhere after the section I'm working on now. <br><br>Is my understanding correct? <br><br>I'll need some way to determine if this is an inbound call (i.e.; not originating from a subscriber's phone) prior to
mapping it to the alias module. Also, I'd like to determine if the
incoming call is from my PSTN gateway and give different aliases than if
the call was a SIP URI call.<br><br><span style="font-family: arial,helvetica,sans-serif;">Brett Woollum</span><br style="font-family: arial,helvetica,sans-serif;"><div><span style="font-family: arial,helvetica,sans-serif;">Brett@Woollum.com</span><br></div><br><br>----- Original Message -----<br>From: "David J." <david@styleflare.com><br>To: "OpenSIPS users mailling list" <users@lists.opensips.org><br>Sent: Tuesday, September 14, 2010 12:20:23 AM GMT -08:00 US/Canada Pacific<br>Subject: Re: [OpenSIPS-Users] Help with Inbound PSTN, and Inbound SIP URI Authentication Sub-Routine<br><br>
Hi Brett,<br>
<br>
The common practice is to use the alias module for inbound routing.<br>
<br>
You can look at the docs for its usage, but essentially you can map
DID's to local users.<br>
<br>
<br>
<br>
On 9/14/10 3:18 AM, Brett Woollum wrote:
<blockquote cite="mid:1183498277.14981284448731974.JavaMail.root@mail">
<style>p { margin: 0; }</style>
<div style="font-family: Arial,Helvetica,sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">Hello!<br>
<br>
I have an OpenSIPS 1.6.3 installation that is working well. I
have subscribers registering to OpenSIPS, and they can dial
between each other and outside of my domain (to my media servers
and to the PSTN). All is well.<br>
<br>
I am now beginning to write the configuration that will process
inbound calls - meaning calls from non-subscribers. This will
include calls from the PSTN gateway, as well as direct SIP URI
calls to the OpenSIPS subscribers. For example, a person can
call 515-555-1212 from a regular phone, and the call will come
to OpenSIPS as an un-authenticated call from my PSTN gateway.
Also, I'd like to accept SIP URI's for incoming calls. For
example, calling <a class="moz-txt-link-abbreviated" href="mailto:mycompany@mysipdomain.com" target="_blank">mycompany@mysipdomain.com</a> from a soft phone
might route the call to subscriber A's phone. <br>
<br>
The code I have that applies to this is: (This is currently
configured to authenticate all outbound calls from subscribers
only.)<br>
# authenticate if from local subscriber<br>
if (!(method=="REGISTER")) { <br>
if (!proxy_authorize("", "subscriber")) {
<br>
proxy_challenge("", "0");<br>
exit;<br>
}<br>
if (!db_check_from()) {<br>
send_reply("403","Forbidden auth ID");<br>
exit;<br>
}<br>
<br>
consume_credentials();<br>
# caller authenticated<br>
}<br>
<br>
I am looking for direction on how to expand this to determine if
the call is A) from a subscriber calling outbound, B) inbound
from the PSTN, or C) inbound from any other user calling my SIP
URI's. Once I am able to determine this information, I'll be
able to route the call appropriately within the rest of my
scripts.<br>
<br>
My problem is that my SIP phones usually attempt to place calls
without including authorization in the header (because they are
registered already), then OpenSIPS replies requiring proxy
authentication. The SIP phones will then try the call again
including the credentials in the header, which works. How can I
re-write this section of code to allow inbound SIP URI calls and
calls from my PSTN gateway, while still asking my subscribers to
authenticate? Or, is there a method that might work better?<br>
<br>
Notes:<br>
- Each of my PSTN gateway's has a static IP. <br>
- It's safe to assume a single-domain setup (mysipdomain.com).<br>
<br>
Thanks in advance!<br>
<br>
<div><span style="font-family: arial,helvetica,sans-serif;">Brett
Woollum</span><br style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: arial,helvetica,sans-serif;"><a class="moz-txt-link-abbreviated" href="mailto:Brett@Woollum.com" target="_blank">Brett@Woollum.com</a></span><br>
</div>
<br>
</div>
<pre><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
</div></div></body></html>