How can we help you today?
Start a new topic
Answered

Different ringtones for external calls

 I am using a Asteisk 16.0.0 and pjsip for sip calls. My goal is to set different ringtones on d715 phones for external and internal calls, so i tried to set the "Alert-Info" Header with PJSIP_HEADER, but without luck.

I set "answer_after_policy" to "always" on the phone and under Preferences i set

Alert Internal Text: alert-internal

Alert Internal Ringer: Ringer 1

Alert External Text: alert-external

Alert External Ringer: Ringer 2


and tried to add a dialplan extension line into the external context in asterisk:


; same => n,Set(PJSIP_HEADER(add,Alert-Info)=<http://127.0.0.1/Ringer2>)
; same => n,Set(PJSIP_HEADER(add,Alert-Info)=<http://nohost>\;info=alert-external\;x-line-id=0)
; same => n,Set(PJSIP_HEADER(add,Alert-Info)=<https://sip.mydomain.com/melody1.wav>)
 ;same => n,Set(PJSIP_HEADER(add,Alert-Info)=<127.0.0.1>\;info=alert-external\;x-line-id=0)
; same => n,Set(PJSIP_HEADER(add,Alert-Info)=<http://www.notused.com>\;info=alert-external\;x-line-id=0)

but always Ringone 1 is played.

(From the above examples always one of the lines were activated while testing)


For debuging i also added the following lines:

 same => n,Set(TESTALERT=${PJSIP_HEADER(read,Alert-Info)})
 same => n,NoOp(ALERT 2 ${TESTALERT})


The header seams to be set. The "SIP_TRACE" Log on the phones do not show a Header "Alert-Info", but i do not know if the header should be displayed there or not.


Is it possible to let the snom d715 phones ring according to the "Alert-Info" Header and if so what could be the problem?






Best Answer

Hi Armin,


The Alert-Info header should be visible in the INVITE message sent from Asterisk to the phone, and this message can be seen in the SIP Trace. Make the call, then on the receiving phone search for text "INVITE sip" in the SIP trace to find the incoming INVITE. One of the headers in this INVITE should be "Alert-Info" like in the examples here: http://wiki.snom.com/Category:HowTo:Ringtone:Alert_Info


If the header is not seen in the SIP Trace than it was not received by the phone. In this case please check your Asterisk configuration. I don't know how to use PJSIP, I just use the standard SIPAddHeader like this: 

SIPAddHeader("Alert-Info:<http://www.notused.com>\;info=alert-external\;x-line-id=0").


I hope this helps.


Thanks

Catalina


1 Comment

Answer

Hi Armin,


The Alert-Info header should be visible in the INVITE message sent from Asterisk to the phone, and this message can be seen in the SIP Trace. Make the call, then on the receiving phone search for text "INVITE sip" in the SIP trace to find the incoming INVITE. One of the headers in this INVITE should be "Alert-Info" like in the examples here: http://wiki.snom.com/Category:HowTo:Ringtone:Alert_Info


If the header is not seen in the SIP Trace than it was not received by the phone. In this case please check your Asterisk configuration. I don't know how to use PJSIP, I just use the standard SIPAddHeader like this: 

SIPAddHeader("Alert-Info:<http://www.notused.com>\;info=alert-external\;x-line-id=0").


I hope this helps.


Thanks

Catalina


Login or Signup to post a comment