📜 ⬆️ ⬇️

Configuring a SIP-I / SIP-T Trunk with Yate

image

Good afternoon, colleagues.

I’m not good at expressing my thoughts in writing (and Russian, which is not my native language), but I’ll try to describe my method of setting this type of trunk.
')
It so happened that our local telecom started giving access to PSTN to other VoIP providers only through the SIP-I protocol. Those who managed to connect via E1 / SS7 were lucky (or maybe not), but the new one has to somehow get out: some buy expensive softswitches, others are looking for cheaper options, or even for free. We went the second way. If you are interested in how it all ended, welcome under cat.



Introduction



SIP-I and SIP-T relate to two very similar technologies for interconnecting ISUP and SIP networks. In particular, they provide methods for transporting specific ISUP parameters through a SIP-based network, so calls initiated and terminated in ISUP networks can easily pass through the SIP network without losing information.

SIP-T was developed by the IETF - the same office that was developed by SIP itself. Around the same time, the latest version of SIP was developed (mid-2002). This protocol is described in RFC 3372, RFC 3398, RFC 3578, and RFC 3204.

SIP-I was developed by guys from ITU in 2004 and uses most of the constructions defined in SIP-T. It is described in ITU-T Q.1912.5.

Both protocols describe methods for mapping messages, parameters, and error codes between SIP and ISUP. They are also fully compatible with a conventional SIP-based network.

SIP-I differs from SIP-T in that it uses many standards and IETF drafts, and it is much richer in the parameters that it allows to transmit. SIP-I contains not only the basic parameters of the call, but also allows you to use the parameters of additional services, such as CLIP and CLIR.

Currently, in the SoftSwitch communication options - SoftSwitch, SIP-T is more common. For example, in CDMA2000, it is used for interworking between MSCs. SIP-I is considered as an option for interworking between SoftSwitch and conventional networks in 3GPP.

In order not to burden you with dry theory, I’ll show you how to dump such a call in WireShark:



As you can see, the “application / isup” section was added to the Message Body where all the ISUP fields were encapsulated.

Customization



In general, there is very little information on setting up these protocols on the Internet, and you will not find real examples during the day with fire. We pretty thoroughly approached this case and stumbled upon Yate .

Yate is positioning itself as a new generation phone engine. It is difficult to somehow single out the class, as he can do everything. It was written by Romanian programmers from the Null Team. On Habré there are several articles about him, but there it is used in other solutions.

Pros:
1. Written in C ++.
2. Modular structure.
3. There are modules for all occasions.
4. Allows you to write the configuration in different programming languages: php, perl, python, javascript.

Minuses:
1. Very little documentation. For example, I had to completely read the source code in order to fully understand the principles of its work. By the way, people complain about this in the mailing list, but as one wise person said: “Yate has documentation, and it is very good, just written in C ++.”

I will not describe the installation process and the initial setup. They can be found on the project website and in Habré . I will describe only the main points so that our softswitch will begin to understand SIP-I / SIP-T.

And so that Yate can encode and decode the fields from “application / isup”, you must enable the following parameter in the ysipchan.conf file:

[sip-t] isup=enable 


