spandsp 0.0.6
t35.c File Reference
#include <inttypes.h>
#include <ctype.h>
#include <string.h>
#include "spandsp/telephony.h"
#include "spandsp/bit_operations.h"
#include "spandsp/t35.h"

Classes

struct  model_data_t
 
struct  nsf_data_t
 
struct  country_code_t
 

Functions

int t35_real_country_code (int country_code, int country_code_extension)
 Resolve a T.35 country code with bit reversal resolution. More...
 
const char * t35_real_country_code_to_str (int country_code, int country_code_extension)
 Decode a T.35 country code to a country name, with bit reversal resolution. More...
 
const char * t35_country_code_to_str (int country_code, int country_code_extension)
 Decode a T.35 country code to a country name. More...
 
const char * t35_vendor_to_str (const uint8_t *msg, int len)
 
int t35_decode (const uint8_t *msg, int len, const char **country, const char **vendor, const char **model)
 Decode an NSF field. More...
 

Function Documentation

◆ t35_country_code_to_str()

const char * t35_country_code_to_str ( int  country_code,
int  country_code_extension 
)

Decode a T.35 country code to a country name.

Decode a T.35 country code to a country name.

Parameters
country_codeThe country code.
country_code_extensionThe country code extension.
Returns
The country name, or NULL for an invalid country code.

◆ t35_decode()

int t35_decode ( const uint8_t *  msg,
int  len,
const char **  country,
const char **  vendor,
const char **  model 
)

Decode an NSF field.

Decode an NSF field to try to determine the make and model of the remote machine.

Parameters
msgThe NSF message.
lenThe length of the NSF message.
countryA pointer which will be pointed to the identified country of origin. If a NULL pointer is given, the country of origin will not be returned. If the country of origin is not identified, NULL will be returned.
vendorA pointer which will be pointed to the identified vendor. If a NULL pointer is given, the vendor ID will not be returned. If the vendor is not identified, NULL will be returned.
modelA pointer which will be pointed to the identified model. If a NULL pointer is given, the model will not be returned. If the model is not identified, NULL will be returned.
Returns
TRUE if the machine was identified, otherwise FALSE.

◆ t35_real_country_code()

int t35_real_country_code ( int  country_code,
int  country_code_extension 
)

Resolve a T.35 country code with bit reversal resolution.

Resolve a T.35 country code its probable likely real value, using heuristics to try to resolve issues of broken bit order in the country code.

Parameters
country_codeThe country code.
country_code_extensionThe country code extension.
Returns
The true country code, or -1 for an invalid code.

Referenced by t35_real_country_code_to_str().

◆ t35_real_country_code_to_str()

const char * t35_real_country_code_to_str ( int  country_code,
int  country_code_extension 
)

Decode a T.35 country code to a country name, with bit reversal resolution.

Decode a T.35 country code to a country name, using heuristics to try to resolve issues of broken bit order in the country code.

Parameters
country_codeThe country code.
country_code_extensionThe country code extension.
Returns
The country name, or NULL for an invalid country code.

References t35_real_country_code().