Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asterisk PJSIP Support in Adhearsion Core #648

Open
sfgeorge opened this issue Nov 25, 2019 · 1 comment
Open

Asterisk PJSIP Support in Adhearsion Core #648

sfgeorge opened this issue Nov 25, 2019 · 1 comment

Comments

@sfgeorge
Copy link
Member

sfgeorge commented Nov 25, 2019

Summary

Asterisk's chan_sip SIP driver is deprecated in favor of chan_pjsip. Adhearsion should be updated to support both drivers.

In an ideal world, Adhearsion could automatically detect which driver incoming calls are based on (based on agi_type: "SIP" or "PJSIP"). But outbound calls at minimum, we're going to need to introduce a configuration option to allow one to choose between the two.

While Asterisk allows a mixed-mode in which it can handle some calls on chan_sip with other calls on chan_pjsip at the same time – I propose that we do not support co-operating sip/pjsip modes in Adhearsion for the sake of API simplicity. Rather, I suggest a single global sip/pjsip option in Adhearsion Configuration.

What Needs to Change

I've spotted only a few places that need to change to be able to support PJSIP.

Related Docs

@sfgeorge
Copy link
Member Author

There's a slight chance we may be able to avoid adding a new configuration value, even when originating brand-new calls. We'd have to dynamically inject a special [context] into the asterisk dialplan for injecting the SIP headers at the last minute, at which point we could examine ${TECH} to see if it is "SIP" or "PJSIP".

This would mimic an approach that FreePBX has taken:

  1. SIP header(s) are added to a ${SIPHEADERS} channel variable (Hash) as needed.
    https://github.com/FreePBX/core/blob/release/15.0/Dialplan/dialparties.php#L953
  2. They've dynamically injected a [func-apply-sipheaders] context (a Gosub) into the dialplan which adds the headers for the appropriate channel driver depending on whether ${TECH} is "SIP" or "PJSIP".
  3. When invoking Dial(), they include b(func-apply-sipheaders^s^1) in order to invoke that Gosub on the newly created channel and apply the SIP headers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant