[help] How to using different tcp port to register server.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all:
I am using version 1.4 to implement my application.
I set two accounts and use "tcp" connection to register a sip server.
The pjsip always to use one tcp port to connect to sip server for any account.
My question is:
If I set account 1(#7219) is equal to account 2(#7219), and register to sip server.
The other phone make a call to (#7219), my pc will recevie two INVITE request.
Because the pjsua_acc_find_for_incoming() use "To" header to judge this request is for which account.
Those two INVITE request almost the same, the pjsip always return account 1 in pjsua_acc_find_for_incoming() funtion.
So I want those two accounts that have its tcp connection port and uses its tcp port to register sip server.
Then I can using the incoming port to judge the INVITE request is for which account roughly.

In pjsip, it just can create tcp port for listen, not for client to connect server.
and the pjsua_transport_create() function can not call twice for TCP, it will return error.
The transportid is no meaning for tcp connection.
================================================================
cfg.port = 5060;
static pjsua_transport_id g_acc_tcp_transport_id;
/* It just create the tcp 5060 for listen, not for connect port to sever
?? and the function can not call twice for TCP, it will return error (factory already exist).
?*/
pjsua_transport_create(PJSIP_TRANSPORT_TCP, &cfg, &g_acc_tcp_transport_id);
=================================================================
Account 1 send REGISTER request to server by tcp connection, and it will
use pjsip_endpt_acquire_transport() function to get the tcp port 2048 to connect sip server.
Next, account 2 send REGISET request to server by tcp connection, 
and it will get the same tcp port 2048 from pjsip_endpt_acquire_transport()..
If I want those two accounts that have its tcp connection port and uses its tcp port to register sip server, make a call, etc.
Ex:
account 1: ato_1??? tcp(tcp: 2048)
account 2: ato_2??? tcp(tcp: 2049)
Is it possible to do such change in pjsip, and where or how do i do for this change?
================================================================
Besr Regards
DaCheng

___________________________________________________ 
 ??????? ? ???????????????? 
 http://messenger.yahoo.com.tw/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20091128/26dc9db0/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux