Auto dial out issue in asterisk - asterisk

I am applying an auto dial in asterisk using .call file
My a.call
Channel: DAHDI/g0/09*********
MaxRetries: 1
RetryTime: 600
WaitTime: 30
Context: outgoing
Extension: 10
Priority: 1
My problem is that every time above number is called by same number means even if i change the dialled number(receiver number above) the caller number is same.How can i set the caller number in an outgoing call?
Thanks in advance.

You can use
Channel: DAHDI/g0/09*********
MaxRetries: 1
RetryTime: 600
WaitTime: 30
Context: outgoing
Extension: 10
Priority: 1
Callerid: 12345
Note, dahdi g0 have be digital trunk and ALLOW change of callerid.

You just add the parameter on your .call file
Callerid: <your_callerid>

Related

Ansible async_status fails when the async call interrupts the target network connection

How can I call a task that temporarily interrupts network connectivity to the target when it runs.
I wrote a PowerShell ansible module that modifies the target windows network settings causing it to lose connectivity for around 30 seconds. The connection is to a windows 2019 server via winrm I need to know if the task succeeded or reports errors.
If I call the task normally, it will fail with host unreachable if the network is gone for more than read timeout (30) seconds. The operation may have succeeded, but I don't have access to its return values.
- win_vswitch:
Name: "SomeSwitch"
VLAN: 123
state: present
Seems like a good use of async:
- name: Configure VSwitch
win_vswitch:
Name: "SomeSwitch"
VLAN: 123
state: present
async: 600
poll: 0
register: async_result
- name: vswitch - wait for the async task to finish
async_status:
jid: "{{ async_result.ansible_job_id }}"
register: task_result
until: task_result.finished
# ignore_unreachable: yes
retries: 60
delay: 5
# failed_when: False
The problem is that if the async_status poll is unable to get a network connection to the target for more than read_timeout seconds, it fails with host unreachable error. Even if the async_status's timeouts haven't expired.
Seems to me that I just need to set the read timeout to a higher value. And that's where I'm stuck.
Things I've tried:
timeout in ansible.cfg
ansible_winrm_read_timeout_sec & ansible_winrm_operation_timeout_sec in the inventory host item
ignore_unreachable & failed_when in the async_status module
rescue clause around the async_status
Suggestions?
TIA, Jeff
You can define ansible_winrm_connection_timeout (and other ansible_winrm_* values as well), by defining vars on the task itself:
- name: vswitch - wait for the async task to finish
async_status:
jid: "{{ async_result.ansible_job_id }}"
register: task_result
until: task_result.finished
retries: 60
delay: 5
vars:
ansible_winrm_connection_timeout: 300
This may be preferable to using the win_wait_for task depending upon the use case. win_wait_for might be good for a task when the network connectivity will immediately drop; however, if you have a task that will cause a drop at a random time (like a task installing network drivers).

openvswitch: How to turn ON the bridge?

I am trying to configure an ovs bridge to connect to a controller. I notice that it sends the HELLO but does not complete the connection. I see the following:
ovs-ofctl show br-flowmon
OFPT_FEATURES_REPLY (xid=0x2): dpid:deadbeefdeadbeef
n_tables:254, n_buffers:0
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
1(patch-flowmon1): addr:26:1f:db:26:99:4a
config: 0
state: 0
speed: 0 Mbps now, 0 Mbps max
LOCAL(br-flowmon): addr:56:ea:36:94:4b:4e
config: PORT_DOWN
state: LINK_DOWN
speed: 0 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0
I suspect that it does not complete the connection because the config state is PORT_DOWN. How can I "turn on" the port? Is there any other possible reason for this behavior?
(is there an ovs-vsctl or ovs-ofctl command to do this?)
Thank you
ifconfig br-flowmon up
Fixed the issue but I still don't see a completed connection at the controller. Any clues?

Asterisk max calls

