# Calling 2 PJSIP channels with different options

**URL:** <https://community.asterisk.org/t/calling-2-pjsip-channels-with-different-options/96590>\
**Category:** Asterisk SIP\
**Created:** [April 18, 2023, 1:38pm UTC](https://community.asterisk.org/t/calling-2-pjsip-channels-with-different-options/96590 "2023-04-18T13:38:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stratoss](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@stratoss](https://community.asterisk.org/u/stratoss)\
**Post date:** [April 18, 2023, 1:38pm UTC](https://community.asterisk.org/t/calling-2-pjsip-channels-with-different-options/96590/1 "2023-04-18T13:38:33Z")

</div>

Hi,

I’m migrating an old chan\_sip dialplan to a chan\_pjsip one and ran into issue. The current PBX dials like Dial(SIP/some.local.account&Local/101@external\_with\_variables), where the local channel sets couple of headers plus the CALLERID(num) before dialing the trunk.

With chan\_pjsip this scenario doesn’t work as the PJSIP\_HEADER function, which is required to set some trunk-specific headers, is not working on the Local channel as it requires a PJSIP one.

The end goal is to preserve the caller number for the softphone client and manipulate it just before dialing the trunk. Is it possible with chan\_pjsip?

---

<div class="post-metadata">

**Author:** ![david551](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@david551](https://community.asterisk.org/u/david551)\
**Post date:** [April 18, 2023, 1:43pm UTC](https://community.asterisk.org/t/calling-2-pjsip-channels-with-different-options/96590/2 "2023-04-18T13:43:25Z")

</div>

The local channel needs to call the Dial for the chan\_pjsip endpoint using a pre-dial handler subroutine.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [May 18, 2023, 1:44pm UTC](https://community.asterisk.org/t/calling-2-pjsip-channels-with-different-options/96590/3 "2023-05-18T13:44:20Z")

</div>

Closed on May 18, 2023, 1:44pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
