Alert-Info not working for PJSIP extensions

VitalPBX Community Support Reporting an Issue Alert-Info not working for PJSIP extensions

  • Post
    wwsystems
    Participant
    Up
    -2
    Down
    Hi, I am using V3.0. I have Alert-Info defined on an inbound route and it works great with CHAN_SIP extensions. However, for PJSIP extensions, the Alert-Info is not sent. I have checked a PCAP and can confirm that the Alert-Info is not being sent in the SIP header.
    2
Viewing 5 replies - 1 through 5 (of 5 total)
  • Replies
    mdmoore
    Participant
    Up
    0
    Down
    I seem to be having this same problem.  Did anyone find a resolution for this — is it a confirmed bug?   Seems like right now I am unable to change the ringtone for my phones when using pjsip?  Any help or info appreciated.

     

    Thanks!

    -Michael

     

    0
    Up
    0
    Down
    Make sure you have the latest version of VitalPBX 3… Remember you must enable the auto-answer by headers in the phone itself.
    0
    mdmoore
    Participant
    Up
    0
    Down
    Thanks for the response Jose.

    This is definitely still a problem for PJSIP in the version of VitalPBX I am running: VitalPBX Carrier Plus 3.0.4-4.

    The issue isn’t auto-answer, but rather changing the ring tone for the phones.  For Yealink phones (and others) this is done by setting the Alert-Info header in the INVITE to a specific value.  For my Yealink phones, I have them configured to play different ring tones when matching “alert-ringX” in the Alert-Info field, where X is 1 through 8 to coincide with the 8 built in ring tones that are usable.

    From setting the Alert-Info field for an inbound route in VitalPBX, I saw the code generates the proper SipAddHeader() call to set the ring tone, but there is no equivalent PJSIP_HEADER() code added.

    I did work out a solution, which required changing the extensions__20-baseplan.conf to add a b() argument to the Dial command that is used when dialing.   My revised Dial looked like this:
    same => n,Dial(${DIAL_STRING},${RING_TIME},b(sub-pjsip-add-headers^s^1())${DIAL_OPTIONS})

    where my extra snippet is in bold-italic.  This references a new context I added, sub-pjsip-add-headers, which handles the proper calling of Set(PJSIP_HEADER(add,Alert-Info)..) for each target in the dial command.  I used a new variable PJALERTINFO to store what that Alert-Info header should be set to.  If it is not set, the context does nothing.

    [sub-pjsip-add-headers]
    exten => s,1,NoOp(Add PJSIP headers before initiating outgoing call)
    same => n,GotoIf($[“${PJALERTINFO}”=””]?skipHeaders);
        same => n,NoOp(ADDING CUSTOM RING TYPE HEADER FOR PJSIP)
        same => n,Set(PJSIP_HEADER(add,Alert-Info)=${PJALERTINFO});
        same => n(skipHeaders),Return()

    The final change, then, was to modify the auto-generated tenant dialplan to set this variable in the same place that VitalPBX had put the Alert-Info call to SipAddHeader() (shown in bold-italics below).  Once I add the setting of PJALERTINFO, shown in bold red below, the ring tone changed as desired.

    exten => _1235551212,1,NoOp(INBOUND_ROUTE: CVTest DID – 1235551212)
     same => n,Set(CHANNEL(language)=en)
     same => n,Set(__INBOUND_LANGUAGE=en)
     same => n,Gosub(sub-set-moh,s,1(default,YES))
     same => n,SIPAddHeader(Alert-Info:Alert-info: info=alert-ring3)
      same => n,Set(__PJALERTINFO=info=alert-ring3);
     same => n,Gosub(sub-set-call-vars,s-incoming,1(${CALLERID(num)},${EXTEN},9f9068800d99f956))
     same => n,Set(ICALL=yes)
     same => n,Goto(T8_cos-all,99,1)
     same => n,Hangup()

    This is clearly not a good solution, since the tenant diaplan code is auto-generated each time updates are applied – thus erasing my custom line of code.  I am sure i can figure out a way to avoid this – but for the point here of explaining how the PJSIP Alert-Info header is not being set, it seems a sufficient example.

    I hope you can add an official fix for this problem with PJSIP Alert-Info in the next version of VitalPBX.

    Thanks again!

    -Michael

     

    1
    hlev
    Participant
    Up
    0
    Down
    I second @mdmoore petition, the ability to set the PJSIP headers in version 3 which has PJSIP as default should be considered important, as all new installations will now not even use SIP.
    0
    PitzKey
    Participant
    US
    Up
    2
    Down
    Latest version of VitalPBX 3 has PJSIP Alert-Info working
    2
Viewing 5 replies - 1 through 5 (of 5 total)
  • The forum ‘Reporting an Issue’ is closed to new topics and replies.