C# Класс SIPSorcery.SIP.App.SIPProviderMagicJack

Tweaks the nonce on requests for provider MagicJack.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
logger log4net.ILog

Открытые методы

Метод Описание
GetAuthenticationHeader ( SIPResponse authReqdResponse ) : SIPAuthenticationHeader

MagicJack apply a custom algorithm when calculating their nonce seemingly in order to prevent other SIP UAs from being able to authenticate. This method attempts to apply the same algorithm to allow the authenticated requests from this stack.

MJ is modifying the nonce dynamically. They append an underscore, then 8 characters to the nonce before computing the MD5. The 8 characters come from the call id. Use the first 8 bytes of the nonce as an index into your call id. Assume your callid is: callid: 9876ABC56738DD43... index: 0123456789ABCDEF and your nonce is: 8765abc4_32190 Take the first digit of your nonce (which in our example is 8 ), and find the value in the callid at index 8, which is 6. So, append that to the nonce. 8765abc4_32190_6 Then move on to the second digit of the nonce, which is 7 in our example. Find the value at index 7 in the callid, which is 5, and append that: 8765abc4_32190_65 continue until you have done 8 digits. Your new nonce would be: 8765abc4_32190_65CB38DA Use this value when computing the MD5, but pass the original nonce to magicJack.

IsMagicJackRequest ( SIPResponse sipResponse ) : bool

Приватные методы

Метод Описание
GetNonce ( string origNonce, string callId ) : string

Описание методов

GetAuthenticationHeader() публичный статический Метод

MagicJack apply a custom algorithm when calculating their nonce seemingly in order to prevent other SIP UAs from being able to authenticate. This method attempts to apply the same algorithm to allow the authenticated requests from this stack.
MJ is modifying the nonce dynamically. They append an underscore, then 8 characters to the nonce before computing the MD5. The 8 characters come from the call id. Use the first 8 bytes of the nonce as an index into your call id. Assume your callid is: callid: 9876ABC56738DD43... index: 0123456789ABCDEF and your nonce is: 8765abc4_32190 Take the first digit of your nonce (which in our example is 8 ), and find the value in the callid at index 8, which is 6. So, append that to the nonce. 8765abc4_32190_6 Then move on to the second digit of the nonce, which is 7 in our example. Find the value at index 7 in the callid, which is 5, and append that: 8765abc4_32190_65 continue until you have done 8 digits. Your new nonce would be: 8765abc4_32190_65CB38DA Use this value when computing the MD5, but pass the original nonce to magicJack.
public static GetAuthenticationHeader ( SIPResponse authReqdResponse ) : SIPAuthenticationHeader
authReqdResponse SIPSorcery.SIP.SIPResponse
Результат SIPSorcery.SIP.SIPAuthenticationHeader

IsMagicJackRequest() публичный статический Метод

public static IsMagicJackRequest ( SIPResponse sipResponse ) : bool
sipResponse SIPSorcery.SIP.SIPResponse
Результат bool

Описание свойств

logger публичное статическое свойство

public static ILog,log4net logger
Результат log4net.ILog