[Asterisk-Dev] How to pass a complex tone to Playtones

Stephen Davies steve at daviesfam.org
Tue Jun 17 04:30:35 MST 2003


Hi,

Is there an explanation of how extensions.conf is parsed?

I've just been trying to figure out how to pass a complex tone into
Playtones?

Doing:

  exten => 3,1,Playtones(400*33/400,0/200,400*33/400,0/2000)

(The * is something I'm working on)

The commas are treated as parameter separators.  By the time the
argument gets to handle_playtones in res/res_indications.c, it looks
like 400*33/400|0/200|400*33/400|0/2000.

If I do:

  exten => 3,1,Playtones,400*33/400,0/200,400*33/400,0/2000

Then handle_playtones only sees 400*33/400 - the rest is gone

  exten => 3,1,Playtones("400*33/400,0/200,400*33/400,0/2000")

results in handle_playtones getting the whole contents of the
() including the quotes, which handles_playtones doesn't handle.

I eventually found that:

  exten => 3,1,Playtones,"400*33/400,0/200,400*33/400,0/2000"

worked...

It all seems pretty inconsistent to me.  Perhaps it shows that I
really don't understand how extensions.conf is parsed...

(The *, by the way, gets the one tone modulating the other.  Needed to
match some countries' indications.  Patch coming)

Thanks,
Steve





More information about the asterisk-dev mailing list