AMI & CALLERID

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

AMI & CALLERID

Postby anya » Thu Jun 14, 2012 1:04 am

Hello, just to ask is this right syntax for getting callerid?

$callerid = $ami->GetVar($channel,'CALLERID');

I got response with Value null. :S
Is there different way for this? Can you advice me how to get callerid ?


Thank you
Anya
anya
Newsterisk
 
Posts: 35
Joined: Fri Apr 13, 2012 2:45 am

Re: AMI & CALLERID

Postby david55 » Thu Jun 14, 2012 1:28 am

The best way is probably to capture it from the events.

Have you tried adding (), or (num)?

If all else fails, copy the caller ID to a local variable, within the dialplan, itself.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: AMI & CALLERID

Postby anya » Thu Jun 14, 2012 1:32 am

It is working with num:) Thank you !
Can I also on this way get DNID number? Is there dnid variable??
anya
Newsterisk
 
Posts: 35
Joined: Fri Apr 13, 2012 2:45 am

Re: AMI & CALLERID

Postby david55 » Thu Jun 14, 2012 1:35 am

core show function CALLERID

I've not investigated to what extent DNID is maintained, you may have to set it in the dialplan, from the initial ${EXTEN}, in some cases.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: AMI & CALLERID

Postby anya » Thu Jun 14, 2012 1:46 am

Ok, If I set dnid in the dialplan, how can I get it using AMI? There is no other option?
I have A number that is calling B number, and B number forward call to C number. I want to C number see the B number, not A ....if you understand me:)
anya
Newsterisk
 
Posts: 35
Joined: Fri Apr 13, 2012 2:45 am

Re: AMI & CALLERID

Postby david55 » Thu Jun 14, 2012 1:49 am

That will depend on how the transfer is done. You may need to read specific channel variables. Asterisk may not know a transfer is in progress at the time that you try to get the information.

If dnid is set, reading CALLERID(dnid) should return the value, however I'm not sure how Asterisk manipulates this.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: AMI & CALLERID

Postby anya » Thu Jun 14, 2012 1:52 am

CALLERID(dnid) is excatly what I needed. Thanks a lot on your advices and time !

Best regards,
Anya
anya
Newsterisk
 
Posts: 35
Joined: Fri Apr 13, 2012 2:45 am

Re: AMI & CALLERID

Postby david55 » Thu Jun 14, 2012 2:01 am

I have a suspicion that CALLERID(dnid) is only automatically handled on ISDN incoming and outgoing calls, and you must explicitly manipulate, or access, it in the dialplan, on all other contexts.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: AMI & CALLERID

Postby anya » Thu Jun 14, 2012 2:03 am

I got dnid, using just GetVar :

Array
(
[Response] => Success
[Variable] => CALLERID(dnid)
[Value] => XXXXXXXXXXXX
)
anya
Newsterisk
 
Posts: 35
Joined: Fri Apr 13, 2012 2:45 am


Return to Asterisk Support

Who is online

Users browsing this forum: Yahoo [Bot] and 20 guests