Getting Call ID of a call?


#1

Hi, when a phone is bridged and you run core show channels in the CLI, you will see that asterisk make a call id to be a unique in the phone system, something like this; SIP/201-6f698

The Caller ID is one thing to display the number we want - but the call id is made by asterisk it self. (For one open session).

How can i get the call id of a phone that is bridged?
If phone 206 is talking (bridged) how can i get the call id created by asterisk for that call? Like this;

;I will press 099 to get the call id (NOT the CallerId) of SIP/206…

exten=>090,1,Answer()
exten=>090,2,Set(MyVar=${CALLID(SIP/206)})
exten=>090,3,NoOp(The CALL id session of phone 206 is ${MyVar})
exten=>090,4,Hangup()

I want to know the call id of another phone because i want to use ChannelRedirect() to redirect the call to another phone, and to use ChannelRedirect i have to know the call id of the phone…

Please help me with that!


#2

What you seem to be describing is the channel name, i.e. ${CHANNEL}.

I’m not clear why you are referring to calls being bridged. To what is it bridged?

SIP/206, in your example, can have indefinitely large numbers of channels attached to it, and Asterisk doesn’t have function that return arrays. I am not sure that there is any link from the device to the list of channels active on it. Even simple phones need to support at least two channels if they can do SIP transfers.

I think the only way of doing this is to enumerate all the channel names, using AMI or AGI.

Knowing why you want to do this may lead to better solutions.


#3

We need to know the call ID, yes is similiar to ${CHANNEL}, but how can i get the ${CHANNEL} of another phone, i need to know the call ID because i want to use ChannelRedirect()


#4

For SIP there is a call id, but it not what you seem to be talking about.

I repeate that a device can have more than one channel, and I don’t believe there is a mechanism to enumerate the active channels for a device, so you will have to enumerate all active channels and match the channel name prefix.


#5

For example, if phone ext. 206 is in the Queue(Sales)
and incoming call is in the Queue(Sales)–> The phone 206 begin ring…ring… But if my partner is not on his position, how can i Redirect the channel to my phone and answer the call for him?

I know about Pickup() using Dial, i know about group pickup too in features.conf *8.
But if my case, the call is in Queue, NOT using Dial application…

Exist a way to I answer the call to my partnet, using the application RedirectChannel()
Look the example;

exten=>8,1,Answer()
exten=>8,2,ChannelRedirect(SIP/206-here-goes-the-call-id,mycontext,exten,priority)

If i use;
exten=>8,1,Answer()
exten=>8,2,ChannelRedirect(SIP/206,mycontext,exten,priority)

It doesn’t work, because i just putting the SIP/206 and it only works if i put the call ID, like SIP/206-4875jcv

Please, help me to fix this…


#6

Look at the function CHANNELS
Look at the definition of the variable BRIDGEPEER (spelling?)
Look at the application Bridge
Look at the application PickupChan

This assumes that SIP/106 never has more than one call at a time.

What you call a call-id is not a call-id - at best it is a leg id, but in really, it is just an opaque suffix to a device name to create a channel name. On Asterisk 1.6, for SIP, it is actually the address of the channel private data structure, expressed in hex.

Also, there is nothing to fix. Asterisk is working as intended.


#7

Why dont use the timeout in the queue and set in the next priority the DIAL app to your phone.


#8

Sorry, BRIDGEPEER probably won’t work; I was confused by your reference to bridged channels. No channels are bridged in your scenario.


#9

SO, no way to Pickup a call from an extension inside a Queue?
Someting like;

exten=>9,1,Answer()
exten=>9,2,QueuePickup(Sales,SIP/206)
?


#10

Hi

You didnt read my reply to your post on picking up calls from queues I posted today.

yes you can use PickUpChan

Ian