Introduction
Messagenet, as a Telephone Carrier, must ensure to originate calls from its network using CLI (CallerID):
- from its own numbers;
- from other carrier, but limited to call diversions;
It's plain that Messagenet need to filter and check (screening) the calling number provided, hence:
- commonly, this is ensured by configuration provided within user accounts on our server (e.g.: server-side call diversion, );
- a proof is needed in order to ensure that a calling number could be used as outbound CLI for a call diversion made by local bridge between calls on a customer client/PBX;
- No other methods are available, as SIP REFER or SIP 302: they'll fail!
Here we show you how this works and how to implement it.
Funzionamento
Messagenet forwards additional custom SIP headers within INVITEs: the "X-Mnet-InLeg" SIP header, if copied and specified within headers in another outbound SIP call, proofs to us that those two calls are locally bridged and we'll keep the original Caller ID.
PAY ATTENTION! this will work only if those calls (received and diverted) are made within the same VoIP Account, or within VoIP Account sharing the same Messagenet UserID: you cannot use this method in order to keep original CLI in call bridges between unrelated VoIP Accounts!
Example Configuration on Asterisk PBX
The assumption is that our register get calls in a specific dialplan context, we'll use "s" as default extension (but those assumption can change based upon dialplan rules and needs, it depends on you).
Before to call Dial(), hence we need to:
- read the custom header from incoming SIP call;
- write the custom header to the Asterisk channel, in order to use it in the outbound SIP call;
Here we show how those lines could be written in your extensions.conf dialplan:
N.B.: the second line is the only instruction really needed
exten => s,n,...
exten => s,n,SipAddHeader(X-Mnet-InLeg: ${SIP_HEADER(X-Mnet-InLeg)})
exten => s,n,Dial(...)
Example Configuration on FreePBX
FreePBX it's indeed based on Asterisk core, so we can apply quite the same also in this scenario.
It'll be similar then, but following FreePBX way and style:
- call will be received and managed via an Inbound Route;
- this rule will dispatch the call to a Custom Destination similar to the above dialplan instructions;
this Custom Destination will Return() were needed: our header will be preserved till the outbound call via Messagenet (if any) and the original CLI will be preserved.
Here are two exaple screenshots:
More info on FreePBX (in italian):
https://helpcenter.messagenet.com/hc/it/articles/229468708-FreePBX-13-Stable-10-13-66-