[Spce-user] Rewrite Rules - How to?
Andreas Granig
agranig at sipwise.com
Thu Apr 28 04:43:49 EDT 2016
Hi,
You can use "+\1" in the replacement part, it should work just fine.
Also there is the new routing verification tool in the panel, you can
use that to play with the rules and results.
My impression is that you might not have assigned the rewrite rule set
to the peer?
Also in regards to the extra params in your URI
"+13032990801;rn=4088915607;npdi=yes at sip.trunk.net", all your params are
in the user part, so you can easily add them via rewrite rules. E.g. if
your E164 number is 13032990801, you do a match like "^([0-9]+)$" and a
replacement "+\1;rn=xxx;npdi=yes" and it should create the right results.
Problem here is just that the routing number param might not be
available for you. We have introduced local LNP support which allows to
set a routing number for a ported number, but it's by default replacing
the R-URI user with the routing number if found. That might need some
customization to your lnp logic, or maybe we can come up with a more
flexible solution. Main problem here is that you can't easily put the
routing number variable into rewrite rules, because you can't check
whether it's empty or not. We have plans to execute more than one rules
within a rewrite rule set, which might solve that issue (e.g. you could
put the rn=${callee_routing_number} param there on one rule, and check
in a second rule if it's empty, and if so, remove it again. That kind of
logic is on the road map for the next months until the next LTS.
Andreas
On 04/24/2016 08:29 PM, Matthias Hohl wrote:
> Hello,
>
>
>
> yes for Outgoing Calls (so Calls from the SPCE to a Peering) you need a
> Rewrite Rule you set at the Peering.
>
> The direction is OUTGOING. Callee = The part who will receive the call
> (in this way anyone in the pstn network), Caller = The part who made the
> call (in this way one of your subscribers).
>
>
>
> I am not expert in regex so better to ask somebody else for solve it. I
> believe the problem is that regex don’t regonize “+” as a character to set.
>
>
>
>
>
>
>
>
>
>
>
> *Von:*Atlanta Man [mailto:axxtel_man at yahoo.com]
> *Gesendet:* Sonntag, 24. April 2016 16:55
> *An:* Matthias Hohl <matthias.hohl at telematica.at>
> *Betreff:* Re: AW: [Spce-user] Rewrite Rules - How to?
>
>
>
> Hi Matthias,
>
>
>
> Thanks for your reply.
>
>
>
> First of all I need a little clarification. I assume Callee refers to
> person receiving a call on my switch and Caller refers to originator of
> the call.
>
>
>
> I want this to be used for calls where the call originates from the
> SipWise switch and terminates on a PSTN line.
>
>
>
> I tried the match pattern/replacement pattern combination. Get message
> they are not compatible. I have tried
>
>
>
> Match Pattern ^([1-9][0-9]+)$ with replacement +\1 and +1\1
>
>
>
> These were not successful. Both sent sip:6785551212 at sip.trunk.netto the
> provider.
>
>
>
> ˆ([1-9][0-9]+)$
>
>
>
> +1\1
>
>
>
>
>
>
>
> On Sunday, April 24, 2016 10:26 AM, Matthias Hohl
> <matthias.hohl at telematica.at <mailto:matthias.hohl at telematica.at>> wrote:
>
>
>
> Hello,
>
>
>
> do you need it for Callee or Caller number?
>
> I think you just need the “+” in front of your E.164 number.
>
>
>
> So you must create a Peering Rewrite Rule for this peer.
>
>
>
> For Callee Number try this:
>
> Outbound Rewrite Rules for Callee
>
> Match Pattern: ^.+$
>
> Replacement Pattern: +\1
>
>
>
> For Caller to the same for “Outbound Rewrite Rules for Caller”
>
>
>
> But I am not 100% sure if the match and replacement pattern works in
> this way.
>
>
>
>
>
> *Von:*Spce-user [mailto:spce-user-bounces at lists.sipwise.com] *Im Auftrag
> von *Atlanta Man
> *Gesendet:* Sonntag, 24. April 2016 13:17
> *An:* spce-user at lists.sipwise.com <mailto:spce-user at lists.sipwise.com>
> *Betreff:* [Spce-user] Rewrite Rules - How to?
>
>
>
> Hi,
>
>
>
> I just got my SipWise server running and have questions about creating
> proper dial plans. One of my carriers requires this format for traffic
> sent to them.
>
>
>
> INVITE sip:+13032990801;rn=4088915607;npdi=yes at sip.trunk.net:5060SIP/2.0
>
>
>
> Can anyone assist, I am unable to create an outbound rewrite rule that
> produces this output.
>
>
>
> Thanks
>
>
>
>
>
>
>
> _______________________________________________
> Spce-user mailing list
> Spce-user at lists.sipwise.com
> https://lists.sipwise.com/listinfo/spce-user
>
More information about the Spce-user
mailing list