Quantcast
Channel: General Help - FreePBX Community Forums
Viewing all articles
Browse latest Browse all 12660

Macro-dialout-trunk-predial-hook and PJSIP

$
0
0

@morpix wrote:

Hi guys,

I need a specific Contact Header to be sent with every INVITE using PJsip. The problem I have is that the "Contact User" field pjsip has, only gets used for the registration and not INVITEs.

The Contact header I need is:

<sip:71234567;tgrp=71234567;trunkcontext=realm.co.nz@192.168.252.10:5060;transport=udp>

Here's what I added to extensions_override_freepbx.conf:

[macro-dialout-trunk-predial-hook]
exten => s,1,NoOp(Updating Contact Header)
exten => s,n,Set(PJSIP_HEADER(update,Contact)=<sip:71234567\;tgrp=71234567\;trunkcontext=realm.co.nz@192.168.252.10:5060\;transport=udp>)
exten => s,n(done),MacroExit()

I'm using the PJSIP_HEADER function documented here: https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Function_PJSIP_HEADER
The backslashes are to deal with the asterisk config parser to include the semi-colons.

The result is the following:

    -- Executing [s@macro-dialout-trunk-predial-hook:1] NoOp("Local/023456789@from-internal-00000022;2", "Updating Contact Header") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:2] Set("Local/023456789@from-internal-00000022;2", "PJSIP_HEADER(update,Contact)=<sip:71234567;tgrp=71234567;trunkcontext=realm.co.nz@192.168.252.10:5060;transport=udp>") in new stack
[2015-10-14 12:48:56] ERROR[13169][C-00000013]: res_pjsip_header_funcs.c:515 func_write_header: This function requires a PJSIP channel.

So, it looks like it's trying, but it's not finding a PJSIP channel. Is there something else I need to reference? I figured it would create the channel before it gets to this point in the FPBX dial-plan?

Thanks again for any help.

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 12660

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>