After that, when an incoming call from the telecom comes up, standard isate messages will display the isup fields as in the example below. We can already use these fields for routing and billing.

 Sniffed 'call.preroute' time=1350892372.716302 thread=0x7f017c011600 'Call Router' data=(nil) retval='(null)' param['id'] = 'sip/4' param['module'] = 'sip' param['status'] = 'incoming' param['address'] = '172.xxx.xxx.xxx:5060' param['billid'] = '1350892357-3' param['answered'] = 'false' param['callid'] = 'sip/SBCxdl85tuup8zxylqx8xbcdp5pcvtbtpw8@SoftX3000/zxzlwuzt-CC-23/' param['message-prefix'] = 'isup.' param['isup.protocol-type'] = 'itu-t92+' param['isup.protocol-type'] = 'itu-t' param['isup.message-type'] = 'IAM' param['isup.NatureOfConnectionIndicators'] = '0sat,cont-check-none,echodev' param['isup.ForwardCallIndicators'] = 'national,e2e-none,interworking,isup-notreq,sccp-none' param['isup.CallingPartyCategory'] = 'ordinary' param['isup.TransmissionMediumRequirement'] = '3.1khz-audio' param['isup.CalledPartyNumber'] = 'xxxxxxxxx' param['isup.CalledPartyNumber.nature'] = 'subscriber' param['isup.CalledPartyNumber.plan'] = 'isdn' param['isup.CalledPartyNumber.inn'] = 'false' param['isup.OptionalForwardCallIndicators'] = 'non-CUG' param['isup.CallingPartyNumber'] = 'xxxxxxxxx' param['isup.CallingPartyNumber.nature'] = 'national' param['isup.CallingPartyNumber.plan'] = 'isdn' param['isup.CallingPartyNumber.complete'] = 'true' param['isup.CallingPartyNumber.restrict'] = 'allowed' param['isup.CallingPartyNumber.screened'] = 'network-provided' param['isup.PropagationDelayCounter'] = '0' param['isup.LocationNumber'] = '' param['isup.LocationNumber.nature'] = '0' param['isup.LocationNumber.plan'] = 'unknown' param['isup.LocationNumber.inn'] = 'true' param['isup.LocationNumber.restrict'] = 'unavailable' param['isup.LocationNumber.screened'] = 'network-provided' param['isup.ParameterCompatInformation.PropagationDelayCounter'] = 'transit,cnf,discard-param,nopass-param' param['isup.ParameterCompatInformation.EchoControlInformation'] = 'transit,nopass-param' param['isup.ParameterCompatInformation'] = '31 d4 37 c0' param['isup.parameters-unhandled-cnf'] = 'PropagationDelayCounter' param['caller'] = 'xxxxxxxxx' param['called'] = 'xxxxxxxxx' param['ip_transport'] = 'UDP' param['newcall'] = 'true' param['domain'] = '172.xxx.xxx.xxx' param['device'] = 'Huawei SoftX3000 V300R010' param['username'] = '' param['xsip_nonce_age'] = '0' param['antiloop'] = '19' param['ip_host'] = '172.xxx.xxx.xxx' param['ip_port'] = '5060' param['ip_transport'] = 'UDP' param['sip_uri'] = 'sip:xxxxxxxxx@172.xxx.xxx.xxx:5060;user=phone' param['sip_from'] = 'sip:xxxxxxxxx@172.xxx.xxx.xxx;user=phone' param['sip_to'] = '<sip:xxxxxxxxx@172.xxx.xxx.xxx;user=phone>' param['sip_callid'] = 'SBCxdl85tuup8zxylqx8xbcdp5pcvtbtpw8@SoftX3000' param['device'] = 'Huawei SoftX3000 V300R010' param['sip_allow'] = 'INVITE,ACK,OPTIONS,BYE,CANCEL,REGISTER,INFO,PRACK,SUBSCRIBE,NOTIFY,UPDATE,MESSAGE,REFER' param['sip_supported'] = '100rel' param['sip_user-agent'] = 'Huawei SoftX3000 V300R010' param['sip_privacy'] = 'none' param['sip_p-charging-vector'] = 'icid-value=0a.0a.00.0a-2012102210555100;orig-ioi=www.huawei.com;icid-generated-at=172.xxx.xxx.xxx' param['sip_p-asserted-identity'] = '<sip:xxxxxxxxx@172.xxx.xxx.xxx;user=phone>' param['sip_contact'] = '<sip:xxxxxxxxx@172.xxx.xxx.xxx:5060;user=phone>' param['sip_content-type'] = 'multipart/mixed;boundary=ssboundary-1_' param['rtp_addr'] = '172.xxx.xxx.xxx' param['media'] = 'yes' param['formats'] = 'alaw,mulaw' param['transport'] = 'RTP/AVP' param['rtp_rfc2833'] = 'false' param['rtp_port'] = '40016' param['rtp_forward'] = 'possible' 


The outgoing call from us looks like this (regexroute.conf):

 ;     preroute [PSTN] ;         . .*=;osip_P-Asserted-Identity=<sip:${caller}@172.xxx.xxx.xxx:5060$()user=phone>;\ message-prefix=isup.;\ isup.message-type=IAM;\ isup.protocol-type=itu-t92+;\ isup.NatureOfConnectionIndicators=echodev;\ isup.CallingPartyCategory=ordinary;\ isup.ForwardCallIndicators=national,e2e-none,interworking,isup-notreq,sccp-none;\ isup.TransmissionMediumRequirement=3.1khz-audio;\ isup.CalledPartyNumber=${called};\ isup.CalledPartyNumber.nature=national;\ isup.CalledPartyNumber.plan=isdn;\ isup.CalledPartyNumber.inn=false;\ isup.CallingPartyNumber=${caller};\ isup.CallingPartyNumber.nature=national;\ isup.CallingPartyNumber.plan=isdn;\ isup.CallingPartyNumber.complete=true;\ isup.CallingPartyNumber.restrict=allowed;\ isup.CallingPartyNumber.screened=network-provided ;    .*=sip/sip:${called}@172.xxx.xxx.xxx 


That's all. Now all SIP invites from us come with ISUP fields in the Message Body.

If a respected community has questions I will be glad to answer. We at Yate ate the dog and were able to sort out many of the nuances.

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


All Articles