Asterisk Dial with r option

Dears im having a problem with the dial with r option it’s taking a default rbt even if i change it from indications.conf anyone can help ??
im trying to set this for the default tone of iraq i added the context in indications but nothing happens when i set this to default country.

You need to answer the call, or at least call Progress() before early media will be used. Otherwise Asterisk will just send an Alerting signal (e.g. SIP 180) and the network, for for VoIP, the originating phone, will generate the ringback tone.

hello dear

the call is taking the us rbt but not changing it even if i set another one as default.

You have repeated the question. That is not a good sign that a forum like this will work for you.

Dear maybe you got me wrong
you didnt answer my question that’s why i repeated it.

my problem is not that im not able to generate the RBT (im able to use asterisk RBT by setting the r option in the dial)
my problem is im not able to change asterisk default RBT it’s taking the US rbt set in the indications.conf even if i change the country

I don’t think it is taking the US one, I think it is sending 180 Ringing (SIP) or Alerting (ISDN) and the calling phone (SIP) or network (ISDN) is generating the ringback tone.

For Asterisk to generate ringback tone, the call must be answered, or, with certain reservations, the use of early media must have been forced, using Progress() and the upstream network must support early media. It is possible that only answering will ensure the use of inband signalling in this case.

You haven’t even said whether this is SIP, IAX, H.323, analogue, or ISDN etc., and you haven’t provided a dialplan, so it is not possible to tell if you have answered or done anything that would enable early media.

There may be some channel type specific options that control the use of inband call progress signals.

thank you david for your time
this is my dialplan nothing special in it.
im not answering the call at all (for the functionality of service does not allow me to answer)

exten => s,1,Dial(SIP/${called},,r) 
exten => s,n,GotoIf($["${DIALSTATUS}"="CHANUNAVAIL"]?test1,s,1)
exten => s,n,GotoIf($["${DIALSTATUS}"="BUSY"]?test2,s,1)
exten => h,1,Hangup()

but the thing is if i dont set the r option in the dial i dont get an RBT at all that why i assumed that im getting the default RBT of asterisk .
when i set the r option im getting an RBT but it’s not changing if i change the default country.

All that r does is to cause the dial application to send an AST_CONTROL_RINGING frame, even though it hasn’t received one from the called party.

In the case of the SIP channel driver, that will result in it sending 180 Ringing, which will cause the phone to generate whatever it thinks is ringback tone.

For ISDN, the channel driver will probably send Alerting.

For analogue, the channel driver will actually generate the ring back tone.

In some cases calling Progress may result in it being sent as early media, but networks often suppress that.

Try adding Answer() at the start of the dialplan, and I think that will force Asterisk to send an inband tone. That is not a problem for a local phone (except that the phone may not receive call failure indications), but for a remote one, it will probably start charging.

Actually your real problem may be that the downstream system is sending ringback tone as early media itself, which is what you were trying to get Asterisk to do. If so removing the r and adding Answer should allow it to go through. If the upstream can handle early media, calling Progress() before Dial() would allow any downstream early media to be passed through.