Distinctive Ring Tones

VitalPBX Community Support General Discussion Distinctive Ring Tones

  • Post
    hlev
    Participant

    Could it be possible to make returning parked calls send a different alert-info header to make phones sound differently and/or at least add a caller ID prefix to alert users the call has been parked?

    Also I have been trying to make the inbound calls alert-info work but I believe the header is not getting sent out properly when using PJSIP, here is the line in the log showing the header:

    [2020-02-20 17:16:10] VERBOSE[1678][C-00000165] pbx.c: Executing [XXXXXXX9238@incoming-calls:4] SIPAddHeader("PJSIP/oak-00000567", "Alert-Info:external") in new stack

    SIPAddHeader would only work when using SIP not PJSIP right?
    0
Viewing 5 replies - 1 through 5 (of 5 total)
  • Replies
    hlev
    Participant
    Up
    0
    Down

    Anyone have an idea of which file I would need to modify to try to get this alert-info sent also on PJSIP?

    0
    hlev
    Participant
    Up
    0
    Down

    Added the PJSIP header to the extensions__50-1-dialplan.conf, testing.

    0
    mdmoore
    Participant
    Up
    0
    Down
    Did this work for you?  I am trying to change the ringtone for a Yealink T46S phone connected via pjsip.  The alert-info field in the GUI only seemed to generate a SipAddHeader – which would be great if I were using sip, but I am using pjsip.

    I went to add custom code to force this to work, but it doesn’t seem to be taking effect though:

    exten => _MYTESTDID,1,NoOp(INBOUND_ROUTE: CVTest DID – MYTESTDID)
        same => n,Set(CHANNEL(language)=en)
        same => n,Set(__INBOUND_LANGUAGE=en)
        same => n,Set(PJSIP_HEADER(add,Alert-Info)=info=alert-ring3);
        same => n,Gosub(sub-set-moh,s,1(default,YES))
        same => n,Gosub(sub-set-call-vars,s-incoming,1(${CALLERID(num)},${EXTEN},…56))
        same => n,Set(ICALL=yes)
        same => n,Goto(T8_cos-all,99,1)

     

    When I examine the SIP INVITE there is not alert info in the header 🙁

    If you might share your code for this or point out what my error is, I would be in your debt!

    Thanks,

    -Michael

     

    0
    mdmoore
    Participant
    Up
    0
    Down
    Figured out what I did wrong:

    For PJSIP to set the header ahead of time it is necessary to have Set(PJSIP_HEADER… invoked as part of the actual Dial command.  Specifically, as the asterisk documentation *did* indicate when I read more closely, you need to add a pre-dial subroutine call to your Dial command for this to work right.  For me, this meant adding the b() option to the Dial options already being specified.  Thus, this is my revised Dial command inside sub-local-call in the 20-baseplan.conf file:

        …
    same => n,Dial(${DIAL_STRING},${RING_TIME},b(sub-pjsip-add-headers^s^1())${DIAL_OPTIONS})

    [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()

    Then if I set PJALERTINFO in the code wherever I want distinctive ring tones it will insert that variable as the value for Alert-Info for all targets of the call.  Otherwise the Dial command just has an extra subroutine called that doesn’t do anything (leaving the ring tone the same)

    Hope this helps someone else out there… 🙂

    Also – this needs to be added to the VitalPBX base code in some form since otherwise the Alert-Info field for inbound routes is ineffectual for PJSIP users (right now it only inserts the SipAddHeader version for SIP users)

    -Michael

     

    1
    hlev
    Participant
    Up
    0
    Down
    Hi @mdmoore, this is certainly something that needs to be added to base conf files as you say.
    0
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.