arnonym / ha-plugins Goto Github PK
View Code? Open in Web Editor NEWHome-Assistant SIP Gateway
License: Apache License 2.0
Home-Assistant SIP Gateway
License: Apache License 2.0
Hi Arne,
I've tried to use your addon with my Deutsche Telekom Account.
Unfortunately I cannot get it to register properly:
11:27:49.452 sip_resolve.c ...Failed to resolve 'tel.t-online.de': gethostbyname() has returned error (PJ_ERESOLVE)
11:27:49.452 tsx0x16bbb88 ...Failed to send Request msg REGISTER/cseq=51565 (tdta0x16b9bc8)! err=70018 (gethostbyname() has returned error (PJ_ERESOLVE))
11:27:49.452 pjsua_acc.c .....SIP registration failed, status=502 (gethostbyname() has returned error (PJ_ERESOLVE))
11:27:49.453 pjsua_acc.c .....Scheduling re-registration retry for acc 0 in 9 seconds..
| OnRegState: 502 gethostbyname() has returned error (PJ_ERESOLVE)
11:27:49.453 sip_reg.c ..Error sending request: gethostbyname() has returned error (PJ_ERESOLVE)
Telekom has disable the DNS-A Record and SIP Clients need to resolve the host with SRV Record.
Any chance you could add this functionality?
Thanks for this addon, it truly is amazing!
When sending
service: hassio.addon_stdin
data:
addon: 58bd5418_ha-sip
input:
command: 'transfer'
number: '<number>'
transfer_to: '<number>'
to the addon, instead of transfer, i get an error in the logs Error: unknown command: transfer
Am I doing something wrong? Everything else is working fine for me. Btw, it does also not work without the " ' "
Dear developer,
I have set up a LAN-LAN VPN connection between two Fritz Box devices, one with IP 192.168.178.1 and 10 registered phone numbers, the other with IP 192.168.188.1 and only one registered phone number. The HA-SIP addon allows for two SIP numbers/configurations, and the configuration has been successful. When a call is made from either Fritz Box, it is recognized by HA-SIP and the webhook is triggered.
However, I am unable to differentiate in my automation script which phone number or which Fritz Box was called, as the SIP realm for both SIP and SIP_2 is "@fritz.box".
I would like to request one of the following solutions:
Changing the realm to the IP address, so that the webhook appears as:
{
"event": "incoming_call",
"caller": "sip:[email protected]",
"parsed_caller": "5551234456"
}
{
"event": "incoming_call",
"caller": "sip:[email protected]",
"parsed_caller": "5551234456"
}
Changing the "called" tag to:
"caller": "sip:[email protected]",
"caller": "<sip_2:[email protected]>",
Adding a fourth tag indicating the phone number that was called.
Creating two separate webhooks for each SIP configuration.
Thank you for your assistance in this matter.
Hi!
First: Great Plugin for HA!
But I have one question: I have to call a doorbell which expects PAUSES in the order of digits i send to it with send_dtmf.
Is it already possible? I didn't find anything.
I'm trying to add this to HA OS, but I get the following error:
"
Failed to install add-on
Can't install agellhaus/amd64-ha-sip:2.3: 404 Client Error for http+docker://localhost/v1.41/images/create?tag=2.3&fromImage=agellhaus%2Famd64-ha-sip&platform=linux%2Famd64: Not Found ("manifest for agellhaus/amd64-ha-sip:2.3 not found: manifest unknown: manifest unknown")
"
Any ideas?
First of all: great job !
Everything works like a charm. Big thank.
I'd like to play a music when answering an incoming call.
A word about that in doc would be perfect.
I'm trying to use different platform instead of google_translate.
google_cloud is impossible to use due to the language: setting it, error is raised during usage as not supported (language is defined through voice used and defined in configuration), avoiding set it cause an error saving the ha-sip config.
The same with tts pkatform watson_tts.
Any way to change the platform?
Sorry for the intrusion but i just started with Home Assistant. Just after i finished my asterisk server so making this addon work was one of the 1st things i did.
I have a use case. I want a wake up routine that calls me and If i press 1 News is spoken trough a mpd player and after that music is played. I use 2 mpd services for this one that plays the music and streams it using the internal httpd. a 2nd one switching between tts and the stream. (!MUSIC STOPS! "You have a call from ... " !MUSIC PLAYS! works fine Thank you)
Now i have created a service to speak out my rss news feed. only i cant get it to be triggered from within the hassio.addon_stdin choice menu.
see attached script
i cant get the service running.
a link to more examples would be helpful. (I use cut past a lot)
alias: wekker
description: ''
trigger:
- platform: time_pattern
hours: '07'
minutes: '00'
seconds: '00'
enabled: false
condition: []
action:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: dial
number: sip:[email protected]
menu:
message: Good Morning. press one for news. two for music
choices:
'1':
message: Have a good day.
action:
service: script.mpdsay
'2':
message: Have a nice day.
action:
service: script.mpdsay
data: {}
mode: single
Hi @arnonym,
I just discovered your add-on and I am awestruck at what you have created. I have been using home assistant for a couple of years and have been wondering just as long why there is no better integration with telephony features and SIP. Your add-on fills this gap beautifully and I am still at the beginning of discovering all the features the add-on has to offer.
That said, there are just some minor things to which you might have some insights.
Submenu
Is it possible to return to a previous menu or submenu to the parent menu? "post_action" only returns me back to the menu on the same level. Maybe I missed something in the documentation and the issues, once I went down a menu branch it is not possible to go the other way.
timeout
Timeouts only work in the root menu, the first level of the menu. Default option works just fine.
message and templating
In my scenario someone is calling home assistant and ha-sip answers the call. After entering the pin the person can choose from from a couple of options one of which would be the announcing of the state of some entities. When in answering mode and thus using the yaml-file templating seems not possible. Only the "service: hassio.addon_stdin" call would be able to do just that and therefor be able to announce the current state of en entity. I guess using an automation and a webhook i could end the call, call back after a short delay and then announce the information I wanted to retrieve. The only thing holding me back are the rates of calling from landline (home assistant) to mobile ;-)
My yaml for incoming calls looks something like shown below. I could not switch from owner-1 to owner or even to the main menu. The templatings attempts are also visible in the menu "mieter"
The timeout only works in main menu.
menu:
message: Bitte Pin eingeben
choices_are_pin: true
timeout: 10
choices:
'9876:
id: mieter
message: Hallo Paul. Der "{{ states('input_boolean.heizbetrieb_gastezimmer') }}"" ist ! Mit 1 umschalten.
post_action: hangup
'12345678:
id: owner
message: Hallo Johannes. Wähle 1 für Vorsaal Oben oder 2 für Flur Mitte. Mit Raute beenden.
post_action: noop
choices:
'1':
id: owner-1
message: Vorsaal Oben geschalten.
post_action: return
'2':
id: owner-2
message: Flur Mitte geschalten.
post_action: return
A service call to a number to announce a state of an entity would look like this
service: hassio.addon_stdin
data:
addon: c7744bff_ha-sip
input:
command: dial
number: sip:**[email protected]
webhook_to_call_after_call_was_established: another_webhook_id # web-hook id which you can listen on in your actions (deprecated)
webhook_to_call: # web-hook IDs which you can listen on in your actions (additional to the global web-hook)
call_established: another_webhook_id # can be all the same, or different
entered_menu: another_webhook_id
dtmf_digit: another_webhook_id
call_disconnected: another_webhook_id
ring_timeout: 15 # time to ring in seconds (optional, defaults to 300)
sip_account: 1 # number of configured sip account: 1 or 2
# (optional, defaults to first enabled sip account)
menu:
message: "{{ state_attr('input_boolean.heizbetrieb_gastezimmer', 'friendly_name') }} ist {{ states('input_boolean.heizbetrieb_gastezimmer') }}"
I am looking forward to your response
Dunkelschunkel
Hi!
As I can see from your examples and your profile you're from Germany as I am and use one of the famous AVM Fritz!Boxes. Your Plugin works great for "outgoing" calls, but it would be really nice if you could listen to incoming calls too.
I for example hava a doorbell calling all house-phones via voip/sip, using the Fritz!Box "Rundruf" (call everybody) functionality. Those calls are unluckily not registered in the call monitor, so I can not let HA know someone is at the door.
But if you could make your addon listen to incoming calls, maybe even detecting the caller-id, this would massively improove my experience.
Best
Pascal
Hi,
Just installed the newest version (3.2). To be clear, I hadn't used this addon before.
I am struggling to get my HA registered on a sub-account. I have checked the sub-account works fine but HA cannot register to it.
I saw someone else in here who seems to have managed to get this addon working with Voip.ms. Am I missing something?
Since my 2023.7 upgrade, outbound TTS calls are a solid beep and logs show error getting tts.
Previous to 2023.7 my google translate say was set up via yaml... now it is set up in gui (default settings for us english)
I spun up a fresh HA 2023.7 machine on a separate network just to make sure the issue wasn't an issue with my hardware or config.
anyone else have the same issue & How can i fix?
is it possible to set a stun/turn server at the config?
Hi,
This is the first add-on that I am aware of that uses hassio.addon_stdin.
You provide default configuration info in the Readme but I get errors if I copy it into the usual /config/configuration.yaml
Where should I put the configuration info for this add-on?
Thanks, Robert
As per subject I was wondering if there's any chance to use your integration by straight using a video doorbell with no phone or other VoIP equipment?
I personally have an Amcrest AD410 SIP capable video doorbell.
I would like to have the option to use multiple times the audio_file
and/or message
config items. Maybe another config item could be used for that, something like 'playlist'.
My usecase is, that i want to use ha-sip to call me in case of an alarm (water, smoke, gas, burglar, etc.). When it does so, it first should play an introducing message ("Attention, automatic message"), then the cause ("smoke detected") and finally an ending message ("please confirm with pin"). Of course i could join the introducing and ending message to every type of alarm, but IMO it would be more flexible with separated files.
In combination with post_action: repeat_message
all messages should be repeated. Maybe others then have a need for a post_action type 'repeat_last_message'.
As i saw #33, it seems you're not interested in this feature. So i would like to know, what steps do i need to do, to use my fork in HA? (want to try to code this feature request)
I'm using this great piece of software in an automation. In the automation i'm waiting for a webhook from ha-sip with event call_disconnected
. This event is only sent to the global webhook id from the addon configuration. The webhook id defined in the action (webhook_to_call_after_call_was_established
) don't receive the call_disconnected
event. Is this on intent or can you add this with a next update?
alias: ha-sip-test
description: ""
trigger:
- platform: state
entity_id:
- input_button.testanruf
condition: []
action:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: dial
number: sip:**[email protected]
webhook_to_call_after_call_was_established: action_webhook_id
ring_timeout: 20
sip_account: 1
menu:
message: >-
What is the answer to the ultimate question of live, the universe
and everything?
post_action: repeat_message
timeout: 60
choices:
"42":
message: Douglas Adams
post_action: hangup
default:
post_action: return
timeout:
post_action: hangup
- repeat:
until:
- condition: template
value_template: "{{ wait.trigger.json.event == 'call_disconnected' }}"
sequence:
- service: notify.persistent_notification
data:
message: waiting...
- wait_for_trigger:
- platform: webhook
webhook_id: action_webhook_id
continue_on_timeout: false
- service: notify.persistent_notification
data:
message: webhook received. event {{ wait.trigger.json.event }}
- service: notify.persistent_notification
data:
message: end of automation
mode: single
first off: it's more a request of extending the readme by probably one or two lines. To avoid the overhead of a PR and merging, I decided to create an issue. Sorry for that :)
What I want to suggest:
It drove me nuts several hours & days to figure out how the format of an external telephone number (in this case my mobile) should look like for an outgoing call.
Based on the Readme, internal calls to a second local FB connected fone were no issue at all - but it took me a while to figure out that the format of external numbers need to look like this (and excuse me- SIP is completely new to me. Maybe it's a nobrainer for all of you)
"sip:[email protected]" (or alternatively with the fritzbox IP "sip:[email protected]"
It would be awesome if something like this can be added to the readme to save time for other newbies in the future :)
Maybe something like, added to the section ot Outgoing Calls
Note: When calling an external number the format need to look like
sip:[email protected]
Hello,
It`ll be possible in the future incoming call transfers?
Thanks.
I use my voip phone in my bedroom to control my bedroom devices. triggered by incoming number. And if i fire lots of commando after each other (you know monkey just press the buttons) the addon can crash after running several actions.
I use 2.1. (could not test this on my test environment with next because this requires lots of additional integration)
aterisk passon
exten => 4012,1,Log(NOTICE, switch fan slaapkamer)
exten => 4012,n,Set(CALLERID(NUM)=4012)
exten => 4012,n,Dial(PJSIP/6011)
exten => 4012,n,Hangup()
addon log
| timeout: 300.0
| parent_menu: *id001
| timeout_choice:
| id: null
| message: null
| language: en
| action: null
| choices_are_pin: false
| choices: null
| default_choice: null
| timeout_choice: null
| post_action: hangup
| timeout: 300.0
| parent_menu: *id001
| post_action: noop
| timeout: 300.0
| parent_menu: null
|
| Registering call with id 4012
| Incoming call from '<sip:[email protected]>' to '<sip:[email protected];ob>' (parsed: '4012')
| Answer mode: LISTEN
| Calling webhook sip_call_webhook_id with data {'event': 'incoming_call', 'caller': '<sip:[email protected]>', 'parsed_caller': '4012'}
| Webhook response 200 b''
| Early
| Got "answer" command for 4012
| Trigger answer of call (if not established already)
| Call will be answered now.
| onCallMediaState call info state 3
| Connected media 1
| Call connecting...
| Call connected
| onCallRxReinvite
| onCallRxOffer
| onCallMediaState call info state 5
| Connected media 1
| Call is established.
| Calling webhook sip_call_webhook_id with data {'event': 'call_established', 'caller': '<sip:[email protected]>', 'parsed_caller': '4012'}
| Webhook response 200 b''
| Playing message: fan slaapkamer uit
| Calling home assistant service on domain script service turn_on with entity script.switch_fan_slaapkamer
| Service response 200 b'[{"entity_id":"script.switch_fan_slaapkamer","state":"on","attributes":{"last_triggered":"2022-11-07T15:42:31.484147+00:00","mode":"single","current":1,"friendly_name":"switch_fan_slaapkamer"},"last_changed":"2022-11-07T15:42:31.484282+00:00","last_updated":"2022-11-07T15:42:31.484282+00:00","context":{"id":"01GH9C3V1TEJ6TNXYKBM4ECV8R","parent_id":null,"user_id":"42ed58e0d09f4f77b4beb6c2469e4e65"}}]'
| Playback done.
| Scheduled post action: noop
| onCallRxReinvite
| onCallRxOffer
| onCallMediaState call info state 5
| Connected media 1
| Call disconnected
| Calling webhook sip_call_webhook_id with data {'event': 'call_disconnected', 'caller': '<sip:[email protected]>', 'parsed_caller': '4012'}
| Webhook response 200 b''
| &id001
| id: null
| message: null
| language: en
| action: null
| choices_are_pin: false
| choices: {}
| default_choice:
| id: null
| message: Unknown option
| language: en
| action: null
| choices_are_pin: false
| choices: null
| default_choice: null
| timeout_choice: null
| post_action: return
| timeout: 300.0
| parent_menu: *id001
| timeout_choice:
| id: null
| message: null
| language: en
| action: null
| choices_are_pin: false
| choices: null
| default_choice: null
| timeout_choice: null
| post_action: hangup
| timeout: 300.0
| parent_menu: *id001
| post_action: noop
| timeout: 300.0
| parent_menu: null
|
| Registering call with id 4012
| Incoming call from '<sip:[email protected]>' to '<sip:[email protected];ob>' (parsed: '4012')
| Answer mode: LISTEN
| Calling webhook sip_call_webhook_id with data {'event': 'incoming_call', 'caller': '<sip:[email protected]>', 'parsed_caller': '4012'}
| Webhook response 200 b''
python3: ../src/pjsip/sip_transport.c:842: pjsip_rx_data_free_cloned: Assertion `rdata' failed.
/run.sh: line 34: 225 Aborted (core dumped) python3 /ha-sip/main.py
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
part of the script used
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4012' }}"
- condition: state
entity_id: switch.calex_smart_plug_nl_socket_1
state: "on"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4012"
timeout: 10
menu:
message: fan slaapkamer uit
action:
domain: script
service: turn_on
entity_id: script.switch_fan_slaapkamer
post_action: hangup
enabled: true
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4012' }}"
- condition: state
entity_id: switch.calex_smart_plug_nl_socket_1
state: "off"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4012"
timeout: 10
menu:
message: fan slaapkamer aan
action:
domain: script
service: turn_on
entity_id: script.switch_fan_slaapkamer
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4012"
enabled: false
default: []
enabled: true
mode: single
full script
alias: asterisk_controller
description: lokaal inkomende calls om HA te bedienen
trigger:
- platform: webhook
webhook_id: sip_call_webhook_id
condition:
- alias: incomming call
condition: template
value_template: " {{ trigger.json.event == 'incoming_call' }} "
enabled: true
- alias: incomming call
condition: template
value_template: " {{ trigger.json.parsed_caller != '5555' }} "
enabled: true
action:
- choose:
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4000' }}"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4000"
timeout: 10
menu:
message: mute slaapkamer
action:
domain: script
service: turn_on
entity_id: script.switch_snapclient_slaapkamer_toggle
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4000"
enabled: false
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4001' }}"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4001"
timeout: 10
menu:
message: unmute slaapkamer
action:
domain: script
service: turn_on
entity_id: script.unmute_slaapkamer
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4001"
enabled: false
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4002' }}"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4002"
timeout: 10
menu:
message: brams chillere nummers
action:
domain: script
service: turn_on
entity_id: script.cast_brams_chillere_nummers_slaapkamer
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4002"
enabled: false
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4003' }}"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4003"
timeout: 10
menu:
message: brams lekkere nummers
action:
domain: script
service: turn_on
entity_id: script.cast_brams_lekker_nummers_slaapkamer
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4003"
enabled: false
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4004' }}"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4004"
timeout: 10
menu:
message: reggae
action:
domain: script
service: turn_on
entity_id: script.cast_slaapkamer_reggae
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4004"
enabled: false
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4005' }}"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4005"
timeout: 10
menu:
message: soul and jazz
action:
domain: script
service: turn_on
entity_id: script.cast_slaapkamer_soul_n_jazz
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4005"
enabled: false
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4006' }}"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4006"
timeout: 10
menu:
message: arrow rock fm
action:
domain: script
service: turn_on
entity_id: script.cast_slaapkamer_arrow_rock_fm
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4006"
enabled: false
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4007' }}"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4007"
timeout: 10
menu:
message: nieuws en weer
action:
domain: script
service: turn_on
entity_id: script.anp_nieuws
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4007"
enabled: false
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4008' }}"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4008"
timeout: 10
menu:
message: volume omhoog
action:
domain: script
service: turn_on
entity_id: script.volume_slaapkamer_up
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4008"
enabled: false
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4009' }}"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4009"
timeout: 10
menu:
message: volume omlaag
action:
domain: script
service: turn_on
entity_id: script.volume_slaapkamer_down
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4009"
enabled: false
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4010' }}"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4010"
timeout: 10
menu:
message: cast spotify
action:
domain: script
service: turn_on
entity_id: script.snapcast_spotify_slaapkamer
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4010"
enabled: false
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4011' }}"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4011"
timeout: 10
menu:
message: cast mpd
action:
domain: script
service: turn_on
entity_id: script.snapcast_mpd_slaapkamer
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4011"
enabled: false
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4012' }}"
- condition: state
entity_id: switch.calex_smart_plug_nl_socket_1
state: "on"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4012"
timeout: 10
menu:
message: fan slaapkamer uit
action:
domain: script
service: turn_on
entity_id: script.switch_fan_slaapkamer
post_action: hangup
enabled: true
- conditions:
- condition: template
value_template: "{{ trigger.json.parsed_caller == '4012' }}"
- condition: state
entity_id: switch.calex_smart_plug_nl_socket_1
state: "off"
sequence:
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: "4012"
timeout: 10
menu:
message: fan slaapkamer aan
action:
domain: script
service: turn_on
entity_id: script.switch_fan_slaapkamer
post_action: hangup
enabled: true
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: false
- service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: hangup
number: "4012"
enabled: false
default: []
enabled: true
mode: single
Hi!!
First of all, congratulations to this addon. I'm new in SIP World but already building wonders with that.
It's not an issue, but I'd like to know if is it possible to implement wildcard (*) in number lists.
I'd like to use for example "55319*" to block all incoming calls started with "55319" instead of adding all of them on a list.
Thanks in advance!
The slug name for this projects seems to be incorrect.
With the new version 2023.9.0 the slug names get validated.
As seperator only underscore is allowed.
Hello,
I tried to install the add-on directly from the repository as described, but it always fail with this output on the logfile:
make --no-print-directory -C python
swig -I../../../../pjlib/include -I../../../../pjlib-util/include -I../../../../pjmedia/include -I../../../../pjsip/include -I../../../../pjnath/include -c++ -w312 -python -o pjsua2_wrap.cpp ../pjsua2.i
python3 setup.py build
running build
running build_py
creating build
creating build/lib.linux-aarch64-3.9
copying pjsua2.py -> build/lib.linux-aarch64-3.9
running build_ext
building '_pjsua2' extension
creating build/temp.linux-aarch64-3.9
aarch64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-PN012d/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-PN012d/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.9 -c pjsua2_wrap.cpp -o build/temp.linux-aarch64-3.9/pjsua2_wrap.o -g -O2 -DPJ_AUTOCONF=1 -I/include -O2 -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -fPIC -DPJMEDIA_USE_OLD_FFMPEG=1 -DPJMEDIA_USE_OLD_FFMPEG=1 -I/pjproject/pjlib/include -I/pjproject/pjlib-util/include -I/pjproject/pjnath/include -I/pjproject/pjmedia/include -I/pjproject/pjsip/include
aarch64-linux-gnu-gcc: fatal error: Killed signal terminated program cc1plus
compilation terminated.
error: command '/usr/bin/aarch64-linux-gnu-gcc' failed with exit code 1
make[1]: *** [Makefile:37: _pjsua2.so] Error 1
make: *** [Makefile:29: python] Error 2
Removing intermediate container 7354840e65f3
Any ideas how to fix this?
I have a pretty new installation of Home Assistant OS x64 on a raspberry pi 3
Hi, this isnt a bug, but I'm not sure if it's meant to work or not.
I have a SIP phone at home, and my gate calls the SIP phone when someone presses the gate buzzer (this is on Home Assistant).
When I want to let someone in I hit a button in HA and it opens the gate.
I'd like HA to be able to hang up the SIP session on the other device, is that possible? I've configured both HA-SIP and my SIP phone on the same account.
Thanks!
I can not here anything when calling hass. But I see the following error message:
| 16:12:50.073378 [1] onDtmfDigit: digit 4
| 16:12:50.073480 [ ] Calling webhook sip_call_webhook_id with data {'event': 'dtmf_digit', 'caller': '"Ferdy" <sip:[email protected]>', 'parsed_caller': '0xxxxxxxxxxxx', 'digit': '4', 'sip_account': 1}
| 16:12:50.081785 [ ] Webhook response 200 b''
| 16:12:50.081847 [1] Current input: 1234
| 16:12:50.081879 [ ] Calling webhook sip_call_webhook_id with data {'event': 'entered_menu', 'caller': '"Ferdy" <sip:[email protected]>', 'parsed_caller': '0xxxxxxxxxxxx', 'menu_id': 'owner', 'sip_account': 1}
| 16:12:50.089918 [ ] Webhook response 200 b''
| 16:12:50.089983 [1] Playing message: Welcome beautiful.
| 16:12:50.101204 [ ] Error getting tts file 500 b'500: Internal Server Error'
16:12:50.101 pjsua_aud.c Destroying player 1..
16:12:50.101 pjsua_aud.c Creating file player: /ha-sip/sound/answer.wav..
16:12:50.101 wav_player.c .File player '/ha-sip/sound/answer.wav' created: samp.rate=44100, ch=1, bufsize=4KB, filesize=176KB
16:12:50.101 pjsua_aud.c .Player created, id=1, slot=3
16:12:50.101 pjsua_aud.c Conf connect: 3 --> 1
16:12:50.101 conference.c .Port 3 (/ha-sip/sound/answer.wav) transmitting to port 1 (sip:[email protected])
| 16:12:50.101518 [1] No action supplied
| 16:12:52.107772 [1] Playback done.
| 16:12:52.112163 [1] Scheduled post action: hangup
| 16:12:52.112236 [1] Hang-up.
16:12:52.112 pjsua_call.c !Call 1 hanging up: code=0..
16:12:52.112 pjsua_media.c .Call 1: deinitializing media..
16:12:52.112 pjsua_media.c ..
[CONFIRMED] To: "Ferdy" <sip:[email protected]>;tag=C954E501EC29ACF2
Call time: 00h:00m:04s, 1st res in 18 ms, conn in 46ms
#0 audio G722 @16kHz, sendrecv, peer=-
SRTP status: Not active Crypto-suite:
ICE role: Unknown, state: Candidate Gathering, comp_cnt: 2
RX pt=9, last update:00h:00m:04.805s ago
total 0pkt 0B (0B +IP hdr) @avg=0bps/0bps
pkt loss=0 (0.0%), discrd=0 (0.0%), dup=0 (0.0%), reord=0 (0.0%)
(msec) min avg max last dev
loss period: 0.000 0.000 0.000 0.000 0.000
jitter : 0.000 0.000 0.000 0.000 0.000
TX pt=9, ptime=20, last update:never
total 179pkt 28.6KB (35.8KB +IP hdr) @avg=47.6Kbps/59.6Kbps
pkt loss=0 (0.0%), dup=0 (0.0%), reorder=0 (0.0%)
(msec) min avg max last dev
loss period: 0.000 0.000 0.000 0.000 0.000
jitter : 0.000 0.000 0.000 0.000 0.000
RTT msec : 0.000 0.000 0.000 0.000 0.000
16:12:52.112 pjsua_media.c ...Media stream call01:0 is destroyed
16:12:52.112 icetp00 ..Stopping ICE, reason=media stop requested
16:12:52.112 ice_session.c ..ICE session 0x2a3c408 destroyed
16:12:52.112 icetp00 ..ICE stream transport 0x2a282f8 destroyed
| 16:12:52.112816 [1] Call disconnected
| 16:12:52.112927 [ ] Calling webhook sip_call_webhook_id with data {'event': 'call_disconnected', 'caller': '"Ferdy" <sip:[email protected]>', 'parsed_caller': '0xxxxxxxxxxxx', 'sip_account': 1}
| 16:12:52.121958 [ ] Webhook response 200 b''
| 16:12:52.122026 [ ] Remove from state: 0xxxxxxxxxxxx
16:12:52.122 pjsua_core.c ....TX 402 bytes Request msg BYE/cseq=225 (tdta0x2a1fd28) to UDP xxxxxxxxx:5060:
BYE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP xxxxxxxxxxxx:5060;rport;branch=z9hG4bKPjy984wi.O5nlAXa1ul8AcoN8tP57AA4mr
Max-Forwards: 70
From: <sip:homeassistant@xxxxxxxxxxxxxx;ob>;tag=xxxxxxxxxxxxx+sip.ice
To: "Ferdy" <sip:[email protected]>;tag=C954E501EC29ACF2
Call-ID: [email protected]
CSeq: 225 BYE
Content-Length: 0
Hey, just found out this new addon, i saw it can register an account, with listen mode
My goal, i want to register an (trunk) on my door intercom, thats running a SIP server
On incoming call, i want to blind transfer it to another number like [email protected]
Is that possible?
Does your addon also support video ?
Is it possible to run the addon in a seperate container without using supervisor?
Hello Arne! Hope this finds you well. First of all, thanks for this add-on!
I'm trying to accomplish the following scenario:
I live in an apartment building and want to be able to open the external door using the add-on you developed.
menu:
timeout: 60
message: Please enter your access code
choices_are_pin: true
choices:
'1234':
id: owner
message: Welcome, Marcelo.
**# At this moment, I would like to send a DTMF code to open the door**
post_action: hangup
'default':
id: wrong_code
message: Incorrect code. Try again.
post_action: return
'timeout':
id: timeout
message: Bye.
post_action: hangup
Note: I inserted the formatted yaml but github didn't honor it. The menu above is configured in sip-1-incoming.yaml and the add-on has the following configuration in sip1.
enabled: true
registrar_uri: sip:192.168.x.y
id_uri: sip:[email protected]
realm: "*"
user_name: sip_account
password: extension_password
answer_mode: accept
settle_time: 1
incoming_call_file: /config/sip-1-incoming.yaml
Questions:
would it be possible to also include rtsp video support?
I have an intercom wtth no camera, would be great make a call, and use the RTSP stream as a source for video
thnx in advance
Hi,
can you add the support for SIP Proxy!
To use SIP Trunk providers like bellSIP or Fonial we need to add a SIP Proxy server.
The pjsua2 is supporting the config option, but the HA plugin should make the proxy config setting and handling available.
Can you please add the proxy support in the ha-plugin?
I cant get the answer service to run.
I have a number starting with a 0 that was ommited so i made the number fixed to 5555 with asterisk still no anwser.
service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: answer
number: 5555
menu:
message: Bye
post_action: hangup
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
--end msg--
00:48:22.435 pjsua_call.c .Incoming Request msg INVITE/cseq=23075 (rdata0x322e4088)
00:48:22.436 pjsua_media.c ..Call 1: initializing media..
00:48:22.436 icetp00 ...Creating ICE stream transport with 2 component(s)
00:48:22.439 icetp00 ....Comp 1/0: host candidate 192.168.5.20:4033 (tpid=64) added
00:48:22.439 icetp00 ....Comp 1/1: host candidate 172.30.32.1:4033 (tpid=64) added
00:48:22.439 icetp00 ....Comp 1/2: host candidate 172.17.0.1:4033 (tpid=64) added
00:48:22.441 icetp00 ....Comp 2/0: host candidate 192.168.5.20:4021 (tpid=64) added
00:48:22.441 icetp00 ....Comp 2/1: host candidate 172.30.32.1:4021 (tpid=64) added
00:48:22.441 icetp00 ....Comp 2/2: host candidate 172.17.0.1:4021 (tpid=64) added
00:48:22.441 icetp00 ....ICE stream transport 0x322e1068 created
00:48:22.441 pjsua_media.c ...Media index 0 selected for audio call 1
00:48:22.441 pjsua_core.c .....TX 335 bytes Response msg 100/INVITE/cseq=23075 (tdta0x32306a18) to UDP 192.168.5.14:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.5.14:5060;rport=5060;received=192.168.5.14;branch=z9hG4bKPj08e27205-02ac-4ec4-bc40-64283461e40a
Call-ID: 4c83399a-ae0d-4e4f-9060-0bbb29a260a5
From: <sip:[email protected]>;tag=e273f47b-76e2-49b7-800e-c8ee43d275f7
To: <sip:[email protected];ob>
CSeq: 23075 INVITE
Content-Length: 0
--end msg--
| &id001
| id: null
| message: null
| language: en
| action: null
| choices_are_pin: false
| choices: {}
| default_choice:
| id: null
| message: Unknown option
| language: en
| action: null
| choices_are_pin: false
| choices: null
| default_choice: null
| timeout_choice: null
| post_action: return
| timeout: 300.0
| parent_menu: *id001
| timeout_choice:
| id: null
| message: null
| language: en
| action: null
| choices_are_pin: false
| choices: null
| default_choice: null
| timeout_choice: null
| post_action: hangup
| timeout: 300.0
| parent_menu: *id001
| post_action: noop
| timeout: 300.0
| parent_menu: null
|
| Registering call with id 5555
| Incoming call from '<sip:[email protected]>' to '<sip:[email protected];ob>' (parsed: '5555')
| Answer mode: LISTEN
00:48:22.450 pjsua_call.c ..Answering call 1: code=180
00:48:22.450 pjsua_call.c ...Pending answering call 1 upon completion of media transport
| Calling webhook sip_call_webhook_id with data {'event': 'incoming_call', 'caller': '<sip:[email protected]>', 'parsed_caller': '5555'}
| Webhook response 200 b''
00:48:22.478 icetp00 ICE session created, comp_cnt=2, role is Controlled agent
00:48:22.478 icetp00 ICE nomination type set to aggressive
00:48:22.478 icetp00 Candidate 0 added: comp_id=1, type=host, foundation=Hc0a80514, addr=192.168.5.20:4033, base=192.168.5.20:4033, prio=0x7effffff (2130706431)
00:48:22.478 icetp00 Candidate 1 added: comp_id=1, type=host, foundation=Hac1e2001, addr=172.30.32.1:4033, base=172.30.32.1:4033, prio=0x7efffeff (2130706175)
00:48:22.478 icetp00 Candidate 2 added: comp_id=1, type=host, foundation=Hac110001, addr=172.17.0.1:4033, base=172.17.0.1:4033, prio=0x7efffdff (2130705919)
00:48:22.478 icetp00 Candidate 3 added: comp_id=2, type=host, foundation=Hc0a80514, addr=192.168.5.20:4021, base=192.168.5.20:4021, prio=0x7efffffe (2130706430)
00:48:22.478 icetp00 Candidate 4 added: comp_id=2, type=host, foundation=Hac1e2001, addr=172.30.32.1:4021, base=172.30.32.1:4021, prio=0x7efffefe (2130706174)
00:48:22.478 icetp00 Candidate 5 added: comp_id=2, type=host, foundation=Hac110001, addr=172.17.0.1:4021, base=172.17.0.1:4021, prio=0x7efffdfe (2130705918)
00:48:22.478 icetp00 Stopping ICE, reason=No ICE found in SDP offer
00:48:22.478 icetp00 Destroying ICE session 0x32312238
00:48:22.480 pjsua_call.c Answering call 1: code=180
00:48:22.480 pjsua_core.c ....TX 522 bytes Response msg 180/INVITE/cseq=23075 (tdta0x3231a078) to UDP 192.168.5.14:5060:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.5.14:5060;rport=5060;received=192.168.5.14;branch=z9hG4bKPj08e27205-02ac-4ec4-bc40-64283461e40a
Call-ID: 4c83399a-ae0d-4e4f-9060-0bbb29a260a5
From: <sip:[email protected]>;tag=e273f47b-76e2-49b7-800e-c8ee43d275f7
To: <sip:[email protected];ob>;tag=F4pzFaJtQU7rq2uIk5nyEEHiS9iYTqC3
CSeq: 23075 INVITE
Contact: <sip:[email protected]:5060;ob>;+sip.ice
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length: 0
--end msg--
| Early
| Got "answer" command for 5555
| Warning: call not in progress: 5555
The installation of the add-on fails with the following error:
The command '/bin/bash -o pipefail -c set -xe && git clone https://github.com/pjsip/pjproject.git && cd pjproject && ./configure --enable-shared && make && make dep && make install && cd pjsip-apps/src/swig && make python && make -C python install && ldconfig' returned a non-zero code: 2
When issuing this command directly in the terminal, you get a more detailed error:
Cloning into 'pjproject'...
remote: Enumerating objects: 70403, done.
remote: Counting objects: 100% (2131/2131), done.
remote: Compressing objects: 100% (1328/1328), done.
remote: Total 70403 (delta 1028), reused 1716 (delta 765), pack-reused 68272
Receiving objects: 100% (70403/70403), 33.70 MiB | 5.67 MiB/s, done.
Resolving deltas: 100% (51710/51710), done.
Updating files: 100% (3009/3009), done.
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking target system type... aarch64-unknown-linux-gnu
checking for gcc... no
checking for cc... no
checking for cl.exe... no
aconfigure: error: in `/root/pjproject':
aconfigure: error: no acceptable C compiler found in $PATH
My doorbell rings until someone answers the call by phone. Could you add "Pick up Phone / answer phone" functionality and then of course hang up?
Is it possible to make a pre and post message option that can work in combination with audio_file.
I'm "finished" with my over engineered voicemail system. (https://github.com/Bram-diederik/asterisk-homeassistant-tools) I would like the option that i leave a spoken message.
But that also requires the options of the menu to be spoken out.
I could cat together some wav files. but this would be a nice addition to your lovely addon.
I have the plugin installed and connect to a SIP extension. I Do not see any services exposed. How do I use it in HA?
Hi again,
My SIP username is a combination of numbers + letters,
eg = 2142341e12
The config allows numbers + letters: 1234242wwer
But it does not allow numbers + letters + numbers = 4142341e12
Saving the config gives an error .Failed to save add-on configuration, not a valid value. .
Hello! If the user_name: consists only of numbers, then we get an error when trying to save the configuration.
not a valid value. Got {'sip_global': {'port': 5060, 'log_level': 5}, 'sip': {'enabled': True, 'registrar_uri': 'sip:sip.provider.com', 'id_uri': 'sip:[email protected]', 'realm': '*', 'user_name': 8208748, 'password': 'passwd', 'answer_mode': 'listen', 'settle_time': 1, 'incoming_call_file': ''}, 'sip_2': {'enabled': False, 'registrar_uri': 'sip:fritz.box', 'id_uri': 'sip:[email protected]', 'realm': '*', 'user_name': 'anotheruser', 'password': 'secret', 'answer_mode': 'listen', 'settle_time': 1, 'inco...
Good evening,
big project...
unfortunately I can't start the addon, I've tried different configurations but always with the same negative result, I'm attaching the complete log below. Thanks in advance for any help you can give me.
Stefano
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Python 3.10.11
| 21:44:13.706427 [ ] Setting name server: ['192.168.188.74']
| 21:44:13.706618 [1] No file name for incoming call config specified.
| 21:44:13.706761 [2] No file name for incoming call config specified.
| 21:44:13.706851 [3] No file name for incoming call config specified.
21:44:13.710 os_core_unix.c !pjlib 2.13 for POSIX initialized
21:44:13.712 sip_endpoint.c .Creating endpoint instance...
21:44:13.713 pjlib .select() I/O Queue created (0x7f9731f150)
21:44:13.713 sip_endpoint.c .Module "mod-msg-print" registered
21:44:13.713 sip_transport.c .Transport manager created.
21:44:13.713 pjsua_core.c .PJSUA state changed: NULL --> CREATED
21:44:13.713 sip_endpoint.c .Module "mod-pjsua-log" registered
21:44:13.714 pjsua_core.c .Nameserver 192.168.188.74 added
21:44:13.714 sip_endpoint.c .Module "mod-tsx-layer" registered
21:44:13.714 sip_endpoint.c .Module "mod-stateful-util" registered
21:44:13.714 sip_endpoint.c .Module "mod-ua" registered
21:44:13.714 sip_endpoint.c .Module "mod-100rel" registered
21:44:13.714 sip_endpoint.c .Module "mod-pjsua" registered
21:44:13.714 sip_endpoint.c .Module "mod-invite" registered
21:44:13.732 alsa_dev.c ..ALSA driver found 0 devices
21:44:13.732 alsa_dev.c ..ALSA initialized
21:44:13.732 pjlib ..select() I/O Queue created (0x7f972f6058)
21:44:13.746 sip_endpoint.c .Module "mod-evsub" registered
21:44:13.747 sip_endpoint.c .Module "mod-presence" registered
21:44:13.747 sip_endpoint.c .Module "mod-mwi" registered
21:44:13.747 sip_endpoint.c .Module "mod-refer" registered
21:44:13.747 sip_endpoint.c .Module "mod-pjsua-pres" registered
21:44:13.747 sip_endpoint.c .Module "mod-pjsua-im" registered
21:44:13.747 sip_endpoint.c .Module "mod-pjsua-options" registered
21:44:13.747 pjsua_core.c .No SIP worker threads created
21:44:13.747 pjsua_core.c .pjsua version 2.13 for Linux-6.1.21/aarch64 initialized
21:44:13.747 pjsua_core.c .PJSUA state changed: CREATED --> INIT
| 21:44:13.747754 [ ] Supported audio codecs: speex/16000/1, speex/8000/1, speex/32000/1, iLBC/8000/1, GSM/8000/1, PCMU/8000/1, PCMA/8000/1, G722/16000/1, opus/48000/2, L16/44100/2, L16/44100/1
21:44:13.747 pjsua_aud.c Setting null sound device..
21:44:13.747 pjsua_aud.c .Opening null sound device..
21:44:13.748 pjsua_core.c bind() error: Address in use [status=120098]
21:44:13.748 endpoint.cpp pjsua_transport_create(type, &tcfg, &tid) error: Address in use (status=120098) [../src/pjsua2/endpoint.cpp:2243]
Traceback (most recent call last):
File "/ha-sip/main.py", line 219, in
main()
File "/ha-sip/main.py", line 202, in main
end_point = sip.create_endpoint(endpoint_config)
File "/ha-sip/sip.py", line 31, in create_endpoint
end_point.transportCreate(pj.PJSIP_TRANSPORT_UDP, sip_tp_config)
File "/root/.local/lib/python3.10/site-packages/pjsua2-2.13-py3.10-linux-aarch64.egg/pjsua2.py", line 7196, in transportCreate
return _pjsua2.Endpoint_transportCreate(self, type, cfg)
pjsua2.Error
21:44:13.790 pjsua_core.c Shutting down, flags=0...
21:44:13.790 pjsua_core.c PJSUA state changed: INIT --> CLOSING
21:44:13.790 pjsua_call.c .Hangup all calls..
21:44:13.790 pjsua_media.c .Call 0: deinitializing media..
21:44:13.790 pjsua_media.c .Call 1: deinitializing media..
21:44:13.790 pjsua_media.c .Call 2: deinitializing media..
21:44:13.790 pjsua_media.c .Call 3: deinitializing media..
21:44:13.790 pjsua_pres.c .Shutting down presence..
21:44:14.794 pjsua_core.c .Destroying...
21:44:14.795 pjsua_media.c .Shutting down media..
21:44:14.795 pjsua_aud.c ...Closing null sound device..
21:44:14.808 sip_transaction.c .Stopping transaction layer module
21:44:14.808 sip_transaction.c .Stopped transaction layer module
21:44:14.808 sip_endpoint.c .Module "mod-pjsua-options" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-pjsua-im" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-pjsua-pres" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-pjsua" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-stateful-util" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-refer" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-mwi" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-presence" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-evsub" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-invite" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-100rel" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-ua" unregistered
21:44:14.808 sip_transaction.c .Transaction layer module destroyed
21:44:14.808 sip_endpoint.c .Module "mod-tsx-layer" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-msg-print" unregistered
21:44:14.808 sip_endpoint.c .Module "mod-pjsua-log" unregistered
21:44:14.809 timer.c .Dumping timer heap:
21:44:14.809 timer.c . Cur size: 0 entries, max: 3070
21:44:14.809 sip_endpoint.c .Endpoint 0x7f97403408 destroyed
21:44:14.809 pjsua_core.c .PJSUA state changed: CLOSING --> NULL
21:44:14.809 pjsua_core.c .PJSUA destroyed...
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
Using FritzBox 7590 on OS version 7.57, Addon on Version 3.2, HA Core 2023.11.3, Supervisor 2023.11.6, OS 11.2
I have an automation (and script) set up to first, dial a number (script) then wait until a webhook is called, then sending a DTMF job to press #1
. Lastly the automation ends the call.
Now the problem is that if I am using the addon to call my mobile phone internally (via the **620) it just works. You may recognize that that is indeed not a problem. And you would be correct. My phone rings, the timeout is set to 15s, if I answer in those 15s I can hear how the caller (homeassistant) is pressing both buttons and then ending the call.
The Problem arrises however when I change the internal call number to the **2 (my intercom). The logs don't show any errors (at least I think) but the intercom station is still not able to open the door. (I tested and the exact same prosedure is working when calling internally from my mobile phone via the Fritz!FON app or using a telephone.)
Here is my HA-SIP config:
sip:
enabled: true
registrar_uri: sip:fritz.box
id_uri: sip:[email protected]
realm: "*"
user_name: homeassistant
password: password
answer_mode: listen
settle_time: 1
incoming_call_file: ""
My script for dialing the call:
alias: DialDoorOpenener
sequence:
- service: hassio.addon_stdin
data:
addon: c7744bff_ha-sip
input:
command: dial
number: sip:**[email protected]
ring_timeout: 15
sip_account: 1
webhook_to_call:
call_established: "-huv8wswQGAIDUwLNPy3j14pK"
mode: single
icon: mdi:key-chain
My automation for reacting to the sent webhook, pressing the buttons and ending the call:
alias: React to open door call
description: ""
trigger:
- platform: webhook
allowed_methods:
- POST
- PUT
local_only: true
webhook_id: "-huv8wswQGAIDUwLNPy3j14pK"
id: webhook
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- webhook
sequence:
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- service: hassio.addon_stdin
data:
addon: c7744bff_ha-sip
input:
command: send_dtmf
number: sip:**[email protected]
digits: "#1"
method: sip_info
- service: hassio.addon_stdin
data:
addon: c7744bff_ha-sip
input:
command: hangup
number: sip:**[email protected]
sip_account: 1
default:
- service: notify.mobile_app_nothing_phone_1
data:
message: Nope
mode: single
Here are the logs after running the first script (all that I could export at least since HA doesnt keep them for long):
Signal=1
Duration=180
--end msg--
00:10:28.725 pjsua_core.c .RX 441 bytes Response msg 200/INFO/cseq=29815 (rdata0x7fa8aa7088) from UDP 192.168.2.1:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.2.13:5060;rport=5060;branch=z9hG4bKPjnGra0cUdsXb7YeaHeol94nRjb-W4VAxT
From: <sip:[email protected]>;tag=cOOSp.K-dRWkeMw7FR8eWMp3uei3Un1l
To: <sip:**[email protected]>;tag=82576A769B7CB897
Call-ID: KpsWo5BMNAw54BGJT8Mep7MEN6Y0PaXk
CSeq: 29815 INFO
User-Agent: AVM FRITZ!Box 7590 154.07.57 (Sep 2 2023)
Supported: 100rel,replaces,timer
Allow-Events: telephone-event,refer
Content-Length: 0
--end msg--
00:10:28.725 pjsua_call.c .....Call 2: DTMF sent successfully with INFO
00:10:28.727 pjsua_core.c .RX 441 bytes Response msg 200/INFO/cseq=29816 (rdata0x7fa8aa7098) from UDP 192.168.2.1:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.2.13:5060;rport=5060;branch=z9hG4bKPj63uINkZymrG9czKsx0AO.oFb2fPzbUjw
From: <sip:[email protected]>;tag=cOOSp.K-dRWkeMw7FR8eWMp3uei3Un1l
To: <sip:**[email protected]>;tag=82576A769B7CB897
Call-ID: KpsWo5BMNAw54BGJT8Mep7MEN6Y0PaXk
CSeq: 29816 INFO
User-Agent: AVM FRITZ!Box 7590 154.07.57 (Sep 2 2023)
Supported: 100rel,replaces,timer
Allow-Events: telephone-event,refer
Content-Length: 0
--end msg--
00:10:28.727 pjsua_call.c .....Call 2: DTMF sent successfully with INFO
| 00:10:28.760978 [ ] Got "hangup" command for sip:**[email protected]
| 00:10:28.761258 [1] Hang-up.
00:10:28.761 pjsua_call.c Call 2 hanging up: code=0..
00:10:28.761 pjsua_media.c .Call 2: deinitializing media..
00:10:28.761 pjsua_media.c ..
[CONFIRMED] To: sip:**[email protected];tag=82576A769B7CB897
Call time: 00h:00m:03s, 1st res in 86 ms, conn in 851ms
#0 audio iLBC @8kHz, sendrecv, peer=192.168.2.1:7082
SRTP status: Not active Crypto-suite:
ICE role: Unknown, state: Candidate Gathering, comp_cnt: 2
RX pt=99, last update:00h:00m:02.733s ago
total 103pkt 5.1KB (9.2KB +IP hdr) @avg=13.2Kbps/23.8Kbps
pkt loss=0 (0.0%), discrd=0 (0.0%), dup=0 (0.0%), reord=0 (0.0%)
(msec) min avg max last dev
loss period: 0.000 0.000 0.000 0.000 0.000
jitter : 0.125 1.646 4.125 3.875 0.694
TX pt=99, ptime=30, last update:00h:00m:01.388s ago
total 21pkt 1.0KB (1.8KB +IP hdr) @avg=2.7Kbps/4.8Kbps
pkt loss=0 (0.0%), dup=0 (0.0%), reorder=0 (0.0%)
(msec) min avg max last dev
loss period: 0.000 0.000 0.000 0.000 0.000
jitter : 7.500 7.500 7.500 7.500 0.000
RTT msec : 0.000 0.000 0.000 0.000 0.000
00:10:28.762 pjsua_media.c ...Media stream call02:0 is destroyed
00:10:28.762 icetp00 ..Stopping ICE, reason=media stop requested
00:10:28.762 srtp0x7fa7c5e830 ..Destroying SRTP transport
00:10:28.762 icetp00 ..Destroying ICE transport
00:10:28.762 ice_session.c ..ICE session 0x7fa7eac5d8 destroyed
00:10:28.762 icetp00 ..ICE stream transport 0x7fa7c2d268 destroyed
00:10:28.763 icetp00 ..ICE transport destroyed
00:10:28.763 srtp0x7fa7c5e830 ..SRTP transport destroyed
| 00:10:28.763252 [1] Call disconnected
| 00:10:28.763508 [ ] Calling webhook sip_call_webhook_id with data {'event': 'call_disconnected', 'caller': 'sip:**[email protected]', 'parsed_caller': '**2', 'sip_account': 1}
| 00:10:28.784424 [ ] Webhook response 200 b''
| 00:10:28.785529 [ ] Remove from state: sip:**[email protected]
00:10:28.785 pjsua_core.c ....TX 368 bytes Request msg BYE/cseq=29817 (tdta0x7fa7c307e8) to UDP 192.168.2.1:5060:
BYE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.2.13:5060;rport;branch=z9hG4bKPjW2ySd.WGXf2Yx1WiaLnou4TjgSX.ta9y
Max-Forwards: 70
From: sip:[email protected];tag=cOOSp.K-dRWkeMw7FR8eWMp3uei3Un1l
To: sip:**[email protected];tag=82576A769B7CB897
Call-ID: KpsWo5BMNAw54BGJT8Mep7MEN6Y0PaXk
CSeq: 29817 BYE
Content-Length: 0
--end msg--
00:10:28.792 pjsua_core.c .RX 724 bytes Response msg 200/BYE/cseq=29817 (rdata0x7fa8aa70a8) from UDP 192.168.2.1:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.2.13:5060;rport=5060;branch=z9hG4bKPjW2ySd.WGXf2Yx1WiaLnou4TjgSX.ta9y
From: <sip:[email protected]>;tag=cOOSp.K-dRWkeMw7FR8eWMp3uei3Un1l
To: <sip:**[email protected]>;tag=82576A769B7CB897
Call-ID: KpsWo5BMNAw54BGJT8Mep7MEN6Y0PaXk
CSeq: 29817 BYE
X-RTP-Stat: CS=0;PS=56;ES=195;OS=2800;SP=0/0;SO=0;QS=-;PR=52;ER=195;OR=6010;CR=0;SR=0;QR=-;PL=0,0;BL=0;LS=0;RB=0/0;SB=-/-;EN=iLBC-30,G722;DE=iLBC-30,G722;JI=60,31;DL=1,1,1;IP=192.168.2.1:7082,192.168.2.13:4030
X-RTP-Stat-Add: DQ=4;DSS=0;DS=0;PLCS=8704;JS=64
X-SIP-Stat: DRT=0;IR=0
User-Agent: AVM FRITZ!Box 7590 154.07.57 (Sep 2 2023)
Supported: 100rel,replaces,timer
Allow-Events: telephone-event,refer
Content-Length: 0
--end msg--
00:10:29.763 pjsua_aud.c Closing sound device after idle for 1 second(s)
00:10:29.763 pjsua_aud.c .Closing null sound device..
The README describes that you can use sip_1 to register a 2nd SIP account. In my Local installation the 2nd account is not handled and as I see in the current man branch the sip_1 config is not used.
Hello @arnonym,
For some time not i have installed your "add-on" running on a RPi4b 2GB and i have my system setup as you shown on the main page.
I added the automation to call my dect phone as well like you have shown. Sadly my phone is not being called,
In the add-on log log i see the following messages:
15:21:41.954 pjsua_core.c .TX 513 bytes Request msg REGISTER/cseq=25401 (tdta0x2ec29998) to UDP 192.168.178.1:5060:
REGISTER sip:fritz.box SIP/2.0
Via: SIP/2.0/UDP 192.168.178.49:5060;rport;branch=z9hG4bKPj1kx6M2IJGqmSsvCtC07fQv3WrnNSzTOU
Max-Forwards: 70
From: <sip:[email protected]>;tag=aNERO89mIhifqETHj78u.LBrDplL4xyA
To: <sip:[email protected]>
Call-ID: SPEPR-8xLjuWNUJVU48wvEzTxJhzRjV5
CSeq: 25401 REGISTER
Contact: <sip:[email protected]:5060;ob>;+sip.ice
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length: 0
--end msg--
every 4 seconds and when i try to call i see:
5:25:56.593 pjsua_core.c .TX 1702 bytes Request msg INVITE/cseq=15482 (tdta0x2ec32978) to UDP 192.168.178.1:5060:
INVITE sip:**[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.178.49:5060;rport;branch=z9hG4bKPjMuGiUKbBRSiTUz3rkwPvMJYE6UXvoKC1
Max-Forwards: 70
From: sip:[email protected];tag=8ublClS08Xgzbq6Qd-p7QzTHnFPi-uWW
To: sip:**[email protected]
Contact: <sip:[email protected]:5060;ob>;+sip.ice
Call-ID: C9rDQGJOwslLEWV88PNbbW3.9Ej1.QHM
CSeq: 15482 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
Content-Type: application/sdp
Content-Length: 1096
v=0
o=- 3880103149 3880103149 IN IP4 192.168.178.49
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4005 RTP/AVP 96 97 98 99 3 0 8 9 120 121 122
c=IN IP4 192.168.178.49
b=TIAS:64000
a=rtcp:4034 IN IP4 192.168.178.49
a=sendrecv
a=rtpmap:96 speex/16000
a=rtpmap:97 speex/8000
a=rtpmap:98 speex/32000
a=rtpmap:99 iLBC/8000
a=fmtp:99 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:120 telephone-event/16000
a=fmtp:120 0-16
a=rtpmap:121 telephone-event/8000
a=fmtp:121 0-16
a=rtpmap:122 telephone-event/32000
a=fmtp:122 0-16
a=ssrc:625480157 cname:53a1fecf5b3591b7
a=ice-ufrag:2970b647
a=ice-pwd:3fae5d3f5594acb4432232b2
a=candidate:Hc0a8b231 1 UDP 2130706431 192.168.178.49 4005 typ host
a=candidate:Hac11e801 1 UDP 2130706175 172.17.232.1 4005 typ host
a=candidate:Hac1e2001 1 UDP 2130705919 172.30.32.1 4005 typ host
a=candidate:Hc0a8b231 2 UDP 2130706430 192.168.178.49 4034 typ host
a=candidate:Hac11e801 2 UDP 2130706174 172.17.232.1 4034 typ host
a=candidate:Hac1e2001 2 UDP 2130705918 172.30.32.1 4034 typ host
--end msg--
not sure what it all means. so i hope you can help out?
thanks
HA-SIP not working with this Version
No logs even pull up for me
Hey, I found your project in the HA forums and it works out of the box for my use case. Thank you very much for your effort on making DTMF call tones usable in HA, this was another missing piece in my home automation paradise. :-)
Unfortunately, I'm not able to enter codes that are longer than one digit, that limits me to only 12 (1...9|*|#) possible codes but much more interesting: It could be used as a kind of "pin code" detection and offer endless possibilities with SIP and DTMF. :-)
Are you planning to implement this feature or is it possible to extend the digit detection to more digits and I simply missed the according configuration option? Give me a hint if I can help you out on this.
I made a phone assistant.
But If i make a call to home for the 2nd time the automation hangs after i Press a 2.
I think something is unstable in the menu code. Automations that directly trigger a action and hangup when a call is made dont have this particular issue.
code in community post.
https://community.home-assistant.io/t/asterisk-incomming-call-assistant/480823
13:30:24.602 icetp00 Stopping ICE, reason=No ICE found in SDP offer
13:30:24.602 icetp00 Destroying ICE session 0x3efe76a8
13:30:24.602 pjsua_call.c Answering call 1: code=180
13:30:24.604 pjsua_core.c ....TX 521 bytes Response msg 180/INVITE/cseq=4398 (tdta0x3efd97d8) to UDP 192.168.5.14:5060:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.5.14:5060;rport=5060;received=192.168.5.14;branch=z9hG4bKPjf117efa4-97e7-4ba8-b726-e6b7860d488c
Call-ID: 0e0c1edc-d391-4b91-830b-9dd8a762f7a6
From: <sip:[email protected]>;tag=2c9f594d-5c59-4698-b292-6270aaea6f4d
To: <sip:[email protected];ob>;tag=kTKXX-ovE7OeSBTcEnraYmsBzK.-zem-
CSeq: 4398 INVITE
Contact: <sip:[email protected]:5060;ob>;+sip.ice
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length: 0
--end msg--
| Early
| Got "answer" command for 5555
| Trigger answer of call (if not established already)
| Call will be answered now.
13:30:25.680 pjsua_call.c Answering call 1: code=200
13:30:25.680 inv0x3efb6a68 ..SDP negotiation done: Success
13:30:25.680 pjsua_media.c ...Call 1: updating media..
13:30:25.680 pjsua_media.c .....Media stream call01:0 is destroyed
13:30:25.680 pjsua_aud.c ....Audio channel update..
13:30:25.681 strm0x3efcc3d8 .....VAD temporarily disabled
13:30:25.681 strm0x3efcc3d8 .....Encoder stream started
13:30:25.681 strm0x3efcc3d8 .....Decoder stream started
13:30:25.681 pjsua_media.c ....Audio updated, stream #0: PCMA (sendrecv)
| onCallMediaState call info state 3
| Connected media 1
13:30:25.682 pjsua_core.c ....TX 967 bytes Response msg 200/INVITE/cseq=4398 (tdta0x3efdc328) to UDP 192.168.5.14:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.5.14:5060;rport=5060;received=192.168.5.14;branch=z9hG4bKPjf117efa4-97e7-4ba8-b726-e6b7860d488c
Call-ID: 0e0c1edc-d391-4b91-830b-9dd8a762f7a6
From: <sip:[email protected]>;tag=2c9f594d-5c59-4698-b292-6270aaea6f4d
To: <sip:[email protected];ob>;tag=kTKXX-ovE7OeSBTcEnraYmsBzK.-zem-
CSeq: 4398 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Contact: <sip:[email protected]:5060;ob>;+sip.ice
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800;refresher=uac
Require: timer
Content-Type: application/sdp
Content-Length: 316
v=0
o=- 3876121824 3876121825 IN IP4 192.168.5.20
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4027 RTP/AVP 8 101
c=IN IP4 192.168.5.20
b=TIAS:64000
a=rtcp:4018 IN IP4 192.168.5.20
a=sendrecv
a=rtpmap:8 PCMA/8000
a=ssrc:1521919759 cname:330142fb00e29128
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
--end msg--
| Call connecting...
13:30:25.685 pjsua_core.c .RX 431 bytes Request msg ACK/cseq=4398 (rdata0x3efad608) from UDP 192.168.5.14:5060:
ACK sip:[email protected]:5060;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.5.14:5060;rport;branch=z9hG4bKPj5162f819-35ed-430d-9214-220be191c771
From: <sip:[email protected]>;tag=2c9f594d-5c59-4698-b292-6270aaea6f4d
To: <sip:[email protected];ob>;tag=kTKXX-ovE7OeSBTcEnraYmsBzK.-zem-
Call-ID: 0e0c1edc-d391-4b91-830b-9dd8a762f7a6
CSeq: 4398 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 16.16.1~dfsg-1+deb11u1
Content-Length: 0
--end msg--
| Call connected
| Call is established.
| Calling webhook sip_call_webhook_id with data {'event': 'call_established', 'caller': '<sip:[email protected]>', 'parsed_caller': '5555'}
| Webhook response 200 b''
| Playing message: Goede Middag Bram Diederik. Bram is bezig Weekend vieren en kan waarschijnlijk niet de telefoon opnemen Toets 2 voor toegang of 1 voor voicemail.
13:30:27.387 pjsua_aud.c Creating file player: /tmp/tmpn2ler6ph.wav..
13:30:27.388 wav_player.c .File player '/tmp/tmpn2ler6ph.wav' created: samp.rate=24000, ch=1, bufsize=4KB, filesize=544KB
13:30:27.389 pjsua_aud.c .Player created, id=1, slot=3
13:30:27.389 pjsua_aud.c Conf connect: 3 --> 1
13:30:27.389 pjsua_aud.c .Set sound device: capture=-99, playback=-99, mode=0
13:30:27.389 pjsua_aud.c ..Null sound device, mode setting is ignored
13:30:27.389 pjsua_aud.c ..Setting null sound device..
13:30:27.389 pjsua_aud.c ...Opening null sound device..
13:30:27.389 conference.c .Port 3 (/tmp/tmpn2ler6ph.wav) transmitting to port 1 (sip:[email protected])
| No action supplied
13:30:28.032 strm0x3efcc3d8 VAD re-enabled
| Playback done.
| Scheduled post action: noop
| onDtmfDigit: digit 2
| Calling webhook sip_call_webhook_id with data {'event': 'dtmf_digit', 'caller': '<sip:[email protected]>', 'parsed_caller': '5555', 'digit': '2'}
| Webhook response 200 b''
| Current input: 2
| Playing message: welkom
Is it possible to add callers name (and vcard group) recognition based on vcards (with khard)?
asterisk does not have build in name recognition (not ldap nor vcards) nor has home assistant any contact support. (I dont think that should be in home assistant its far from designed for that. )
adding this feature is not only nice to get a name spoken out of the speakers when someone dails your home phone.
but if multiple address books can be added and the address book found can be returned you can make scripts on it.
for example transferring a call to the voicemail if its late and the person is not in the family and close friends group.
khard expects all contacts in seperated vcards that can be placed in the /share/contacts// folder for example.
Is it possible to set a other language for tts then english?
i tried
tts:
platform: google_translate
language: nl
but that is not working
almost the same error as my previous bug.
If i press a menu item before the tts menu message is finished playing the system hangs.
I tried to make a additional trigger to capture the webhook dtmf_digit event But that is also not responding.
Its hard to workaround this bug. Other then restart the whole addon some seconds after a webhook dtmf_digit from 5555 is recieved
14:19:44.889 icetp00 Candidate 4 added: comp_id=2, type=host, foundation=Hac110001, addr=172.17.0.1:4016, base=172.17.0.1:4016, prio=0x7efffefe (2130706174)
14:19:44.889 icetp00 Candidate 5 added: comp_id=2, type=host, foundation=Hac1e2001, addr=172.30.32.1:4016, base=172.30.32.1:4016, prio=0x7efffdfe (2130705918)
14:19:44.889 icetp00 Stopping ICE, reason=No ICE found in SDP offer
14:19:44.889 icetp00 Destroying ICE session 0x355a4ab8
14:19:44.890 pjsua_call.c Answering call 0: code=180
14:19:44.890 pjsua_core.c ....TX 522 bytes Response msg 180/INVITE/cseq=17299 (tdta0x355ab188) to UDP 192.168.5.14:5060:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.5.14:5060;rport=5060;received=192.168.5.14;branch=z9hG4bKPja2ff5744-b7a8-4d35-8cc7-30e04a48376b
Call-ID: 7db7bca8-2b3a-478a-bf3c-1c0b34f23e57
From: <sip:[email protected]>;tag=fa428ad8-f828-4483-8862-e20ffb477693
To: <sip:[email protected];ob>;tag=3FggVN9e0xdUQCurMe-9rXjvstCxaIvO
CSeq: 17299 INVITE
Contact: <sip:[email protected]:5060;ob>;+sip.ice
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length: 0
--end msg--
| Early
| Got "answer" command for 5555
| Trigger answer of call (if not established already)
| Call will be answered now.
14:19:45.958 pjsua_call.c Answering call 0: code=200
14:19:45.958 inv0x3558e0b8 ..SDP negotiation done: Success
14:19:45.958 pjsua_media.c ...Call 0: updating media..
14:19:45.958 pjsua_media.c .....Media stream call00:0 is destroyed
14:19:45.958 pjsua_aud.c ....Audio channel update..
14:19:45.958 strm0x355b2608 .....VAD temporarily disabled
14:19:45.958 strm0x355b2608 .....Encoder stream started
14:19:45.958 strm0x355b2608 .....Decoder stream started
14:19:45.959 pjsua_media.c ....Audio updated, stream #0: PCMA (sendrecv)
| onCallMediaState call info state 3
| Connected media 1
14:19:45.959 pjsua_core.c ....TX 968 bytes Response msg 200/INVITE/cseq=17299 (tdta0x355ae3c8) to UDP 192.168.5.14:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.5.14:5060;rport=5060;received=192.168.5.14;branch=z9hG4bKPja2ff5744-b7a8-4d35-8cc7-30e04a48376b
Call-ID: 7db7bca8-2b3a-478a-bf3c-1c0b34f23e57
From: <sip:[email protected]>;tag=fa428ad8-f828-4483-8862-e20ffb477693
To: <sip:[email protected];ob>;tag=3FggVN9e0xdUQCurMe-9rXjvstCxaIvO
CSeq: 17299 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Contact: <sip:[email protected]:5060;ob>;+sip.ice
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800;refresher=uac
Require: timer
Content-Type: application/sdp
Content-Length: 316
v=0
o=- 3876124784 3876124785 IN IP4 192.168.5.20
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4030 RTP/AVP 8 101
c=IN IP4 192.168.5.20
b=TIAS:64000
a=rtcp:4016 IN IP4 192.168.5.20
a=sendrecv
a=rtpmap:8 PCMA/8000
a=ssrc:1999995135 cname:54e9fa2627b2d09c
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
--end msg--
| Call connecting...
14:19:45.961 pjsua_core.c .RX 432 bytes Request msg ACK/cseq=17299 (rdata0x355884c8) from UDP 192.168.5.14:5060:
ACK sip:[email protected]:5060;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.5.14:5060;rport;branch=z9hG4bKPj9efa5613-abe4-4713-8aa2-80c899b01390
From: <sip:[email protected]>;tag=fa428ad8-f828-4483-8862-e20ffb477693
To: <sip:[email protected];ob>;tag=3FggVN9e0xdUQCurMe-9rXjvstCxaIvO
Call-ID: 7db7bca8-2b3a-478a-bf3c-1c0b34f23e57
CSeq: 17299 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 16.16.1~dfsg-1+deb11u1
Content-Length: 0
--end msg--
| Call connected
| Call is established.
| Calling webhook sip_call_webhook_id with data {'event': 'call_established', 'caller': '<sip:[email protected]>', 'parsed_caller': '5555'}
| Webhook response 200 b''
| Playing message: Goede Middag Bram Diederik. Bram is bezig Weekend vieren en kan waarschijnlijk niet de telefoon opnemen Toets 2 voor toegang of 1 voor voicemail.
14:19:47.677 pjsua_aud.c Creating file player: /tmp/tmp5fi37u1k.wav..
14:19:47.677 wav_player.c .File player '/tmp/tmp5fi37u1k.wav' created: samp.rate=24000, ch=1, bufsize=4KB, filesize=544KB
14:19:47.678 pjsua_aud.c .Player created, id=0, slot=2
14:19:47.678 pjsua_aud.c Conf connect: 2 --> 1
14:19:47.678 pjsua_aud.c .Set sound device: capture=-99, playback=-99, mode=0
14:19:47.678 pjsua_aud.c ..Null sound device, mode setting is ignored
14:19:47.678 pjsua_aud.c ..Setting null sound device..
14:19:47.678 pjsua_aud.c ...Opening null sound device..
14:19:47.678 conference.c .Port 2 (/tmp/tmp5fi37u1k.wav) transmitting to port 1 (sip:[email protected])
| No action supplied
14:19:48.318 strm0x355b2608 VAD re-enabled
| onDtmfDigit: digit 2
| Calling webhook sip_call_webhook_id with data {'event': 'dtmf_digit', 'caller': '<sip:[email protected]>', 'parsed_caller': '5555', 'digit': '2'}
| Webhook response 200 b''
| Current input: 2
| Playing message: welkom
Hi, i have setup succesfyll your plugin with user 6002 (asterisk endpoint), when i do this service
service: hassio.addon_stdin
data_template:
addon: c7744bff_ha-sip
input:
command: dial
number: sip:[email protected]
The linphone user doesnt ring ...
When i call [email protected] (asterisk endpoint) it succeeds
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 192.168.0.17:5061;rport;branch=z9hG4bKPjZURLwhG0FAOuo5hSKHpcglRRN70RuRBh
Max-Forwards: 70
From: sip:[email protected];tag=I3sWO3YVt8F4RUbR-9jlS-V6s3jGCIF2
To: sip:[email protected]
Contact: <sip:[email protected]:5061;ob>;+sip.ice
Call-ID: TwjO4O.-OADeTF-9erI.V0R.0JrSjPKC
CSeq: 29161 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
Content-Type: application/sdp
Content-Length: 1201
v=0
o=- 3892704120 3892704120 IN IP4 192.168.0.17
s=pjmedia
b=AS:117
t=0 0
a=X-nat:0
m=audio 4031 RTP/AVP 96 97 98 99 3 0 8 9 100 120 121 122 123
c=IN IP4 192.168.0.17
b=TIAS:96000
a=rtcp:4034 IN IP4 192.168.0.17
a=sendrecv
a=rtpmap:96 speex/16000
a=rtpmap:97 speex/8000
a=rtpmap:98 speex/32000
a=rtpmap:99 iLBC/8000
a=fmtp:99 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:100 opus/48000/2
a=fmtp:100 useinbandfec=1
a=rtpmap:120 telephone-event/16000
a=fmtp:120 0-16
a=rtpmap:121 telephone-event/8000
a=fmtp:121 0-16
a=rtpmap:122 telephone-event/32000
a=fmtp:122 0-16
a=rtpmap:123 telephone-event/48000
a=fmtp:123 0-16
a=ssrc:16499172 cname:33aa8ebe1b5caf7e
a=ice-ufrag:39a6a81a
a=ice-pwd:665644357bee0abf005d7f4b
a=candidate:Hc0a80011 1 UDP 2130706431 192.168.0.17 4031 typ host
a=candidate:Hac1e2001 1 UDP 2130706175 172.30.32.1 4031 typ host
a=candidate:Hac1ee801 1 UDP 2130705919 172.30.232.1 4031 typ host
a=candidate:Hc0a80011 2 UDP 2130706430 192.168.0.17 4034 typ host
a=candidate:Hac1e2001 2 UDP 2130706174 172.30.32.1 4034 typ host
a=candidate:Hac1ee801 2 UDP 2130705918 172.30.232.1 4034 typ host
--end msg--
Hi,
I am beginning to use this plugin and seem to be going along well.
I have used the "Call number for help" example from the homeassistant site and it works ok if I call an "external" number, like [email protected]. The tts works ok, and tts works ok to my mediaplayers at home.
The weird thing is that it does not work if I call a phone connected to my fritzbox. My fritzbox is connected directly to the internet and I am using a google wifi for my home devices. So my homeassistant is on 192.168.86.x and my fritzbox is on 192.168.189.1. The fritz.box address does not work on my home wireless network (at the moment) and I have used to ip for the sip registration.
I hope the attached log file identifies why there is no sound on the phone.
`:55:25.556 pjsua_aud.c ......Audio channel update..
19:55:25.556 ilbc0xb5046054 .......iLBC codec opened, mode=30
19:55:25.556 strm0xb5055034 .......VAD temporarily disabled
19:55:25.556 strm0xb5055034 .......Encoder stream started
19:55:25.556 strm0xb5055034 .......Decoder stream started
19:55:25.556 pjsua_media.c ......Audio updated, stream #0: iLBC (sendrecv)
| 20:59:09.557194 [1] onCallMediaState call info state 5
| 20:59:09.557517 [1] Connected media 1
08:19:58.213 strm0xb5055034 VAD re-enabled
| 20:59:10.526608 [1] Call is established.
| 20:59:10.526893 [ ] Calling webhook sip_call_webhook_id with data {'event': 'call_established', 'caller': 'sip:**[email protected]', 'parsed_caller': '**610', 'sip_account': 1}
| 20:59:10.563233 [ ] Webhook response 200 b''
| 20:59:10.563877 [1] Playing message: This is the repeating message.
| 20:59:10.587613 [ ] Getting audio from "http://192.168.86.3:8123/api/tts_proxy/c59c73a5b9f55907d78e3b056d08773343623ae6_en_-_google_translate.mp3"
16:34:38.793 pjsua_aud.c !Creating file player: /tmp/tmpnvakqa72.wav..
16:34:38.793 wav_player.c .File player '/tmp/tmpnvakqa72.wav' created: samp.rate=24000, ch=1, bufsize=4KB, filesize=119KB
16:34:38.793 pjsua_aud.c .Player created, id=2, slot=4
16:34:38.793 pjsua_aud.c Conf connect: 4 --> 1
16:34:38.793 conference.c .Port 4 (/tmp/tmpnvakqa72.wav) transmitting to port 1 (sip:**[email protected])
| 20:59:10.793615 [1] No action supplied
| 20:59:13.293075 [1] Playback done.
| 20:59:13.303426 [1] Scheduled post action: repeat_message
| 20:59:13.303829 [1] Playing message: This is the repeating message.
| 20:59:13.331658 [ ] Getting audio from "http://192.168.86.3:8123/api/tts_proxy/c59c73a5b9f55907d78e3b056d08773343623ae6_en_-_google_translate.mp3"
04:54:57.539 pjsua_aud.c !Destroying player 2..
04:54:57.539 pjsua_aud.c Creating file player: /tmp/tmpzs64qzs4.wav..
11:23:13.540 wav_player.c .File player '/tmp/tmpzs64qzs4.wav' created: samp.rate=24000, ch=1, bufsize=4KB, filesize=119KB
11:23:13.540 pjsua_aud.c .Player created, id=2, slot=4
11:23:13.540 pjsua_aud.c Conf connect: 4 --> 1
11:23:13.540 conference.c .Port 4 (/tmp/tmpzs64qzs4.wav) transmitting to port 1 (sip:**[email protected])
| 20:59:16.053541 [1] Playback done.
| 20:59:16.070702 [1] Scheduled post action: repeat_message
| 20:59:16.070952 [1] Playing message: This is the repeating message.
| 20:59:16.100108 [ ] Getting audio from "http://192.168.86.3:8123/api/tts_proxy/c59c73a5b9f55907d78e3b056d08773343623ae6_en_-_google_translate.mp3"
20:12:20.304 pjsua_aud.c !Destroying player 2..
02:40:36.305 pjsua_aud.c Creating file player: /tmp/tmpvxr14bwz.wav..
02:40:36.305 wav_player.c .File player '/tmp/tmpvxr14bwz.wav' created: samp.rate=24000, ch=1, bufsize=4KB, filesize=119KB
02:40:36.305 pjsua_aud.c .Player created, id=2, slot=4
02:40:36.305 pjsua_aud.c Conf connect: 4 --> 1
02:40:36.305 conference.c .Port 4 (/tmp/tmpvxr14bwz.wav) transmitting to port 1 (sip:**[email protected])
13:27:00.659 pjsua_core.c .RX 774 bytes Request msg BYE/cseq=26140 (rdata0xb4fdd0b4) from UDP 192.168.189.1:5060:
BYE sip:[email protected]:5060;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.189.1:5060;branch=z9hG4bKF2DBDF21E0EAE5A8
From: <sip:**[email protected]>;tag=4916BAAA0EF82B76
To: <sip:[email protected]>;tag=UBALvLVX8I7v-xMPfgZXJ0jNjcoLQcDX
Call-ID: MOwAoJuEb4Lv9kwU0cuMId0U8XbLRBXO
CSeq: 26140 BYE
X-RTP-Stat: CS=0;PS=214;ES=462;OS=10700;SP=0/0;SO=0;QS=-;PR=0;ER=462;OR=0;CR=0;SR=0;QR=-;PL=0,0;BL=0;LS=0;RB=0/0;SB=0/0;EN=iLBC-30,G722;DE=;JI=0,0;DL=0,0,0;IP=192.168.189.1:7080,192.168.86.3:4019
X-RTP-Stat-Add: DQ=0;DSS=0;DS=0;PLCS=0;JS=0
X-SIP-Stat: DRT=0;IR=0
Reason: Q.850; cause=16
Max-Forwards: 70
User-Agent: AVM FRITZ!Box 7490 (UI) 113.07.29 (Oct 26 2021)
Supported: 100rel,replaces,timer
Allow-Events: telephone-event,refer
Content-Length: 0
--end msg--
20:55:16.660 pjsua_core.c .......TX 319 bytes Response msg 200/BYE/cseq=26140 (tdta0xb511eb34) to UDP 192.168.189.1:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.189.1:5060;received=192.168.189.1;branch=z9hG4bKF2DBDF21E0EAE5A8
Call-ID: MOwAoJuEb4Lv9kwU0cuMId0U8XbLRBXO
From: <sip:**[email protected]>;tag=4916BAAA0EF82B76
To: <sip:[email protected]>;tag=UBALvLVX8I7v-xMPfgZXJ0jNjcoLQcDX
CSeq: 26140 BYE
Content-Length: 0
--end msg--
20:55:16.660 pjsua_media.c ......Call 1: deinitializing media..
20:55:16.660 pjsua_media.c .......
[DISCONNCTD] To: sip:**[email protected];tag=4916BAAA0EF82B76
Call time: 00h:00m:07s, 1st res in 106 ms, conn in 2203ms
#0 audio iLBC @8kHz, sendrecv, peer=-
SRTP status: Not active Crypto-suite:
ICE role: Unknown, state: Candidate Gathering, comp_cnt: 2
RX pt=99, last update:00h:00m:02.225s ago
total 0pkt 0B (0B +IP hdr) @avg=0bps/0bps
pkt loss=0 (0.0%), discrd=0 (0.0%), dup=0 (0.0%), reord=0 (0.0%)
(msec) min avg max last dev
loss period: 0.000 0.000 0.000 0.000 0.000
jitter : 0.000 0.000 0.000 0.000 0.000
TX pt=99, ptime=30, last update:never
total 181pkt 9.0KB (16.2KB +IP hdr) @avg=10.1Kbps/18.3Kbps
pkt loss=0 (0.0%), dup=0 (0.0%), reorder=0 (0.0%)
(msec) min avg max last dev
loss period: 0.000 0.000 0.000 0.000 0.000
jitter : 0.000 0.000 0.000 0.000 0.000
RTT msec : 0.000 0.000 0.000 0.000 0.000
03:23:32.661 pjsua_media.c ........Media stream call01:0 is destroyed
03:23:32.661 icetp00 .......Stopping ICE, reason=media stop requested
03:23:32.661 ice_session.c .......ICE session 0xb6a5d9a4 destroyed
03:23:32.661 icetp00 .......ICE stream transport 0xb52dc004 destroyed
| 20:59:16.661804 [1] Call disconnected
| 20:59:16.662350 [ ] Calling webhook sip_call_webhook_id with data {'event': 'call_disconnected', 'caller': 'sip:**[email protected]', 'parsed_caller': '**610', 'sip_account': 1}
| 20:59:16.691315 [ ] Webhook response 200 b''
| 20:59:16.692056 [ ] Remove from state: sip:**[email protected]
20:55:17.660 pjsua_aud.c Closing sound device after idle for 1 second(s)
20:55:17.660 pjsua_aud.c .Closing null sound device..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.