Hi,
I'd like to use official phone numbers inside my voip network (the numbers are assigned to me and are routed to my Cisco-5300 gateway in case of an incoming call from PSTN), and I don't want to use a prefix when calling from voip to PSTN.
Now when I want to perform a call from the voip net, how can I decide wether it's an internal voip call or should be routed to the PSTN gateway?
Would it be a proper solution to just lookup in the aliases- and location-table, and, if not found there, just forward it to the PSTN gateway? The PSTN gateway should then route it back to my SER if it's a number assigned to me, and I'd get a loop, which should be detected by the mf_process_maxfwd_header() function.
Sounds like a ugly hack, and I'm really not shure if this would work, so how would be the standard solution for such a task? (beside using a PSTN prefix)
Regards, Andy
I wrote:
Would it be a proper solution to just lookup in the aliases- and location-table, and, if not found there, just forward it to the PSTN gateway? The PSTN gateway should then route it back to my SER if it's a number assigned to me, and I'd get a loop, which should be detected by the mf_process_maxfwd_header() function.
Sounds like a ugly hack, and I'm really not shure if this would work, so how would be the standard solution for such a task? (beside using a PSTN prefix)
Hmm... another idea: putting all of my users into a group "internal" and process the lookup("location") based on the group:
if (is_user_in("To", "internal")) { # this one goes to my voip net ... } else { if(is_user_in("From", "internal")) { # internal users are allowed to go to GW t_relay_to_tcp("GW-IP", "GW-Port"); # or something like that break; } else { # no relaying via my GW ... # (error processing) } }
What about this approach?
Andy
Just the same thing idea as in my approach, but IMO a smarter workaround.
klaus
Andreas Granig wrote:
I wrote:
Would it be a proper solution to just lookup in the aliases- and location-table, and, if not found there, just forward it to the PSTN gateway? The PSTN gateway should then route it back to my SER if it's a number assigned to me, and I'd get a loop, which should be detected by the mf_process_maxfwd_header() function.
Sounds like a ugly hack, and I'm really not shure if this would work, so how would be the standard solution for such a task? (beside using a PSTN prefix)
Hmm... another idea: putting all of my users into a group "internal" and process the lookup("location") based on the group:
if (is_user_in("To", "internal")) { # this one goes to my voip net ... } else { if(is_user_in("From", "internal")) { # internal users are allowed to go to GW t_relay_to_tcp("GW-IP", "GW-Port"); # or something like that break; } else { # no relaying via my GW ... # (error processing) } }
What about this approach?
Andy
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Does your cients have random phone numbers or are they all in the same block? IF you have a numer block, e.g. 321XXXX, just use if (uri=~"^sip:321[0-9][0-9][0-9][0-9]") lookup(location) .... else forward to PSTN
If the internal numbers are random, you can use e.g. a second location table (let's call it location2). It will have the same structure as the location (or alias) table and you have to enter every client, and using its local account as contact (so lookups will not change the request-uri)
then the proxy could do:
if (lookup("location2")) { user is a local user if (lookup("location")) { #user is online t_relay() } else { sl_send_reply("404","offline"); } else { #no local client t_relay_to_tcp("gateway-ip"); }
If someone knows an easier solution I'm pleased to hear it.
regards, klaus
Andreas Granig wrote:
Hi,
I'd like to use official phone numbers inside my voip network (the numbers are assigned to me and are routed to my Cisco-5300 gateway in case of an incoming call from PSTN), and I don't want to use a prefix when calling from voip to PSTN.
Now when I want to perform a call from the voip net, how can I decide wether it's an internal voip call or should be routed to the PSTN gateway?
Would it be a proper solution to just lookup in the aliases- and location-table, and, if not found there, just forward it to the PSTN gateway? The PSTN gateway should then route it back to my SER if it's a number assigned to me, and I'd get a loop, which should be detected by the mf_process_maxfwd_header() function.
Sounds like a ugly hack, and I'm really not shure if this would work, so how would be the standard solution for such a task? (beside using a PSTN prefix)
Regards, Andy
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Klaus Darilion wrote:
Does your cients have random phone numbers or are they all in the same block? IF you have a numer block, e.g. 321XXXX, just use if (uri=~"^sip:321[0-9][0-9][0-9][0-9]") lookup(location) ....
I have a coherent number block, but numbers are prefixed by different area codes with different length, and they are also suffixed by numbers with different length, so no chance here for simple number matching.
If the internal numbers are random, you can use e.g. a second location table (let's call it location2). It will have the same structure as the location (or alias) table and you have to enter every client, and using its local account as contact (so lookups will not change the request-uri)
Hmm, ok, this would be another possibility to think about, thanks.
On the other hand, the approch with group membership would be more flexible, because I could restrict some users to internal calls only.
Andy
I use: if (!does_uri_exist()) { "route to gw" ... };
Tor.
Andreas Granig wrote:
Klaus Darilion wrote:
Does your cients have random phone numbers or are they all in the same block? IF you have a numer block, e.g. 321XXXX, just use if (uri=~"^sip:321[0-9][0-9][0-9][0-9]") lookup(location) ....
I have a coherent number block, but numbers are prefixed by different area codes with different length, and they are also suffixed by numbers with different length, so no chance here for simple number matching.
If the internal numbers are random, you can use e.g. a second location table (let's call it location2). It will have the same structure as the location (or alias) table and you have to enter every client, and using its local account as contact (so lookups will not change the request-uri)
Hmm, ok, this would be another possibility to think about, thanks.
On the other hand, the approch with group membership would be more flexible, because I could restrict some users to internal calls only.
Andy
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers