Custom Sip Headers

VitalPBX Community Support General Discussion Custom Sip Headers

  • Post
    hlev
    Participant

    What would be the best way to send out a custom sip header when using certain trunks or outbound routes? Currently, trying to  setup  the X-Tenant sip header due to our trunk provider requiring that to tell apart different tenants coming from one same IP.

    0
Viewing 11 replies - 1 through 11 (of 11 total)
  • Replies
    Up
    0
    Down

    If your usuing the latest version of VitalPBX you may provide custom headers on the trunks module on the advance tab.

    0
    hlev
    Participant
    Up
    0
    Down

    @ing-joserivera26

    I did set the X-Tenant header on each of the trunks, but it doesn’t get sent at all when a call is made so the provider doesn’t differentiate the tenant that makes the outgoing call.

     

    0
    Up
    0
    Down

    You may use the sngrep tool to verify if the custom header is sent on trunks headers.

    Check the picture attached. 

    0
    hlev
    Participant
    Up
    0
    Down

    @ing-joserivera26

    My PBX doesn’t send the the header at all =(, any idea why this could be happening?

    0
    Up
    0
    Down

    I cannot tell you what is happening because I don’t know what kind of configurations and environment do you have.

    0
    hlev
    Participant
    Up
    0
    Down

    @ing-joserivera26

    VPS setup, VitalPBX 2.4.0-1, Skyetel PJSIP trunk with a custom header added in the trunk advanced tab. Not sure what other configs would affect the trunk not sending out the custom header.

    0
    Up
    0
    Down

    Do you have a call log of an outgoing call?

    0
    hlev
    Participant
    Up
    0
    Down

    @ing-joserivera26

    Here is the log of a call, line 128 I do see the following which should mean it must be sending it right?

    [2019-12-26 14:09:58] VERBOSE[17893][C-00000056] pbx.c: Executing [18XXXXXX273@trk-1-dial:16] Set(“PJSIP/134-000000e7”, “PJSIP_HEADER(add,X-Tenant)=vital.pbx”) in new stack

    Why wouldn’t the header appear in the sngrep log as well? Just opened a ticket with Skyetel as well to check their side of the logs to see what we are sending.

    0
    Up
    0
    Down

    @hlev

    Looks like is an issue on VitalPBX’s dialplan, because, according to Asterisk documentation the PJSIP headers must be add-ed in a pre-dial handler:

    To operate on the callee’s (outgoing) channel call PJSIP_HEADER in a pre-dial handler.

    Example:

    ;

    [handler]
    exten => addheader,1,Set(PJSIP_HEADER(add,X-MyHeader)=myvalue)
    exten => addheader,2,Set(PJSIP_HEADER(add,X-MyHeader2)=myvalue2)

    ;

    [somecontext]
    exten => 1,1,Dial(PJSIP/${EXTEN},,b(handler^addheader^1))
    ;

    0
    Up
    0
    Down

    @hlev

    This is fixed on VitalPBX 2.4.0-3

    0
    hlev
    Participant
    Up
    0
    Down

    @ing-joserivera26 Forgot to update over here, everything is working properly now thank you so much.

    0
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Custom Sip Headers’ is closed to new replies.