[Spce-user] DDI definition with subscriber

Daniel Grotti dgrotti at sipwise.com
Mon Nov 26 03:23:53 EST 2012


Hi,
btw if you want to call the number 421322851111 dialing 0322851111, you
need to have in your 'Inbound Rewrite Rules for Callee'the following
entries:

Match Pattern: ^0([1-9][0-9]+)$
Replacement Pattern: ${caller_cc}\1

So, in your DB your entry should looks like:

+----+------+----+----------+------------------------+-----------+------------------------+--------------------------------------+-------+
| id | dpid | pr | match_op | match_exp              | match_len |
subst_exp              | repl_exp                             | attrs |
+----+------+----+----------+------------------------+-----------+------------------------+--------------------------------------+-------+
| 20 |    6 |  2 |        1 | ^0([1-9][0-9]+)$       |         0 |
^0([1-9][0-9]+)$       | $avp(s:caller_cc)\1                  |       |


Regards.






On 11/26/2012 09:10 AM, Samcik Matej wrote:
> Hi,
>
> I am sorry, it was problem with charcter encoding, this is what I have in db.
> +----+------+----+----------+-------------------------+-----------+-------------------------+--------------------------------------+-------+
> | id | dpid | pr | match_op | match_exp               | match_len | subst_exp               | repl_exp                             | attrs |
> +----+------+----+----------+-------------------------+-----------+-------------------------+--------------------------------------+-------+
> | 22 |   17 |  1 |        1 | ?(00|\+)([0-9][0-9]+)$  |         0 | ?(00|\+)([0-9][0-9]+)$  | \2                                   |       |
> | 23 |   18 |  0 |        1 | ?(00|\+)([0-9][0-9]+)$  |         0 | ?(00|\+)([0-9][0-9]+)$  | \2                                   |       |
> | 24 |   18 |  1 |        1 | ?0([1-9][0-9]+)$        |         0 | ?0([1-9][0-9]+)$        | $avp(s:caller_cc)\1                  |       |
> | 25 |   18 |  2 |        1 | ?([1-9][0-9]+)$         |         0 | ?([1-9][0-9]+)$         | $avp(s:caller_cc)$avp(s:caller_ac)\1 |       |
> | 26 |   17 |  2 |        1 | ?0([1-9][0-9]+)$        |         0 | ?0([1-9][0-9]+)$        | $avp(s:caller_cc)\1                  |       |
> | 27 |   17 |  3 |        1 | ?([1-9][0-9]+)$         |         0 | ?([1-9][0-9]+)$         | $avp(s:caller_cc)$avp(s:caller_ac)\1 |       |
> +----+------+----+----------+-------------------------+-----------+-------------------------+--------------------------------------+-------+
>
>
> -----Original Message-----
> From: Daniel Grotti [mailto:dgrotti at sipwise.com] 
> Sent: Friday, November 23, 2012 5:23 PM
> To: Samcik Matej
> Cc: spce-user at lists.sipwise.com
> Subject: Re: [Spce-user] DDI definition with subscriber
>
> Hi,
> in your rewrite rules, try to replace the "?" symbol with "^" (begin with).
>
> Regards.
>
>
>
> On 11/23/2012 05:04 PM, Samcik Matej wrote:
>> Hi,
>>
>> now I see, my ddi definition is working ok now, but I have problem with rewrite rules (normalization), I have filled rewrite-rules according to hanbook-ce, attached them to domain, but nothing ever matches.
>>
>> mysql> select * from dialplan;
>> +----+------+----+----------+-------------------------+-----------+-------------------------+--------------------------------------+-------+
>> | id | dpid | pr | match_op | match_exp               | match_len | subst_exp               | repl_exp                             | attrs |
>> +----+------+----+----------+-------------------------+-----------+-------------------------+--------------------------------------+-------+
>> | 22 |   17 |  1 |        1 | ?(00|\+)([0-9][0-9]+)$  |         0 | ?(00|\+)([0-9][0-9]+)$  | \2                                   |       |
>> | 23 |   18 |  0 |        1 | ?(00|\+)([0-9][0-9]+)$  |         0 | ?(00|\+)([0-9][0-9]+)$  | \2                                   |       |
>> | 24 |   18 |  1 |        1 | ?0([1-9][0-9]+)$        |         0 | ?0([1-9][0-9]+)$        | $avp(s:caller_cc)\1                  |       |
>> | 25 |   18 |  2 |        1 | ?([1-9][0-9]+)$         |         0 | ?([1-9][0-9]+)$         | $avp(s:caller_cc)$avp(s:caller_ac)\1 |       |
>> | 26 |   17 |  2 |        1 | ?0([1-9][0-9]+)$        |         0 | ?0([1-9][0-9]+)$        | $avp(s:caller_cc)\1                  |       |
>> | 27 |   17 |  3 |        1 | ?([1-9][0-9]+)$         |         0 | ?([1-9][0-9]+)$         | $avp(s:caller_cc)$avp(s:caller_ac)\1 |       |
>> +----+------+----+----------+-------------------------+-----------+-------------------------+--------------------------------------+-------+
>>
>> I have dialed 0322851111 expecting ngcpce to normalize placed number into E164 but did not match anything, No matching rewrite rules for '0322851111' found, why?
>>
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17040]: INFO: <script>: 
>> New request - M=INVITE R=sip:0322851111 at 212.56.68.8 
>> F=sip:0322850001 at 212.56.68.8 T=sip:0322851111 at 212.56.68.8 
>> IP=212.55.165.61:5062 (127.0.0.1:5060) 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17040]: INFO: <script>: 
>> Authentication failed, no credentials - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> New request - M=INVITE R=sip:0322851111 at 212.56.68.8 
>> F=sip:0322850001 at 212.56.68.8 T=sip:0322851111 at 212.56.68.8 
>> IP=212.55.165.61:5062 (127.0.0.1:5060) 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Clear caller preferences - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Load caller preferences for uuid 
>> '7f638aa7-e69a-4e2a-9860-cea2b8862d5a' and domain part of uri 
>> 'sip:0322850001 at 212.56.68.8' - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Load dialplan IDs for domain 'sip:0322850001 at 212.56.68.8' - 
>> R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Fetched dialplan IDs caller_in='17', callee_in='18' - 
>> R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Dialog set total - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Dialog set user, userout, account, accountout to 
>> '7f638aa7-e69a-4e2a-9860-cea2b8862d5a/3' - 
>> R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> IP authorization for caller not provisioned, allow call - 
>> R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> User-Provided CLI '0322850001' taken from From-User - 
>> R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Applying caller-in domain rewrite rules on user-provided CLI using 
>> dpid '17' - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> No matching rewrite rules for '0322850001' found - 
>> R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Checking user-provided CLI against allowed CLIs - 
>> R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> User-provided CLI '0322850001' rejected, using network-provided CLI 
>> '421322850001' - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Setting '421322850001 at 212.56.68.8' as initiating user-provided CLI - 
>> R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Setting '421322850001 at 212.56.68.8' as initiating network-provided CLI 
>> - R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Searching for callee - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Applying callee-in domain rewrite rules using dpid '18' - 
>> R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> No matching rewrite rules for '0322851111' found - 
>> R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Clear callee preferences - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Callee is not local - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Check Administrative NCOS level - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Check User NCOS level - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Admin caller block mode is 'open' - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Caller block mode is 'open' - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Call to SIP Peering - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Load gws matching calling part '421322850001 at 212.56.68.8' and called 
>> part '0322851111' - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Dialog set mark type to outgoing - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: ERROR: <script>: 
>> No PSTN gateways available - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Accounting failed request for uuid 
>> '7f638aa7-e69a-4e2a-9860-cea2b8862d5a' - R=sip:0322851111 at 212.56.68.8 
>> ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Setting acc source-leg for uuid 
>> '7f638aa7-e69a-4e2a-9860-cea2b8862d5a': 
>> '7f638aa7-e69a-4e2a-9860-cea2b8862d5a|0322850001|212.56.68.8|421322850
>> 001|Test-cislo1 retail||3|||0|call|1351129907.897574' - 
>> R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17036]: INFO: <script>: 
>> Setting acc destination-leg for uuid '0': 
>> '||<null>|0322851111|0|0322851111|212.56.68.8|0322851111|212.56.68.8' 
>> - R=sip:0322851111 at 212.56.68.8 ID=51b4af916d6846669f8a87c897e44e7e
>> Oct 25 03:51:47 sipwise-ce /usr/sbin/kamailio[17033]: INFO: <script>: 
>> New request - M=ACK R=sip:0322851111 at 212.56.68.8 
>> F=sip:0322850001 at 212.56.68.8 T=sip:0322851111 at 212.56.68.8 
>> IP=212.55.165.61:5062 (127.0.0.1:5060) 
>> ID=51b4af916d6846669f8a87c897e44e7e
>>
>>  
>>
>> -----Original Message-----
>> From: Andrew Pogrebennyk [mailto:apogrebennyk at sipwise.com]
>> Sent: Friday, November 23, 2012 2:29 PM
>> To: Samcik Matej
>> Cc: spce-user at lists.sipwise.com
>> Subject: Re: [Spce-user] DDI definition with subscriber
>>
>> Hello,
>>
>> On 11/23/2012 02:17 PM, Samcik Matej wrote:
>>> how to define subscriber? E164 as +421 32 285111 and SIP URI 
>>> 032285111 or do I need set up aliases? +421 32 285111
>> Just create a subscriber with E164 as +421 32 285111 and SIP-URI 
>> doesn't matter in this context. Aliases are not needed as every number 
>> is treated as a block.
>>
>>> I am able to call from DDI with allowed clis definition 
>>> 032285111[0-9], but cannot get working inbound DDI. Permanent contact 
>>> is not working for me I have tried sip:032285111 at myip:5060.
>> Can't give any definitive answer without seeing the kamailio-proxy.log.
>>
>> Note that if the subscriber's device is able to register on your 
>> server, permanent contact is not needed but you may have to enable 
>> e164_to_ruri option, depending on what the device expects to receive.
>>
>> HTH.
>> Andrew
>>
>> _______________________________________________
>> 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