Problems with extension_state function

I have sip extensions register with Ldap. When I call to an extension for first time, extension_state function tell me “0 not in use”, it is ok. But whereas i am talking from this extension, someone call me, and extension_satate function tell me “0 not in use” again, but i am calling from this extension, this function should tell me “1 in use”. I don’t understand how extension_state works, can anyone help me?

Howdy,

Does the extension have a hint set on it, e.g.:

exten => 100,hint
exten => 100,1,Dial(SIP/alice)

?

extension_state only works for hinted extensions.

Cheers

Yes, in my dialplan i have:

exten => _7[0-4][0-9],hint,SIP/${EXTEN}
exten => _7[0-4][0-9],1,Macro(exten-vm,${EXTEN},${EXTEN})

I am using trixbox macro for that Macro(exten-vm,${EXTEN},${EXTEN}) , this Macro make Dial(…)

If i haven’t the first line (hint), extension_state tell me “4 UNKNOWN”, but It always tell me “O not in use”

Any other idea?
Thanks

Howdy,

Is there any different if you use the AMI ExtensionState function or is it the same?

With AMI always obtain 0 too. But only with ldap extension. Other extension register in sip.conf haven’t this problem.

Howdy,

Are you subscribed to our developers mailing list?

That would be a good place to bring this up in a discussion format with the development team.

I am not subscriber to developer list, where can i subscribe it?

Howdy,

At:

lists.digium.com/mailman/listinfo/asterisk-dev

I found the problem. The problem wasn’t ldap extension, the problem was Asterisk version and dinamic hints. If Asterisk version is earlier 1.6.1, dinamic hint doesn’t work.
Thanks you very much.