Re: PJSUA2 - How to get AccountConfig from Account?

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

 



Hi Carsten!

Thanks for sharing the info. I guess I will have to do the same on my end. I am surprised to find out it is already not part of PJSUA2.

Zarko

On Jun 6, 2016 5:30 PM, "Carsten (Tropby)" <Tropby@xxxxxxxxxxxxxxxxx> wrote:

Hello Zarko,

I have found a solution for me for that case.

For me I have overwritten the create and modify method from Account so I can store AccountConifg in my  VOIPAccount.

 

 

class VOIPAccount : public pj::Account
{
public:
    explicit VOIPAccount();
 
    virtual void onRegState(pj::OnRegStateParam &prm);
    virtual void onRegStarted(pj::OnRegStartedParam &prm);
    virtual void onIncomingCall(pj::OnIncomingCallParam &iprm);
 
    void create(const pj::AccountConfig &cfg,
                bool make_default=false);
};

 

void VOIPAccount::create(const pj::AccountConfig &cfg, bool make_default)

{

    printf( "Account CREATED!!!\n" );

 

    // Do some stuff with AccountConfig

 

    pj::Account::create( cfg, make_default );

}

 

 

 

Maybe you can do it too? Or someone knows a better solution for that :D

 

Kind Regards,

Carsten

 

 

Von: pjsip [mailto:pjsip-bounces@xxxxxxxxxxxxxxx] Im Auftrag von Zarko Coklin
Gesendet: Montag, 6. Juni 2016 23:10
An: pjsip@xxxxxxxxxxxxxxx
Betreff: [pjsip] PJSUA2 - How to get AccountConfig from Account?

 

Hi all!

 

AccountConfig is used to create an Account in PJSIP. I expected if I have a pointer to Account it would be easy to retrieve AccountConfig using PJSUA2 API. However, that does not seem to be the case. Am I missing something?

 

For example, if the account is already created and I have to change Proxy Server address, users of PJSUA2 are forced to go through Account::modify method which requires a whole AccountConfig structure to be passed in. Would it not be better to be able to get a reference of the AccountConfig structure used to create an account, change parameter here and there, invoke Account::modify and be done?

 

Regards,

Zarko


Virenfrei. www.avast.com
_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[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