Astrad V7 : Hide CLI

Oussama Hammami, 2011-05-30

Switzernet

Scénario. 1

Préparation des interconnexions. 3

VOIP (openser kamailio) 4

SS7 (asterisk dahdi) 5

Limitation. 9

Mise à jour d’Astrad. 12

Script AGI d’authentification RADIUS.. 12

extensions.conf (asterisk) 14

Validation. 15

Choix du Vertical Service Code pour activer le masquage du numéro. 15

Masquage par appel 16

Masquage en permanence. 17

CISCO Linksys. 17

Siemens Gigaset 18

Grandstream.. 18

X-Lite. 18

Référence. 19

 

Cette version d’Astrad supportera l’option ‘cacher numéro’ en utilisant un préfixe (Vertical Service Code [http://en.wikipedia.org/wiki/Vertical_service_code]) avant le numéro à appeler.

 

Le champ FROM ne doit jamais être modifié pour cacher le numéro de l’appelant (exigence OFFCOM)

ftp://ftp.rfc-editor.org/in-notes/rfc3325.txt FAUX

* F4   proxy.cisco.com -> proxy.pstn.net (trusted)

 

   INVITE sip:+14085551212@proxy.pstn.net SIP/2.0

   Via: SIP/2.0/TCP useragent.cisco.com;branch=z9hG4bK-124

   Via: SIP/2.0/TCP proxy.cisco.com;branch=z9hG4bK-abc

   To: <sip:+14085551212@cisco.com>

   From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=9802748

   Call-ID: 245780247857024504

   CSeq: 2 INVITE

   Max-Forwards: 69

   P-Asserted-Identity: "Cullen Jennings" <sip:fluffy@cisco.com>

   P-Asserted-Identity: tel:+14085264000

   Privacy: id

Scénario

Le client peut activer cette option depuis son interface du Billing.

Il fixera un préfixe qui sera utilisé pour les appels sortant dont le numéro sera masqué.

 

 

[cli] Lors de l’authentification (RADIUS), la réponse du serveur Billing contiendra un champ ‘CLI’ vide pour indiquer que cette option est activée.

Hide CLI = No

h323-ivr-in=PortaBilling_Routing:@;g-hunt=seq

h323-ivr-in=PortaBilling_Routing: @;g-hunt=skip;expires=300;credit-time=343907;rtpp=1;patience=20

h323-ivr-in=PortaBilling_Routing:  +4176704XXXX@212.249.XX.XX;cli=+412155003XX

h323-ivr-in=PortaBilling_Routing:  004176704XXXX@212.249.XX.XX;cli=00412155003XX

h323-ivr-in=PortaBilling_Routing:  +4176704XXXX@212.249.XX.XX;cli=+412155003XX

h323-ivr-in=PortaBilling_Routing:  004176704XXXX@217.168.XX.XX;cli=00412155003XX

h323-ivr-in=PortaBilling_Routing:  4176704XXXX@80.77.XX.XX......m.h323-billing-model=0

h323-ivr-in=Tariff:business

h323-ivr-in=PortaBilling_CLI:412155003XX

h323-ivr-in=MOH:1

h323-ivr-in=PortaBilling_CompleteNumber:4176704XXXX

h323-ivr-in=PortaBilling_Auth_CLD:4176704XXXX

h323-ivr-in=PortaBilling_Auth_Reseller_CLD:4176704XXXX

h323-ivr-in=DURATION:343907

h323-return-code=0

h323-currency=CHF

h323-credit-time=343907

h323-preferred-lang=en

 

Hide CLI = Yes

h323-ivr-in=PortaBilling_Routing:@;g-hunt=seq

h323-ivr-in=PortaBilling_Routing: @;g-hunt=skip;expires=300;credit-time=343907;cli=;rtpp=1;patience=20

h323-ivr-in=PortaBilling_Routing:  +4176704XXXX@212.249.XX.XX;cli=+412155003XX

h323-ivr-in=PortaBilling_Routing:  004176704XXXX@212.249.XX.XX;cli=00412155003XX

h323-ivr-in=PortaBilling_Routing:  +4176704XXXX@212.249.XX.XX;cli=+412155003XX

h323-ivr-in=PortaBilling_Routing:  004176704XXXX@217.168.XX.XX;cli=00412155003XX

h323-ivr-in=PortaBilling_Routing:  4176704XXXX@80.77.XX.XX......m.h323-billing-model=0

h323-ivr-in=Tariff:business

h323-ivr-in=PortaBilling_CLI:412155003XX

h323-ivr-in=MOH:1

h323-ivr-in=PortaBilling_CompleteNumber:4176704XXXX

h323-ivr-in=PortaBilling_Auth_CLD:4176704XXXX

h323-ivr-in=PortaBilling_Auth_Reseller_CLD:4176704XXXX

h323-ivr-in=DURATION:343907

h323-return-code=0

h323-currency=CHF

h323-credit-time=343907

h323-preferred-lang=en

 

Notre script AGI d’authentification RADIUS réagira sur ce champ pour indiquer à Astrad qu’il faut ajouter le HEADER SIP Remote-Party-ID:

extensions.conf

...

exten => _X.,n,SIPAddHeader(Remote-Party-ID:"${CALLERID(num)}" <sip:${CALLERID(num)}@${NAS_IP_Address}>\;privacy=full\;screen=yes)

...

Préparation des interconnexions

Une première étape consiste à préparer les serveurs d’interconnexions afin qu’ils supportent le champ en question.

Switzernet dispose de deux types de serveurs d’interconnexions :

 

La configuration précédente de ces serveurs supporte cette option uniquement pour les appels entrants.

VOIP (openser kamailio)

 

Modification dans

/etc/openser/openser.cfg

/etc/kamailio/kamailio.cfg

...

else

       {

         xlog("L_INFO","$Ts $var(peers) ==> OUTGOING $oU\n");

         if(search("^Remote-Party-ID:.*privacy=(full|on|name)"))

            {

            xlog("L_INFO","$Ts $var(peers) ==> Privacy Call [ok]\n");

            }

         else

            {

            append_hf("Remote-Party-ID: <sip:$fU@$fd>;privacy=off;screen=yes\r\n");

            }

         rewritehost("whs-proxy.whsvoip.globalipcom.com");

...

 

Test

U 94.23.225.XXX:5060 -> 212.249.XX.XX:5060 (astrad -> interconnexion)

INVITE sip:+4176704XXXX@212.249.XX.XX SIP/2.0.

Via: SIP/2.0/UDP 94.23.225.XXX:5060;branch=z9hG4bK228ec54f;rport.

From: "412155003XX" <sip:412155003XX@94.23.225.XXX>;tag=as02810cb0.

To: <sip:+4176704XXXX@212.249.XX.XX>.

Contact: <sip:412155003XX@94.23.225.XXX>.

Call-ID: 4c9a03917ab09d7d2c031648140a1ec0@94.23.225.XXX.

CSeq: 102 INVITE.

User-Agent: Asterisk PBX.

Max-Forwards: 70.

Date: Thu, 26 May 2011 17:14:31 GMT.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.

Supported: replaces.

Remote-Party-ID: "412155003XX" <sip:412155003XX@94.23.225.XXX>;privacy=full;screen=yes.

h323-conf-id: 883770573-782288232-1317890605-482224154.

Content-Type: application/sdp.

Content-Length: 386.

 

U 212.249.XX.XX:5060 -> 195.129.8.3:5060

INVITE sip:+4176704XXXX@whs-proxy.whsvoip.globalipcom.com SIP/2.0.

Record-Route: <sip:212.249.XX.XX;lr=on;ftag=as02810cb0>.

Via: SIP/2.0/UDP 212.249.XX.XX;branch=z9hG4bK1226.13717073.0.

Via: SIP/2.0/UDP 94.23.225.XXX:5060;branch=z9hG4bK228ec54f;rport=5060.

From: "412155003XX" <sip:412155003XX@94.23.225.XXX>;tag=as02810cb0.

To: <sip:+4176704XXXX@212.249.XX.XX>.

Contact: <sip:412155003XX@94.23.225.XXX>.

Call-ID: 4c9a03917ab09d7d2c031648140a1ec0@94.23.225.XXX.

CSeq: 102 INVITE.

User-Agent: Asterisk PBX.

Max-Forwards: 69.

Date: Thu, 26 May 2011 17:14:31 GMT.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.

Supported: replaces.

Remote-Party-ID: "412155003XX" <sip:412155003XX@94.23.225.XXX>;privacy=full;screen=yes.

h323-conf-id: 883770573-782288232-1317890605-482224154.

Content-Type: application/sdp.

Content-Length: 386.

 

SS7 (asterisk dahdi)

Pour activer cette option il faut ajouter dans:

 

chan_dahdi.conf

usecallingpres=yes

 

extensions.conf

exten => _00.,n,ExecIf($[ ${CALLINGPRES} = 0 ],SetCallerPres,allowed)

exten => _00.,n,ExecIf($[ ${CALLINGPRES} = 32 ],SetCallerPres,allowed_not_screened)

http://www.the-asterisk-book.com/unstable/applikationen-setcallerpres.html

http://www.voip-info.org/wiki/view/Asterisk+cmd+SetCallerPres

 

Pour voir les paquets SS7 :

# /usr/sbin/asterisk –r

astSS7-swi*CLI> ss7 debug linkset 1

...

astSS7-swi*CLI> ss7 no debug linkset 1

 

Test

astSS7-clt:/etc/asterisk# /usr/sbin/asterisk -r | egrep -A1 Screening

                        Screening: 0

                        Address signals: 412155003XX

--

                        Screening: 1

                        Address signals: 412155003XX

 

Paquets SIP

U 94.23.225.XXX:5060 -> 217.168.XX.XX:5060

INVITE sip:004176704XXXX@217.168.XX.XX SIP/2.0.

Via: SIP/2.0/UDP 94.23.225.XXX:5060;branch=z9hG4bK1adaf4af;rport.

From: "00412155003XX" <sip:00412155003XX@94.23.225.XXX>;tag=as1e0c9076.

To: <sip:004176704XXXX@217.168.XX.XX>.

Contact: <sip:00412155003XX@94.23.225.XXX>.

Call-ID: 6a8cea7c2014fe9d7c6617064a0d05e3@94.23.225.XXX.

CSeq: 102 INVITE.

User-Agent: Asterisk PBX.

Max-Forwards: 70.

Date: Mon, 30 May 2011 12:41:37 GMT.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.

Supported: replaces.

Remote-Party-ID: "00412155003XX" <sip:00412155003XX@94.23.225.XXX>;privacy=full;screen=yes.

h323-conf-id: 415937302-391508030-907198832-499750846.

Content-Type: application/sdp.

Content-Length: 388.

 

U 217.168.XX.XX:5060 -> 94.23.225.XXX:5060

SIP/2.0 100 Trying.

Via: SIP/2.0/UDP 94.23.225.XXX:5060;branch=z9hG4bK1adaf4af;received=94.23.225.XXX;rport=5060.

From: "00412155003XX" <sip:00412155003XX@94.23.225.XXX>;tag=as1e0c9076.

To: <sip:004176704XXXX@217.168.XX.XX>.

Call-ID: 6a8cea7c2014fe9d7c6617064a0d05e3@94.23.225.XXX.

CSeq: 102 INVITE.

User-Agent: AsteriskSS7.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.

Supported: replaces, timer.

Contact: <sip:004176704XXXX@217.168.XX.XX>.

Content-Length: 0.

.

 

 

U 217.168.XX.XX:5060 -> 94.23.225.XXX:5060

SIP/2.0 183 Session Progress.

Via: SIP/2.0/UDP 94.23.225.XXX:5060;branch=z9hG4bK1adaf4af;received=94.23.225.XXX;rport=5060.

From: "00412155003XX" <sip:00412155003XX@94.23.225.XXX>;tag=as1e0c9076.

To: <sip:004176704XXXX@217.168.XX.XX>;tag=as21abfa8c.

Call-ID: 6a8cea7c2014fe9d7c6617064a0d05e3@94.23.225.XXX.

CSeq: 102 INVITE.

User-Agent: AsteriskSS7.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.

Supported: replaces, timer.

Contact: <sip:004176704XXXX@217.168.XX.XX>.

Content-Type: application/sdp.

Content-Length: 392.

.

 

U 217.168.XX.XX:5060 -> 94.23.225.XXX:5060

SIP/2.0 180 Ringing.

Via: SIP/2.0/UDP 94.23.225.XXX:5060;branch=z9hG4bK1adaf4af;received=94.23.225.XXX;rport=5060.

From: "00412155003XX" <sip:00412155003XX@94.23.225.XXX>;tag=as1e0c9076.

To: <sip:004176704XXXX@217.168.XX.XX>;tag=as21abfa8c.

Call-ID: 6a8cea7c2014fe9d7c6617064a0d05e3@94.23.225.XXX.

CSeq: 102 INVITE.

User-Agent: AsteriskSS7.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.

Supported: replaces, timer.

Contact: <sip:004176704XXXX@217.168.XX.XX>.

Content-Length: 0.

.

 

Exemple paquets SS7

Len = 38 [ bb 87 23 c5 27 02 07 13 01 00 01 00 60 01 0a 00 02 0a 08 04 10 14 67 07 94 90 f8 0a 08 84 10 14 12 55 00 23 09 00 ]

FSN: 7 FIB 1LI>

BSN: 59 BIB 1

>[0] MSU

[ bb 87 23 ]

        Network Indicator: 3 Priority: 0 User Part: ISUP (5)

astSS7-s[ c5 ]>

astSS7-sOPC 3100 DPC 551 SLS 1

        [ 27 02 07 13 ]

                CIC: 1

                [ 01 00 ]

                Message Type: IAM

                [ 01 ]

                --FIXED LENGTH PARMS[4]--

                Nature of Connection Indicator:

                        Satellites in connection: 0

                        Continuity Check: Check not required (0)

                        Outgoing half echo control device: not included (0)

                        [ 00 ]

                Forward Call Indicators:

                        Nat/Intl Call Ind: call to be treated as a national call (0)

                        End to End Method Ind: no end-to-end method(s) available (0)

                        Interworking Ind: no interworking encountered (0)

                        End to End Info Ind: no end-to-end information available (0)

                        ISDN User Part Ind: ISDN user part used all the way (1)

                        ISDN User Part Pref Ind: ISDN user part not preferred all the way (1)

                        ISDN Access Ind: originating access ISDN (1)

                        SCCP Method Ind: no indication (0)

                        [ 60 01 ]

                Calling Party's Category:

                        Category: Ordinary calling subscriber (10)

                        [ 0a ]

                Transmission Medium Requirements:

                        Speech (0)

         [ 00 ]

 --VARIABLE LENGTH PARMS[1]--

                Called Party Number:

                        Nature of address: 4

                        NI: 0

         Numbering plan: 1

                        Address signals: 4176704XXXX#

                        [ 08 04 10 14 67 07 94 90 f8 ]

 --OPTIONAL PARMS--

                Calling Party Number:

         Nature of address: 4

                        NI: 0

         Numbering plan: 1

                        Presentation: 0

                        Screening: 0

                        Address signals: 412155003XX

                        [ 0a 08 84 10 14 12 55 00 23 09 ]

http://wapiti.telecom-lille1.eu/commun/ens/peda/options/ST/RIO/pub/exposes/exposesrio1998/SS7&IP/page2.html

 

Vous trouverez dans ce ZIP tous les fichiers de configuration modifiés : 110530-interconnexion-conf

Limitation

Il existe deux Headers possibles pour activer le masquage de l’identifiant P-Asserted-Identity ou Remote-Party-ID header

http://www.voip-info.org/wiki/view/P-Asserted-Identity+and+Remote-Party-ID+header

 

Verizon exige l’utilisation du Header Remote-Party-ID header, l’asterisk (ss7 et voip) comprend très bien ce Header, il suffit juste de l’ajouter avant le DIAL.

 

Exemple avec asterisk ss7

U 94.23.XX.XX:5060 -> 212.249.XX.XX:5060

INVITE sip:004176704XXXX@212.249.XX.XX SIP/2.0.

Via: SIP/2.0/UDP 94.23.XX.XX:5060;branch=z9hG4bK650a84ea;rport.

From: "412155041XX" <sip:412155041XX@94.23.XX.XX>;tag=as0ed99494.

To: <sip:004176704XXXX@212.249.XX.XX>.

Contact: <sip:412155041XX@94.23.XX.XX>.

Call-ID: 263deebc017bd7197adf45fd4ce38ff6@94.23.XX.XX.

CSeq: 102 INVITE.

User-Agent: Asterisk PBX.

Max-Forwards: 70.

Date: Fri, 03 Jun 2011 16:55:08 GMT.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.

Supported: replaces.

Remote-Party-ID: "412155041XX" <sip:412155041XX@94.23.XX.XX>;privacy=full;screen=yes.

h323-conf-id: 1991014596-443549776-1515317774-1941881347.

Content-Type: application/sdp.

Content-Length: 386.

 

astSS7-swi:/etc/asterisk# /usr/sbin/asterisk -r | egrep -A1 Screening

 

                        Screening: 0

                        Address signals: 2155041XX

 

Exemple avec Asterisk VOIP (41215504126 -> 41215504127)

U 94.23.XX.XX:5060 -> 91.121.XX.XX:5060

INVITE sip:41215504127@91.121.XX.XX SIP/2.0.

Via: SIP/2.0/UDP 94.23.XX.XX:5060;branch=z9hG4bK312c33c0;rport.

From: "41215504126" <sip:41215504126@94.23.XX.XX>;tag=as389cfee5.

To: <sip:41215504127@91.121.XX.XX>.

Contact: <sip:41215504126@94.23.XX.XX>.

Call-ID: 5b3868ac5f98da244a9f01b11acd5364@94.23.XX.XX.

CSeq: 102 INVITE.

User-Agent: Asterisk PBX.

Max-Forwards: 70.

Date: Fri, 03 Jun 2011 17:14:25 GMT.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.

Supported: replaces.

Remote-Party-ID: "41215504126" <sip:41215504126@94.23.XX.XX>;privacy=full;screen=yes.

h323-conf-id: 404068901-646853916-1098385370-570313108.

Content-Type: application/sdp.

Content-Length: 386.

.

 

U 91.121.XX.XX:5060 -> 94.23.XX.XX:5060

SIP/2.0 100 Trying.

Via: SIP/2.0/UDP 94.23.XX.XX:5060;branch=z9hG4bK312c33c0;received=94.23.XX.XX;rport=5060.

From: "41215504126" <sip:41215504126@94.23.XX.XX>;tag=as389cfee5.

To: <sip:41215504127@91.121.XX.XX>.

Call-ID: 5b3868ac5f98da244a9f01b11acd5364@94.23.XX.XX.

CSeq: 102 INVITE.

User-Agent: Asterisk PBX.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.

Supported: replaces.

Contact: <sip:41215504127@91.121.XX.XX>.

Content-Length: 0.

.

 

U 91.121.XX.XX:5060 -> 212.147.8.105:1239

INVITE sip:41215504127@212.147.8.105:1239 SIP/2.0.

Via: SIP/2.0/UDP 91.121.XX.XX:5060;branch=z9hG4bK147d35bd;rport.

From: "Unknown" <sip:Unknown@91.121.XX.XX>;tag=as0d7fe076.

To: <sip:41215504127@212.147.8.105:1239>.

Contact: <sip:Unknown@91.121.XX.XX>.

Call-ID: 4019889c2569453b2408475a5f738f5c@91.121.XX.XX.

CSeq: 102 INVITE.

User-Agent: Asterisk PBX.

Max-Forwards: 70.

Date: Fri, 03 Jun 2011 17:14:26 GMT.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.

Supported: replaces.

h323-conf-id: 404068901-646853916-1098385370-570313108.

Content-Type: application/sdp.

Content-Length: 386.

 

Contrairement au header précèdent, le header  P-Asserted-Identity, est  plus difficile à comprendre et je n’avais pas réussi à l’utiliser correctement.

D’après ce document [http://www.voip-info.org/tiki-index.php?page=Asterisk%20config%20extensions.conf#Sipheadermanipulationexamples] les instructions sont les suivantes :

  exten => _9.,1,SIPAddHeader(P-Preferred-Identity: <sip:+1${CALLERID(num)}\;user=phone>) 

  exten => _9.,n,SIPAddHeader(Privacy: id) 

  exten => _9.,n.SetCallerPres(prohib_not_screened) ; this might not be needed --- needs further testing

  exten => _9.,n,Set(CALLERID(num)=)

  exten => _9.,n,Set(CALLERID(name)=Anonymous)

  exten => _9.,n,Dial(SIP/+${EXTEN:1}@sipcarrier)

  exten => _9.,n,Hangup()

 

Ce qui est conforme à la RFC-3325

* F4   proxy.cisco.com -> proxy.pstn.net (trusted)

 

   INVITE sip:+14085551212@proxy.pstn.net SIP/2.0

   Via: SIP/2.0/TCP useragent.cisco.com;branch=z9hG4bK-124

   Via: SIP/2.0/TCP proxy.cisco.com;branch=z9hG4bK-abc

   To: <sip:+14085551212@cisco.com>

   From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=9802748

   Call-ID: 245780247857024504

   CSeq: 2 INVITE

   Max-Forwards: 69

   P-Asserted-Identity: "Cullen Jennings" <sip:fluffy@cisco.com>

   P-Asserted-Identity: tel:+14085264000

   Privacy: id

 

Exemple avec Asterisk SS7

U 94.23.XX.XX:5060 -> 212.249.XX.XX:5060

INVITE sip:004176704XXXX@212.249.XX.XX SIP/2.0.

Via: SIP/2.0/UDP 94.23.XX.XX:5060;branch=z9hG4bK2fd6aa61;rport.

From: "Unknown" <sip:Unknown@94.23.XX.XX>;tag=as231f7ba6.

To: <sip:004176704XXXX@212.249.XX.XX>.

Contact: <sip:Unknown@94.23.XX.XX>.

Call-ID: 22e003243fd24ea3334f9b80094d8309@94.23.XX.XX.

CSeq: 102 INVITE.

User-Agent: Asterisk PBX.

Max-Forwards: 70.

Date: Fri, 03 Jun 2011 16:52:27 GMT.

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.

Supported: replaces.

Privacy: id.

P-Asserted-Identity: <sip:412155041XX@94.23.XX.XX>.

h323-conf-id: 708374744-1194229073-1087339007-455112333.

Content-Type: application/sdp.

Content-Length: 386.

.

L’Asterisk n’a pas bien réagi avec ce Header

astSS7-swi:/etc/asterisk# /usr/sbin/asterisk -r | egrep -A1 Screening

 

                        Screening: 3

                        Address signals: 0000000

 

Il me semble que faut aussi ajouter ces paramètres dans sip.conf trustrpid et sendrpid

Mise à jour d’Astrad

Script AGI d’authentification RADIUS

En analysant la réponse RADIUS du serveur on peut savoir si le client a activé cette option ou non grâce au champ cli.

 

Réponse RADIUS (CLI non masqué)

h323-ivr-in=PortaBilling_Routing:@;g-hunt=seq

h323-ivr-in=PortaBilling_Routing: @;g-hunt=skip;expires=300;credit-time=343907;rtpp=1;patience=20

h323-ivr-in=PortaBilling_Routing:  +4121550XXXX@212.249.XX.XX;cli=+412155003XX

h323-ivr-in=PortaBilling_Routing:  004121550XXXX@212.249.XX.XX;cli=00412155003XX

h323-ivr-in=PortaBilling_Routing:  +4121550XXXX@212.249.XX.XX;cli=+412155003XX

h323-ivr-in=PortaBilling_Routing:  004121550XXXX@217.168.XX.XX;cli=00412155003XX

h323-ivr-in=PortaBilling_Routing:  4121550XXXX@80.77.XX.XX......m.h323-billing-model=0

h323-ivr-in=Tariff:business

h323-ivr-in=PortaBilling_CLI:412155003XX

h323-ivr-in=MOH:1

h323-ivr-in=PortaBilling_CompleteNumber:4121550XXXX

h323-ivr-in=PortaBilling_Auth_CLD:4121550XXXX

h323-ivr-in=PortaBilling_Auth_Reseller_CLD:4121550XXXX

h323-ivr-in=DURATION:343907

h323-return-code=0

h323-currency=CHF

h323-credit-time=343907

h323-preferred-lang=en

 

Réponse RADIUS (CLI masqué)

h323-ivr-in=PortaBilling_Routing:@;g-hunt=seq

h323-ivr-in=PortaBilling_Routing: @;g-hunt=skip;expires=300;credit-time=343907;cli=;rtpp=1;patience=20

h323-ivr-in=PortaBilling_Routing:  +4121550XXXX@212.249.XX.XX;cli=+412155003XX

h323-ivr-in=PortaBilling_Routing:  004121550XXXX@212.249.XX.XX;cli=00412155003XX

h323-ivr-in=PortaBilling_Routing:  +4121550XXXX@212.249.XX.XX;cli=+412155003XX

h323-ivr-in=PortaBilling_Routing:  004121550XXXX@217.168.XX.XX;cli=00412155003XX

h323-ivr-in=PortaBilling_Routing:  4121550XXXX@80.77.XX.XX......m.h323-billing-model=0

h323-ivr-in=Tariff:business

h323-ivr-in=PortaBilling_CLI:412155003XX

h323-ivr-in=MOH:1

h323-ivr-in=PortaBilling_CompleteNumber:4121550XXXX

h323-ivr-in=PortaBilling_Auth_CLD:4121550XXXX

h323-ivr-in=PortaBilling_Auth_Reseller_CLD:4121550XXXX

h323-ivr-in=DURATION:343907

h323-return-code=0

h323-currency=CHF

h323-credit-time=343907

h323-preferred-lang=en

 

 Dans le cas d’une seule route, le Billing envoi une réponse RADIUS dont la table de routage est fusionnée avec les paramètres globaux d’appels. Il ne faut plus compter sur ce champ pour identifier le CLI dans le cas d’un appel masqué (dans cette cas on utilise le compte d’identification et non le CLI formaté h323-ivr-in=PortaBilling_CLI).

 

Réponse RADIUS (CLI non masqué)

h323-ivr-in=PortaBilling_Routing:@;g-hunt=seq

h323-ivr-in=PortaBilling_Routing: 004121550XXXX@217.168.XX.XX;expires=300;credit-time=6428;cli=004121550XXXX;rtpp=1;patience=20

h323-billing-model=0

h323-ivr-in=Tariff:business

h323-ivr-in=PortaBilling_CLI:4121550XXXX

h323-ivr-in=MOH:1

h323-ivr-in=PortaBilling_CompleteNumber:4121550XXXX

h323-ivr-in=PortaBilling_Auth_CLD:4121550XXXX

h323-ivr-in=PortaBilling_Auth_Reseller_CLD:4121550XXXX

h323-ivr-in=DURATION:6428

h323-return-code=0

h323-currency=CHF

h323-credit-time=6428

h323-preferred-lang=en

 

Réponse RADIUS (CLI masqué)

h323-ivr-in=PortaBilling_Routing:@;g-hunt=seq

h323-ivr-in=PortaBilling_Routing: 004121550XXXX@217.168.XX.XX;expires=300;credit-time=6428;cli=;rtpp=1;patience=20

h323-billing-model=0

h323-ivr-in=Tariff:business

h323-ivr-in=PortaBilling_CLI:4121550XXXX

h323-ivr-in=MOH:1

h323-ivr-in=PortaBilling_CompleteNumber:4121550XXXX

h323-ivr-in=PortaBilling_Auth_CLD:4121550XXXX

h323-ivr-in=PortaBilling_Auth_Reseller_CLD:4121550XXXX

h323-ivr-in=DURATION:6428

h323-return-code=0

h323-currency=CHF

h323-credit-time=6428

h323-preferred-lang=en

 

Maintenant notre script est capable de distinguer les appels masqués, Et pour communiquer cette information on a utilisé une variable Asterisk  ‘ActivePrivacy’ (initialisé à 0, 1 : masquage activé).

...

if ($a->{'Value'} =~ /^h323-ivr-in=PortaBilling_Routing:.*;cli=;/){

           $ActivePrivacy=1; # active hide cli

           }

...

if (defined $route_info{'cli'}) { @clis[$numroutes]=$route_info{'cli'};}

            elsif($ActivePrivacy) {@clis[$numroutes]=$username;} # only one route

...

$AGI->set_variable('ActivePrivacy', $ActivePrivacy); # asterisk flag

...

extensions.conf (asterisk)

 

Afin de gérer * dans l’extension d’asterisk on a remplacé _X. par _[*0-9]! [http://www.voip-info.org/wiki/index.php?page=Asterisk+Dialplan+Patterns]

Dans le contexte de routage [routing] on ajouté :

 

[routing]

exten => _[*0-9]!,1,NoOp()

exten => _[*0-9]!,n,ExecIf($[ "${CALLERID(name)}" = "Anonymous" | "${CALLERID(name)}" = "anonymous"],Set,ActivePrivacy=1)

exten => _[*0-9]!,n(loop),NoOp()

exten => _[*0-9]!,n,GotoIf($[ ${II} = 1 ]?SingleRoute)

exten => _[*0-9]!,n,Playback(the-next,noanswer)

exten => _[*0-9]!,n(SingleRoute),Set(KK=0)

exten => _[*0-9]!,n,Set(SUM_ROUTE=${XSUM_${II}})

exten => _[*0-9]!,n(loop1),NoOp()

exten => _[*0-9]!,n,Set(TARGET_ROUTE=${XROUTE_${II}_${KK}})

exten => _[*0-9]!,n,Set(TARGET_EXPIRE=${XEXP_${II}_${KK}})

exten => _[*0-9]!,n,Set(TARGET_CLI=${XCLI_${II}_${KK}})

exten => _[*0-9]!,n,Set(CALLERID(all)=${TARGET_CLI} <${TARGET_CLI}>)

exten => _[*0-9]!,n,Set(MYDNID=${CUT(TARGET_ROUTE,@,1)})

exten => _[*0-9]!,n,Set(VDNID=${CUT(MYDNID,/,2)})

exten => _[*0-9]!,n,Set(ROUTEIP=${CUT(TARGET_ROUTE,@,2)})

exten => _[*0-9]!,n,GotoIf($[ "${ActivePrivacy}" != "1" ]?noprivacy)

exten => _[*0-9]!,n,GotoIf($[  "${ROUTEIP}" != "${NAS_IP_Address}" ]?extprivacy)

exten => _[*0-9]!,n,SetCallerPres(prohib_not_screened)

exten => _[*0-9]!,n,Goto(noprivacy)

exten => _[*0-9]!,n(extprivacy),NoOp()

exten => _[*0-9]!,n,SIPAddHeader(Remote-Party-ID:"${CALLERID(num)}" <sip:${CALLERID(num)}@${NAS_IP_Address}>\;privacy=full\;screen=yes)

exten => _[*0-9]!,n(noprivacy),NoOp()

exten => _[*0-9]!,n,Dial(${IF($[ ${CUT(TARGET_ROUTE,@,2)} = ${NAS_IP_Address}]?${MYDNID}:${TARGET_ROUTE})},${TARGET_EXPIRE})

exten => _[*0-9]!,n,Set(CDR(Hangupcause)=Hangupcause:${HANGUPCAUSE})

exten => _[*0-9]!,n,Set(KK=$[${KK}+1])

exten => _[*0-9]!,n,GotoIf($[ "${DIALSTATUS}" = "BUSY" | "${DIALSTATUS}" = "NOANSWER" | "${DIALSTATUS}" = "CANCEL" ]?end1)

exten => _[*0-9]!,n,GotoIf($[${KK} < ${SUM_ROUTE} ]?loop1:end1)

exten => _[*0-9]!,n(end1),NoOp()

exten => _[*0-9]!,n,Set(II=$[${II}+1])

exten => _[*0-9]!,n,GotoIf($[${II} <= ${XTOT} ]?loop:end)

exten => _[*0-9]!,n(end),NoOp()

exten => _[*0-9]!,n,Goto(Error-Info,${EXTEN},1)

 

Cette dernière ajoute le header Remote-Party-ID précisant que le CLI doit être masqué (privacy=full;screen=yes).[ http://www.cisco.com/en/US/docs/ios/12_2t/12_2t13/feature/guide/ftsipext.html]

Validation

http://switzernet.com/3/public/110601-astradV7-validation/

Choix du Vertical Service Code pour activer le masquage du numéro

On ne peut pas choisir un préfixe qui contient le caractère « # » (http://www.voip-info.org/wiki/view/Hash) à cause de la mauvaise interprétation de ce code ; avec Lynksys (il est configuré avec ces propres VSC) et Siemens (qui remplace ‘#’ par ‘%23’)

INVITE sip:31%23076704XXXX@astrad.switzernet.com;user=phone SIP/2.0.

 

Swisscom utilise le code *31 pour l’activation de la suppression de l'identification par appel [Swisscom Switzernet]

Les opérateurs téléphoniques mobile (Orange…) utilisent le code #31# [Orange Switzernet]

 

Dans la configuration par défaut de CISCO Linksys, les codes (préfixe) utilisés sont les suivantes:

 

Masquage par appel

La configuration (Account et non Customer) dans le Billing est la suivante :

 

Décrocher le combiné > Appuyer sur * > Introduire le code 81 et composer le numéro souhaité.

Notez que certaines personnes ne répondent pas aux appels dont le numéro est masqué.

Lors des appels aux services d'urgences (112, 117, 118, 144 etc.) le numéro de téléphone n'est pas masqué.

Chez certains opérateurs téléphoniques étrangers, il peut arriver qu'un numéro de téléphone masqué soit tout de même affiché lors d'appels vers l'étranger.

Masquage en permanence

Cette option n’est pas encore complètement implémentée, la procédure dépend du type d’appareille du client.

CISCO Linksys

Pour un masquage permanent il faut appeler en ajoutant *67, après cette appel le masquage est activé et il n’est plus nécessaire d’introduire un préfixe.

Pour désactiver ce masquage il faut appeler avec *68.

Si le masquage est activé et que le client souhaite passé un appel en affichant son numéro il faut ajouté le préfixe *82.

Siemens Gigaset

Pour un masquage permanent il mettre le mot clé Anonymous  dans le champ ‘Display name’.

Pour désactiver cette option il faut remettre ce champ à vide.

Grandstream

Idem que Siemens, mettre le mot clé Anonymous  dans le champ ‘Name’. 

X-Lite

Idem que Siemens, mettre le mot clé Anonymous  dans le champ ‘Display Name’. 

Référence

Liste des fonctionnalités à ajouter dans Astrad

http://switzernet.com/3/public/110523-astrad-wish-list/

 

Astrad Versionning

http://switzernet.com/3/public/110126-astrad-versions/

 

Telephone Star * Codes

http://www.jdbsound.com/work/starcodes.html

 

Vertical service code

http://en.wikipedia.org/wiki/Vertical_service_code

 

Various countries for Number Display Blocking and Unblocking:

http://en.wikipedia.org/wiki/Caller_ID

 

NANPA version of VSC

http://www.nanpa.com/number_resource_info/vertical_service.html

 

Switzernet Guides de configuration VoIP

http://switzernet.com/public/070723-config_UA/

 

Caller ID in SIP and Asterisk

http://kb.smartvox.co.uk/index.php/asterisk/how-it-works/caller-id-in-sip-and-asterisk-part-1/

 

P-Asserted-Identity and Remote-Party-ID header

http://www.voip-info.org/wiki/view/P-Asserted-Identity+and+Remote-Party-ID+header

 

Asterisk SIP trustrpid

http://www.voip-info.org/wiki/view/Asterisk+SIP+trustrpid

 

Asterisk sip sendrpid

http://www.voip-info.org/wiki/view/Asterisk+sip+sendrpid

 

Sip header manipulation examples (privacy headers)

http://www.voip-info.org/tiki-index.php?page=Asterisk%20config%20extensions.conf#Sipheadermanipulationexamples