📜 ⬆️ ⬇️

Audiocodes + Lync 2013 + provider that does not support History-info

During the work on the Lync 2013 implementation project, I encountered a problem with call forwarding (simultaneous call) and simultaneous ringing. The test team complained that forwarding was not working.

Troubleshuting revealed that this problem exists in certain scenarios. The problem is due to the fact that the provider does not route outgoing calls, where the caller's number (calling number) is not included in the pool of numbers provided to the client.

Detailed description and solution of the problem - under the cut.

Description of the problem


Lync docking infrastructure with telephony:
')


The diagram shows :


The following diagram shows the possible call forwarding scenarios.


Legend :


In scenario # 3, the provider “cuts” the outgoing call from the organization, since the calling number "E1" is not registered for the organization. For good, the provider must complete the call on the appropriate route and make an entry in the billing system according to the History-info field. But in our case, the provider does not accept the HISTORY-INFO field, the work of the provider’s billing system is based only on the FROM, TO attributes.

From Lync Mediation to Audiocodes comes the following SIP Invite request:

FROM: <sip:"E1";phone-context=enterprise@domain.net;user=phone>;epid=7B11BD1265;tag=8c9e1f2146 TO: <sip"E2"@voice_gw.domain.net;user=phone>CSEQ: 329 INVITE HISTORY-INFO: <sip:"L1"@lyncmediation1.domain.net;user=phone>;index=1;ms-retarget-reason=forwarding,<sip:"E2"@lyncmediation1.domain.net;user=phone>;index=1.1 


Formulation of the problem


Solution options :
  1. Recycle provider billing system;
  2. Create a route with a special prefix, activate the “Suppress caller ID” parameter on it and set the “Alternate caller ID”. Recommend users to enter the redirect number with the assigned prefix:



  3. Use the “SIP Message Manipulation Rule” feature, as described here. (a similar solution was proposed by the support of the vendor).


The first option did not even try.

The second and third options give more minuses than pluses. Scenario # 3 is fixed, but the useful functionality in scenarios # 1, 2, 4 is lost - all redirected calls come from the number on which redirection is activated.

It was decided to use the third option, finalizing it.

It is necessary, using the Message Manipulations Rule, to replace the value of the FROM field from sip: “E1” with sip “L1” for messages, where “E1” and “E2” are external numbers.

For other scenarios, this rule should not be applied, as this will lead to loss of functionality. The subscriber receiving the forwarded call will not see the caller-id of the caller.

Activation table of the substitution rule calling number :
#FROMForward TO (History-info)IsRuleNeedToBeApplied
oneinternalinternaFALSE
2externalinternalFALSE
3externalexternalTRUE
fourinternalexternalFALSE

Explanation of the table :


Decision


Configuration :
  1. Open the INI Settings page at xxxx / AdminPage . Set SetID, for this, in the Parameter Name field enter GWINBOUNDMANIPULATIONSET, in the Enter Value field the corresponding SetID number.



  2. Create the rules described in the following table at VOIP> SIP Defenitions> Message Manipulations.




Table of rules :
IndxIDMsgTypeConditionActSubjActTypeActvalueRowRole
oneoneinviteheader.history-info regex (sip: \ + 7 (717212 ....) @)var.call.src.0modify$ 20
2oneinviteheader.to regex (sip :(? 717212) (. *) @)var.global.0modify'one'0
3oneinviteheader.from regex (sip :(? 717212) (. *) @)header.from.url.usermodifyvar.call.src.00

Rule # 1 checks if the HISTORY-INFO header is present, forms a group that matches the extension number, writes this group to the variable var.call.src.0. This variable will be used in the 3rd rule for substitution of the calling number in header header.from.url.user.

Rule 2 checks the TO header for the presence of an external number. The regex function “Negative lookahead” is used, which excludes local numbers by the prefix 717212. In case of a positive result, the variable var.global.0 is written. This variable does not have any role.

Rule number 3 checks the FROM header for the presence of an external number. The regex function “Negative lookahead” is used, which excludes local numbers by the prefix 717212. In case of a positive result, the variable var.call.src.0, recorded in step 1, is used to substitute the called number in header header from.url.user.

Result


In scenario # 3, the calling number is replaced with the number of the initiator of the call forwarding.
In other scenarios, the calling number is not changed.

Appendix 1. Configuration Listing


 GWINBOUNDMANIPULATIONSET = 1 [ MessageManipulations ] FORMAT MessageManipulations_Index = MessageManipulations_ManSetID, MessageManipulations_MessageType, MessageManipulations_Condition, MessageManipulations_ActionSubject, MessageManipulations_ActionType, MessageManipulations_ActionValue, MessageManipulations_RowRole; MessageManipulations 1 = 1, "invite", "header.history-info regex (sip:\+7(717212....)@)", "var.call.src.0", 2, "$2", 0; MessageManipulations 2 = 1, "invite", "header.to regex (sip:(?!717212)(.*)@)", "var.global.0", 2, "'1'", 0; MessageManipulations 3 = 1, "invite", "header.from regex (sip:(?!717212)(.*)@)", "header.from.url.user", 2, "var.call.src.0", 0; [ \MessageManipulations ] 


Appendix 2. Useful Resources


  1. Quick Refence Guide. Sip message manipulation
  2. Regexr.com Online tool for Regular Expressions

Source: https://habr.com/ru/post/249711/


All Articles