Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of the local accounts in PJSIP?

Tags:

ios

account

pjsip

I found there are two local accounts with id 0 (IPv4 address) and id 1 (IPv6 address). So when I register, that user account is registered with id 2. I wonder what the purpose of those local accounts is. Before I register, user id 1 is used as a default account.

In PJSIP they have mentioned this as:

At least one account MUST be created in the application, since any outgoing requests require an account context. If no user association is required, the application can create a userless account by calling Account.create(). A userless account identifies a local endpoint instead of a particular user, and it corresponds to a particular transport ID.

Also one account must be set as the default account, which will be used as the account identity when pjsua fails to match an incoming request with any accounts using the stricter matching rules.

When the application terminates, account id 0 account is deleted, and id 2 (our registered account) is deleted. What is the purpose of matching incoming calls with a userless account? Why is account id 1 not deleted? How does PJSIP match requests to a userless account? I am confused about this concept. Any clue will be helpful to me. Thanks in advance.

like image 279
Amutha Priya Avatar asked Jul 08 '20 05:07

Amutha Priya


People also ask

What is Pjsip?

PJSIP is a free and open source multimedia communication library written in C language implementing standard based protocols such as SIP, SDP, RTP, STUN, TURN, and ICE.

What is Pjsua?

pjsua is an open source command line SIP user agent (softphone) that is used as the reference implementation for PJSIP, PJNATH, and PJMEDIA.


1 Answers

SIP protocol allows direct calls to specified IP. If you want to allow your application to handle calls directed to your device IP addresses, then you use local accounts. In such case, SIP URI for IPv4 can look like this: sip:192.168.1.100 (instead of sip:someuser@somelocation) and you don't need to register any user nowhere, to handle calls directed to this URI.

like image 146
DaszuOne Avatar answered Dec 21 '22 06:12

DaszuOne