I am trying to do a stress test on the asterisk server.
I have created multiple accounts that call each other.
For example
1001 calls -----> 1002
1003 calls -----> 1004
1005 calls -----> 1006
Somehow when the server gets to 64 active calls it keeps saying that there is no active port.
And I can't make any more calls.
The error log;
Choices:
0 For current dialog.
-1 All 0 buddies in buddy list
[1 - 0] Select from buddy list
URL An URL
<Enter> Empty input (or 'q') to cancel
Make call: 07:40:28.584 pjsua_call.c !Making call with acc #1 to sip:1006#127.0.0.1:25060
07:40:28.584 pjsua_aud.c .Set sound device: capture=-99, playback=-99
07:40:28.584 pjsua_aud.c ..Setting null sound device..
07:40:28.584 pjsua_app.c ...Turning sound device ON
07:40:28.584 pjsua_aud.c ...Opening null sound device..
07:40:28.584 pjsua_media.c .Call 0: initializing media..
07:40:28.584 pjsua_media.c ..Unable to find appropriate RTP/RTCP ports combination
07:40:28.584 pjsua_media.c ..Unable to create RTP/RTCP socket: Address already in use [status=120098]
07:40:28.584 pjsua_media.c ..Error creating media transport: Address already in use
07:40:28.584 pjsua_call.c .Error initializing media channel: Address already in use [status=120098]
07:40:28.584 pjsua_media.c .Call 0: deinitializing media..
>>> >>>>
Account list:
[ 0] <sip:172.31.31.91:30404>: does not register
Online status: Online
*[ 1] sip:1005#172.31.31.91: 200/OK (expires=219)
Online status: Online
Buddy list:
-none-
Anybody a clue why this keeps happening.
I have also created a script that registers 5000 users, all with different ports and this works perfectly without any problems. Would it be possible that there is somewhere a limit function?
Likly you have limited number of ports allowed in rtp.conf file
Please stop spam same questions, asterisk for sure can handle thousands of calls, check your setup(embeded?)/config.

channel 0/1 got hung up in asterisk

I am trying to make a outgoing from an asterisk pbx using .call file but every time .call file is moved in outgoing folder my cli shows
[Jun 16 15:38:12] NOTICE[30435]: pbx_spool.c:372 attempt_thread: Call failed to go through, reason (1) Hangup
[Jun 16 15:38:12] NOTICE[30435]: pbx_spool.c:375 attempt_thread: Queued call to DAHDI/g0/09716927126 expired without completion after 0 attempts
-- Span 1: Channel 0/1 got hangup request, cause 16
-- Hungup 'DAHDI/i1/09711590094-103a'
[Jun 16 15:38:17] NOTICE[30434]: pbx_spool.c:372 attempt_thread: Call failed to go through, reason (1) Hangup
[Jun 16 15:38:17] NOTICE[30434]: pbx_spool.c:375 attempt_thread: Queued call to DAHDI/g0/09711590094 expired without completion after 0 attempts
-- Attempting call on DAHDI/g0/09711590094 for 4759509#outgoing1:1 (Retry 1)
-- Attempting call on DAHDI/g0/09716927126 for 4759509#outgoing1:1 (Retry 1)
-- Requested transfer capability: 0x00 - SPEECH
-- Requested transfer capability: 0x00 - SPEECH
-- Span 1: Channel 0/2 got hangup request, cause 31
-- Hungup 'DAHDI/i1/09716927126-103d'
my .call file
Channel: DAHDI/g0/09711590094
MaxRetries: 1
RetryTime: 600
WaitTime: 30
Context: outgoing1
Extension: 10
Priority: 1
The call could not be connected.Anybody knows what would be the possible reason for that?
Thanks in advance
This error mean you can't call as requested via dahdi/g0
Very likly you have configure correctly your dahdi card.

Asterisk call file

Good day. The call file details are
Channel: SIP/voipswitch/971556710034
MaxRetries: 6
RetryTime: 20
WaitTime: 30
Context: default
Extension: 971556710034
Priority: 1
with this setting I can connect call on my phone. Once call get received asterisk delete this file and stop calling. But I want to call on my phone after every 30 min and will receive every time.
Can some one please help to do this.
Put this line in /etc/crontab
*/30 * * * * asterisk cp /path/to/call/file /var/spool/asterisk/outgoing
This will copy call file to asterisk outgoing directory every 30 min.
Don't forget to restart crontab service.
service crontab restart

Resources