Network transit and peer qualification 
Transit delay on the IP network is a real issue when pushing voice communication on top of it, it really affects quality and comfort of users. We generally consider that a delay above 150 ms becomes sensible to human ear and above 400 ms is considered painful1 and forces users to apply delays before starting a new sentence. With Asterisk, it is possible to verify if the round-trip delay is compatible with the service quality we would like to achieve on our telephony over IP network: it is called qualification.
For each SIP peer (or IAX), it is possible to activate the delay validation with the qualify= parameter. This one can be set either in the [general] section or at each peer level. Possible values are off or on respectively disabling or enabling the active delay control. When activated, the transit delay is checked on a regular basis and limit is set to 2 seconds.
This value of 2s is, in my opinion, too high when talking of telephony quality, it is important to adjust this value to something more accurate with the quality expected. To change the maximum value, we replace the on or off value by a number expressed in millisecond. This value is checked versus round trip time between the Asterisk and the peer.
The way it works is simple: one registered, each peer will be sent a SIP INFO (or IAX equivalent) frame if qualification is activated. The peer will answer to this method is order to provide Asterisk with the list of supported methods. This is not the main objective of the INFO method, but can replace the non existent HELLO method. By analysing the answer and the delay to get it, Asterisk can check the network round trip time and if this one exceed the limit temporarily suspend any new call to this peer.
This INFO frame is sent every 60 seconds if the peer is reachable and delay is correct, every 10 seconds otherwise. These values are pre-defined in SIP but modifiable in IAX.
In order to know the last value checked for peers, we can use the following commands on the console:
sip show peers
or
iax2 show peers
The last column shows the status and the round trip delay in millisecond. When the value is correct OK is shown, when the delay exceed the limit LAGGED is shown and no call will be passed to this peer until the status changes back. On our DMZ Asterisk we can see:
asterisk-dmz*CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
wengo/achauvinhameau 213.91.9.206 N 5060 OK (72 ms)
kiwak_outbound/achauvin 213.246.39.74 N 5060 OK (76 ms)
callcentric/17772435589 204.11.192.23 N 5060 OK (156 ms)
proxy01.sipphone.com/acha 198.65.166.131 N 5060 OK (231 ms)
4 sip peers [Monitored: 4 online, 0 offline Unmonitored: 0 online, 0 offline]
Centrex based in France are closer to the one in the North America, but delays are under the limit we set.
We can use this feature to limit call forwarding to peers too far from a delay perspective, for example when using various voice provider, we can choose the best one at the call routing time. We can also use it to suspend a home worker and push the call to his voicemail rather than having a low quality call that can affect customer perception.
- remember satellite calls [↩]
|
Posted by: Alexandre Chauvin-Hameau, on 06/14/2007 Trackback | Popularity: 11% tagged 1.4, asterisk, centrex, QoS, SIP and sip.conf |
|






Any chance that there might be some follow-up on that paragraph?
on 07/20/2007 at 00:11I meant on the last paragraph relating to feature…
In fact, you can directly manage the timeout due to transit delay in the Dial() application command. Once a peer is too far away (from a delay perspective) the Dial will return directly.
on 07/22/2007 at 09:40So you just have to configure the sip.conf part with an appropriate delay and Dial will fail, next action in the dial plan will be executed directly.