I am using a 8-port Asterisk card. I have a PBX. I want to call extension "222" from 1 channel(DAHDI/1-1) , i can do it using
exten =>s,1,Dial(DAHDI/3-1/222)
it use channel 3 as a bridge. However I want to dial "222" directly.
Actually i will use it for this senario:
A is customer
B is call center member
C is asterisk agi which I use credit card payment on phone line.
A calls B
B take infomations of A then
B tranfer A to C (Dial 111 on the phone)
A finish conversation with C (make payment succesfully)
Then I want to reconnect A and B (dialing B's caller ID (112))
You need create dialplan which will record B(extension) and transfer A to C, after that transfer back A to B(recorded in variable).
However all that still will use channels on card. You can't call not using channels.
Related
In asterisk 1.4 number of channel was specified in chan->name.
e.g. number 62:
asterisk 1.4 ZAPTEL: Zap/62-1
How to get actual number of channel in asterisk 13 in c-language?
e.g. in chan->name this number of span only.
asterisk 13 DAHDI: DAHDI/I2/102-1
Here is what R.Mudget say about extentons.conf:
You can use the AMI action DAHDIShowChannels to get the current channel mapping.
There is an AMI event that you can look for:
Event: DAHDIChannel Channel: name Uniqueid: id DAHDISpan: 5
DAHDIChannel: 23
It is generated whenever a call is assigned to a B channel or a call moves to a different B channel.
There is also the CHANNEL() dialplan function:
CHANNEL(dahdi_channel)
CHANNEL(dahdi_span)
CHANNEL(dahdi_type)
The DAHDIChannel event and CHANNEL() function are mentioned in the UPGRADE.txt file.
Richard
But how do I get an actual number of channel in c-language API?
Simplest way answer this question is read source code(writed in c/c++) of chan_dahdi and see how dahdi_channel variable is set in YOUR dahdi/asterisk combination.
You also can use ami from c/c++, but that is not optimal.
In general you should not see number of channel in channel-name unless you setuped one-channel-one-span.
My use case is really simple: Asterisk is the middleman, it receives the call from outside and it forwards to A, when A hangs up, I want to forward it to B immediately. Is it sufficient to make another Dial?
Do you have any example?
+12345 --- Asterisk------------------ B
| when A hangs up call B
|
A
If A is called with the Dial application, you could use the 'g' option and put the call to B after the first Dial to A.
According with the Dial documentation:
g - Proceed with dialplan execution at the next priority in the current extension if the destination channel hangs up
In the following example, dialing 1001 asterisk calls first SIP/A. If A hangups, asterisk calls B. It is not necessary the option 'g' in the last call. I leave it to be able of modifying the Dial in a future or in case I wanted to grow the chain. Note the last Hangup that, if there was not option 'g' it would not be strictly necessary, but even without 'g' option can be convenient (if you put timeouts and you want to play sounds if the timeout comes).
exten => 1001, 1, Dial(SIP/A,,gm)
same => n, Dial(SIP/B,,gm)
same => n, Hangup()
How to automatically transfer inbound call to an outside number in Asterisk server?
Example:
When a customer calls to a tollfree number it's connected to my call center server.
Here we have 3 options: 1 for English, 2 for Telugu and 3 for Hindi.
If the customer selects option 1, they should be redirected to a dealer number.
If the customer selects option 2 it redirect to my private line. This option is working fine because this number is an internal number.
I'd like to know how to auto-transfer the inbound call to an outside number in Asterisk if customer selects option 2?
If you have a SIP gateway, you first need to register it in sip.conf
register => user:pass#gatewayip/number_from_gateway (so you can make outbound calls)
then for option 3 for example you can assign an internal number 103, and you can send the call to 103:
exten => 103,1,Dial(Local/EXTERNALNUMBERHERE,45,tr)
There are manuals online, and this can easily be found, with more examples. So please do your digging before asking here ;)
I'm new to Asterisk so any help will be greatly appreciated.
I'm trying to save remote party ID (CONNECTEDLINE) in CDR logs table in transferred calls. In blind transfers there's no problem because I'm getting Remote Party ID as Caller ID in src field.
In attended transfers I'm loosing the original caller ID.
This is how transfer goes:
A calls B (A talking with B)
B holds A, and calls C (B talking with C)
B transfers A to C (A talking with C)
Now, in CDRs table I'm getting two records. One for the first call (A<->B), and another for the two second calls (B<->C and A<->C). The point is in second CDR I have lost any reference to A.
I want to save Remote Party ID (A) in second CDR.
I've already added a custom field to CDR table (connectedID).
I'm reading about editing some configuration files, adding this kind of sentences:
"exten => s,1,set(CDR(connectedID)=${CONNECTEDLINE})"
However, I'm quite lost. I don't know which file I need to edit, even in what part of file I should put these lines of code.
Could somebody point me in the right direction?
You can use Func_SHARED,save cid in shared variables and do lookup by bridged channel name
However that all require debugging and your own effort.
http://www.voip-info.org/wiki/view/Asterisk+func+shared
Other option is collect events and remmember all transfers
Reading call events via AMI (thanks to #arheops) I manage how to save Remote Party ID in CDR.
In hangup event we can see Remote Party ID in ConnectedLineNum field.
For a transferred call like this one:
401 calls 208
208 calls 308 (401 on hold)
208 transfers original call to 308 (401 talking with 308)
this is a hangup event sample for the final segment of the call.
Event Hangup
Privilege: call,all
Channel: SIP/308-00000665
Uniqueid: 1421757614.1658
CallerIDNum: 208
CallerIDName: Juan Ruiz
ConnectedLineNum: 401
ConnectedLineName: Test1
Cause: 16
Cause-txt: Normal Clearing
Original caller is stored in ConnectedLineNum variable.
So I add this line to the hangup section:
exten => s,1,Set(CDR(connectedid)=${CONNECTEDLINE(number)})
I'm using Elastix 2.4.0, so I've added this line at the beggining of the [macro-hangupcall] macro in extensions_override_elastix.conf file.
In other Asterisk based distros it should be in another file.
I am using Asterisk E1 card on CentOS 6.2.
When I call on my asterisk system using a simple pstn or by a mobile phone, the call perfectly run. But when the same number has called by a PABX phone, the asterisk system ignored some digits.
I am using asterisk 1.4 and dahdi 2.4.
I have also tried the dtmfmode = rfc2833 in the sip.conf file. Please some one hemp me resolve this problem.
eg: What actually Our system do, when some one call on our system, we ask for for a 14 digit registration id, and perform some operation on it and it work fine. But when some one call from their own PBX phone (or PABX or soft phone) and enter the registration id, then our system ignore some digits.
I also had this problem some times ago this some PBXs.
this help for me:
relexdtmf=yes
Example of my channel.conf:
; SPAN 1-4 = E1 (1-15,17-31,32-46,48-62,63-77,79-93,94-108,110-124)
; ------------------
switchtype = euroisdn
; Type of Number (TON) for called number
pridialplan = local
; Type of Number (TON) for calling number
prilocaldialplan = private
signalling = pri_cpe
context = incoming
group = 1
immediate = no
overlapdial = yes
channel => 1-15,17-31,32-46,48-62,63-77,79-93,94-108,110-124
; activate this option if there are problems with dtmf detection
relexdtmf=yes
I suppose you meant 'call from PBX internal extension' from 'call from their own PBX phone'.
I have faced issue like this. In my case the issue was with the phone. some old or broken IP phone failed to generate proper DTMF signals. Have you tried different phones like soft phones.