How to dial multiple calls at once using asterisk ?


#1

Hi,

I want to dial to multiple numbers at once ,I had tried with func. Dial(PJSIP/101 & PJSIP/102) but it will only ring to both user and hung-up the other ,if any one user has picked up the call.

e.g,101–> dialing,102–> dialing

if 101 pick up the call.

101—> Answer,102—>Hangup(automatically by asterisk)

but, i want to make calls simultaneously to multiple user ,either they Answer or not.

e.g,101–> dialing,102–> dialing
101—> Answer,102—>Answer


#2

Originate with a conference accessed from the target dialplan.

Page, in the special case of one way communication.


#3

Thanks for your reply david551,
Currently our motive is to not to do conference call,instead we want calls to initiate parallelly to mutilple clients.

we tried originate func.,but it was not able to set callerId and not working for outbound calls through our SIP trunk.
We have tried call files and they seem to be working fine, but is there any overhead associate with them or does any better way exist?


#4

hi david,
I had tried the call files, it is working fine in case if i have to playback something but in case of
AGI function it will not executing . below is showing our configuration and logs.

Channel: PJSIP/101
MaxRetries: 0
RetryTime: 15
WaitTime: 15
Application: AGI
Data:/home/voi/Documents/test.py

Logs:

  • Attempting call on PJSIP/101 for application AGI(/home/voi/Documents/test.agi) (Retry 1)
    – Called 101
    – PJSIP/101-00000038 is ringing
    > 0x7f651400be50 – Strict RTP learning after remote address set to: 127.0.0.1:8000
    – PJSIP/101-00000038 answered
    > Launching AGI(/home/voi/Documents/test.agi) on PJSIP/101-00000038
    – Launched AGI Script /home/voi/Documents/test.agi
    > 0x7f651400be50 – Strict RTP switching to RTP target address 127.0.0.1:8000 as source
    – <PJSIP/101-00000038>AGI Script /home/voi/Documents/test.agi completed, returning 0
    [Aug 17 18:41:14] NOTICE[14636]: pbx_spool.c:463 attempt_thread: Call completed to PJSIP/101

#5

Looks like a successful call to me. I’d look at what your AGI script does.


#6

we are trying to playback some files and generate logs of the calls ,so for that we are using AGI script of python for more control over flow.
below is “test.agi”

#!/usr/bin/env python
from asterisk.agi import AGI
from app.callLogs import callLogs
from callconferencing import socketClient

def playbackMessage():
try:
agi = AGI()
# print(“playback Message started”)
agi.verbose("&&&& playback message $$$$")
# audioFile = socketClient.audioFilePath
# get the file form particular path
agi.appexec(“Playback”,“demo-instruct”)
# set the call logs for the users.
dialStatus = agi.get_variable(“DIALSTATUS”)
agi.verbose(%s,dialStatus)
empCallType=“tata”
hungUpBy=“caller”
employeeId=1
employeeName=“ash”
agi.verbose("SET out call Logs started ")
callLogs.setOutCallLog(agi, employeeId, employeeName, empCallType, dialStatus, hungUpBy)
except Exception as E:
logger.exception(E)


#7

Why are you indirecting through /usr/bin/env?


#8

you are right i have used wrong path /usr/bin/env ,
but after writing /usr/bin/python.
the results are same.

  • Attempting call on PJSIP/101 for application AGI(/home/voi/Documents/nonConfCall.py) (Retry 1)
    – Called 101
    – PJSIP/101-0000000a is ringing
    > 0x7f7fb000ecb0 – Strict RTP learning after remote address set to: 127.0.0.1:8000
    > 0x7f7fb000ecb0 – Strict RTP switching to RTP target address 127.0.0.1:8000 as source
    – PJSIP/101-0000000a answered
    > Launching AGI(/home/voi/Documents/nonConfCall.py) on PJSIP/101-0000000a
    – Launched AGI Script /home/voi/Documents/nonConfCall.py
    – <PJSIP/101-0000000a>AGI Script /home/voi/Documents/nonConfCall.py completed, returning 0
    [Aug 17 19:41:19] NOTICE[20227]: pbx_spool.c:463 attempt_thread: Call completed to PJSIP/101

#9

as it was mentioned, Page() is a solution for you.

“Places outbound calls to the given technology/resource and dumps them into a conference bridge as muted participants (if the ‘d’ option is not specified). The original caller is dumped into the conference as a speaker and the room is destroyed when the original caller leaves.”

To get it work smoothly, is better to Page  the Local/s@some-context, where a certain group of extensions are called (precheck if they are currently paging or not ) . 

to test it, use the asterisk cli command:

channel originate Local/s@originating application Page Local/s@answering

having dialplan:
[origination]
exten => s,1,Answer()
same => n,Playback(demo-instruct)
same => n,Hangup

[answering]
exten => s,1,Dial( PJSIP/101& PJSIP/102& PJSIP/103,60)
exten => h,1,Noop( Result: ${DIALSTATUS} )