[Spce-user] route calls between local users through peers

Daniel Grotti dgrotti at sipwise.com
Fri Feb 7 06:17:39 EST 2014


Hi Dario,
you should set the following in your
/etc/ngcp-config/templates/etc/kamailio/proxy/proxy.cfg.customtt.tt2 file:


if($var(from_local_endpoint) == 0 && $avp(s:from_faxserver) == 0 &&
$avp(s:from_voicebox) == 0)
{
     xlog("L_NOTICE", "Force on-net call to peer by caller's preference
- [% logreq -%]\n");
+ $rU = $avp(s:callee_base_user);
  route(ROUTE_LOAD_CALLEE_PREF);
  route(ROUTE_CHECK_PBX);
  route(ROUTE_INVITE_TO_EXT); 	


So you have to add this line there "$rU = $avp(s:callee_base_user);"
After that just apply the changes.
Proxy will be restarted.

Daniel





On 02/07/2014 10:02 AM, Dario Busso wrote:
> Greetings you all.
>   I need to configure the ngcp to route all calls from local subscribers
> to peers even if the caller try to place a call to another local
> subscriber (this is a LI constrain). I've set in the domain preferences
> -> internals -> force_outbound_calls_to_peer but the calls aren't routed
> to the peer because it doesn't match the preferenceies rules of the peer
> (currently I've only one peer/gw) because the system try to match only
> numerical callee. In ngcp kamailio-proxy.log I've found the following
> response:
> 
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: New request -
> M=INVITE R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> F=sip:test2-sip3 at test.domain.it <mailto:sip%3Atest2-sip3 at test.domain.it>
> T=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> IP=213.144.67.1:55873 <http://213.144.67.1:55873> (127.0.0.1:5060
> <http://127.0.0.1:5060>) ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Load domain
> preferences for callee - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Clean domain
> preferences for callee - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Adding reply
> P-NGCP-Caller-Info '<sip:test2-sip3 at test.domain.it
> <mailto:sip%3Atest2-sip3 at test.domain.it>>;ip=213.144.67.1;port=55873' -
> R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Clear caller
> preferences - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Load caller
> preferences for uuid '2ad200ae-587c-4397-843b-ab07974930ba' and domain
> 'sip3.overip.it <http://sip3.overip.it>' -
> R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Fetched dialplan IDs
> caller_in='1', callee_in='2' - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Use 'P-NGCP-Src-Ip'
> for CDR IP - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Dialog set total -
> R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Dialog set user,
> userout, account, accountout to '2ad200ae-587c-4397-843b-ab07974930ba/3'
> - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Found ipauth id '22'
> for caller, call authorized on IP level -R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: User-Provided CLI
> 'test2-sip3' taken from From-User - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Applying caller-in
> usr/domain rewrite rules on user-provided CLI using dpid '1' -
> R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: No matching rewrite
> rules for 'test2-sip3' found - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Checking User-provided
> CLI against allowed CLIs - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: User-provided CLI
> 'test2-sip3' rejected, using provisioned user-provided CLI '0175....28'
> - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: Setting
> '0175....28 at test.domain.it <mailto:0175....28 at test.domain.it>' as
> initiating user-provided CLI - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: Setting
> '390175....28 at test.domain.it <mailto:390175....28 at test.domain.it>' as
> initiating network-provided CLI - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Searching for callee -
> R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Applying callee-in
> usr/domain rewrite rules on called party using dpid '2' -
> R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: Rewriting called
> party '0175....27' to '390175....27' - R=sip:0175....27 at test.domain.it
> <mailto:sip%3A0175....27 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: Callee was aliased
> with base '390175....27' - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Clear callee
> preferences - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Clear callee
> preferences - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: Callee is local,
> uuid='3a6e6ada-f73b-4c01-ba94-2d19d95da7ba' -
> R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Check Administrative
> NCOS level - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Check User NCOS level
> - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Checking URI
> 'test-sip3 at test.domain.it <mailto:test-sip3 at test.domain.it>' and CLI
> '390175....27' against block out lists - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Admin caller block
> mode is 'open' - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Caller block mode is
> 'open' - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: Force on-net call to
> peer by caller's preference - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Load callee
> preferences for uuid '3a6e6ada-f73b-4c01-ba94-2d19d95da7ba' domain:
> 'sip3.overip.it <http://sip3.overip.it>'- R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Fetched dialplan IDs
> caller_out='3', callee_out='4' - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Dialog set user,
> account to '3a6e6ada-f73b-4c01-ba94-2d19d95da7ba/3' -
> R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Checking UPN
> '0175....28' and NPN '390175....28' against block in lists -
> R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Admin callee block
> mode is 'open' - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Callee block mode is
> 'open' - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: Call to SIP Peering
> - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: Load gws matching
> calling part 'sip:0175....28 at test.domain.it
> <mailto:sip%3A0175....28 at test.domain.it>' and called user 'test-sip3'
> and called part 'sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone' -
> R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Dialog set mark type
> to outgoing - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: ERROR: <script>: No PSTN gateways
> available - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: INFO: <script>: Accounting failed
> request for uuid '2ad200ae-587c-4397-843b-ab07974930ba' -
> R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: Setting acc
> source-leg for uuid '2ad200ae-587c-4397-843b-ab07974930ba':
> '2ad200ae-587c-4397-843b-ab07974930ba|test2-sip3|sip3.overip.it
> <http://sip3.overip.it>|0175....28|||3|||0|call|213.144.67.1|1391762120.650289'
> - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> Feb  7 09:35:20 sip3 proxy[5400]: NOTICE: <script>: Setting acc
> destination-leg for uuid '3a6e6ada-f73b-4c01-ba94-2d19d95da7ba':
> '0|||3|0175....27|3a6e6ada-f73b-4c01-ba94-2d19d95da7ba|test-sip3|sip3.overip.it
> <http://sip3.overip.it>|390175....27|sip3.overip.it
> <http://sip3.overip.it>' - R=sip:test-sip3 at test.domain.it
> <mailto:sip%3Atest-sip3 at test.domain.it>;user=phone
> ID=2442643065 at 192_168_100_200
> 
> As you may see the call is dropped because the peering rules are checked
> against the local username (test-sip3) instead of the callee number
> (0175....27).
> 
> Have I something misconfigured?
> Any hints are welcome.
> 
> Regards.
> 
> Dario
> 
> -- 
> ddB
> 
> 
> _______________________________________________
> Spce-user mailing list
> Spce-user at lists.sipwise.com
> http://lists.sipwise.com/listinfo/spce-user
> 




More information about the Spce-user mailing list