How to use different auto-answer codes for each account

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

 



I am new to pjsip and am on a really steep learning curve.

 

My test infrastructure is set up with the following basic configuration:

                FusionPBX installed on a VM

                pjsip/pjsua installed on a FriendlyARM NanoPi NEO Core

                a Cisco SPA509G handset

 

I have configured 2 accounts into the pjsua application via a config file:

 

--id sip:4690@fusionpbx.mydomain

--registrar sip:fusionpbx.mydomain

--realm fusionpbx.mydomain

--username 4690

--password xxxxxxxx

 

--next-account

 

--id sip:4691@fusionpbx.mydomain

--registrar sip:fusionpbx.mydomain

--realm fusionpbx.mydomain

--username 4691

--password xxxxxxxx

 

--auto-answer 180

--playback-dev 22

--log-level 6

--app-log-level 6

 

(The 'mydomain' and passwords have been changed from the real thing for privacy reasons)

I have logging fully turned on in order to trace the execution profile of the code.

 

I can make calls from the Cisco handset and they are answered ok, on both 4690 and 4691 on the NanoPi NEO.

The problem I have is that the --auto-answer code is applied to all accounts in a global fashion.

I would like to have different auto-answer codes depending on which account is being called.

Account 4690 should ring as per a normal phone call (code 180) while account 4691 should answer the call so that the system can be used in PA mode.

 

I can easily modify the code to have different answer codes embedded within the pjsua_app_config->pjsua_acc_config structs.

The real problem I have is in identifying the target account for the incoming call in the 'on_incoming_call' function so that I can use the desired answer code in the 'pjsua_call_answer2' function.

 

ie. If the incoming call is to account 4690 then apply answer code 180 (ie. ring normally)

    If the incoming call is to account 4691 then apply answer code 200 (ie. pick up call and use audion in PA mode)

 

I would greatly appreciate any tips that could help me resolve this issue.

 

Regards,

 

Gerry Cohn

Director/Engineer

ManIT Logo

 

_______________________________________________
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