I use Dial command to dial 2 different numbers simultaneously:
Dial(SIP/NUMBER1&SIP/NUMBER2)
If one of them answers, is there any way to know which? A variable or something like that.
Can’t find any data in CDR record - CDR(dst)=s, because “s” is the context where I run Dial() command.
Sorry, my Dial() function actually looks like this:
Dial(SIP/NUMBER1@SomeSipPeer&SIP/NUMBER2@SomeSipPeer)
Now BRIDGEPEER=SIP/SomeSipPeer-00000249, same as dstchannel from CDR, no info about number. Maybe there is a way to get number from channel name?
Which asterisk Version are You using?
With Asterisk 1.8.x You could do something like (here in AEL-style):
Dial(SIP/NUMBER1@SomeSipPeer&SIP/NUMBER2@SomeSipPeer,,U(setdestpeer));
context setdestpeer {
s => {
Set(LOCAL(RealProvider)=${CUT(DIALEDPEERNUMBER,/,1)});
Set(LOCAL(RealCalled)=${CUT(DIALEDPEERNUMBER,/,2)});
// Make Your logic here: RealProvider contains the used peer,
// RealCalled the Number, called
// e.g. to set up the CDR(userfield) You could do
Set(MASTER_CHANNEL(CDR(userfield))=${RealCalled});
Return;
}
}