BelledonneCommunications / flexisip

Linphone.org mirror for flexisip (git://git.linphone.org/flexisip.git)
http://flexisip.org
GNU Affero General Public License v3.0
140 stars 68 forks source link

Receives INVITE, sends push notification and then doesn't wait for linphone to connect #59

Open brianjmurrell opened 5 years ago

brianjmurrell commented 5 years ago

I've got a flexisip installation here proxying an Asterisk instance with a Linphone feature/release-4.1 client enabled for push.

If I make a call to the linphone client after it registers to the proxy and is still running on the phone everything works fine.

However if I terminate the linphone client (recall, enabled for push, so this should work fine), when flexisip receives the INVITE from Asterisk to forward to linphone, it sends a push notification to the firebase server and then immediately tries to send an INVITE to linphone. That INVITE is of course refused because linphone has not had enough time to start and REGISTER in response to the push, but flexisip then immediately responds to asterisk with a 503 response.

Shouldn't there be some waiting and retrying going on here to allow linphone to be woken and REGISTER rather than immediately sending a 503 to the PBX?

Here's the flexisip log.

Sterlin11 commented 12 months ago

OMG,How did you managed to send push notification ??

brianjmurrell commented 12 months ago

I have some hackery around Asterisk that sends pushes. It consists of an AGI script and some asterisk configuration (i.e. AMI at least) that I probably don't remember the entirety of.

At this point in time, it's left to the reader to figure out how to make it all work. PRs with some instructions if you figure it out are welcome. Maybe one day I will get some time to document the entire set up.

SafeSoft-tlt commented 12 months ago

Do you have your own build of Linphone?Without this, you will not be able to push notifications. 20.07.2023, 19:01, "Brian J. Murrell" @.>: I have some hackery around Asterisk that sends pushes. It consists of an AGI script and some asterisk configuration (i.e. AMI at least) that I probably don't remember the entirety of.At this point in time, it's left to the reader to figure out how to make it all work. PRs with some instructions if you figure it out are welcome. Maybe one day I will get some time to document the entire set up.—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.>

brianjmurrell commented 12 months ago

@SafeSoft-tlt Yes, of course. As you say, you need to build your own Linphone to bake in your own FCS account number.

I take advantage of having my own build of Linphone to do other things also such as enable the Google Cloud backup feature for the app as well as a number of other small hacks.

SafeSoft-tlt commented 12 months ago

This is what I found in my archive. It's hard for me to remember what I was doing there. There is even a source on GitHub. Look for my name and there will be a link. The code is old.Message ID: @.***>

SafeSoft-tlt commented 12 months ago

[global]debug=truelog-level=debugsyslog-level=debuguser-errors-logs=truedump-corefiles=trueauto-respawn=truealiases=localhost default-servers=proxytransports=sip:tls-certificates-dir=/etc/flexisip/tls/tls-ciphers=HIGH:!SSLv2:!SSLv3:!TLSv1:!EXP:!ADH:!RC4:!3DES:!aNULL:!eNULLidle-timeout=3600keepalive-interval=1800proxy-to-proxy-keepalive-interval=0require-peer-certificate=falsetransaction-timeout=32000udp-mtu=1460enable-snmp=trueunique-id=plugins-dir=/opt/belledonne-communications/lib64/flexisip/plugins/plugins=[cluster]enabled=falsecluster-domain=nodes=internal-transport=sip:%auto:5059;transport=tcp[mdns-register]enabled=falsemdns-priority=0mdns-weight=100mdns-ttl=3600[event-logs]enabled=falselogger=filesystemdir=/var/log/flexisipdatabase-backend=mysqldatabase-connection-string=db='mydb' user='myuser' password='mypass' host='myhost.com'database-max-queue-size=100database-nb-threads-max=10[monitor]enabled=falsetest-interval=30logfile=/var/log/flexisip/flexisip_monitor.logswitch-port=12345password-salt=[stun-server]enabled=falsebind-address=0.0.0.0port=3478[presence-server]enabled=falsetransports=sip:127.0.0.1:5065;transport=tcpexpires=600notify-limit=200leak-detector=falselong-term-enabled=truebypass-condition=falseexternal-list-subscription-request=soci-connection-string=max-thread=50max-thread-queue-size=50[conference-server]enabled=falsetransport=sip:127.0.0.1:6064;transport=tcpconference-factory-uri=enable-one-to-one-chat-room=trueoutbound-proxy=sip:127.0.0.1:5060;transport=tcpdatabase-backend=mysqldatabase-connection-string=db='mydb' user='myuser' password='mypass' host='myhost.com'check-capabilities=true[module::DoSProtection]enabled=falsefilter=time-period=3000packet-rate-limit=20ban-time=2iptables-chain=FLEXISIP[module::SanityChecker]enabled=truefilter=[module::GarbageIn]enabled=truefilter=false[module::NatHelper]enabled=falsefilter= !(user-agent contains 'No NatHelper')contact-verified-param=verifiedfix-record-routes=truefix-record-routes-policy=safe[module::Authentication]enabled=falsefilter=auth-domains=trusted-hosts=db-implementation=socisoci-password-request=select password, 'MD5' from flexisip where login = :id and domain = :domainsoci-user-with-phone-request=soci-users-with-phones-request=soci-connection-string=db=asterisk user=root password='root1234' host=astp3.internal.uzgent.besoci-backend=mysqlsoci-poolsize=100soci-max-queue-size=1000available-algorithms=MD5hashed-passwords=truenonce-expires=3600cache-expire=1800no-403=falsetrusted-client-certificates=new-auth-on-407=falseenable-test-accounts-creation=falsedisable-qop-auth=false[module::Redirect]enabled=falsefilter=contact=[module::Presence]enabled=falsefilter=is_request && (request.method-name == 'PUBLISH' || request.method-name == 'NOTIFY' || request.method-name == 'SUBSCRIBE')presence-server=sip:127.0.0.1:5065;transport=tcponly-list-subscription=falsecheck-domain-in-presence-results=false[module::Registrar]enabled=truefilter=reg-domains=*reg-on-response=truemax-contacts-by-aor=12unique-id-parameters=+sip.instance pn-tok linemax-expires=86400min-expires=60force-expires=-1static-records-file=static-records-timeout=600db-implementation=internalredis-server-domain=localhostredis-server-port=6379redis-auth-password=redis-server-timeout=1500redis-record-serializer=protobufredis-slave-check-period=60service-route=name-message-expires=message-expiresregister-expire-randomizer-max=0[module::StatisticsCollector]enabled=falsefilter=is_request && request.method-name == 'PUBLISH'collector-address=[module::Router]enabled=truefilter=(is_request && request.uri.params contains 'doroute') || is_responseuse-global-domain=falsefork=truestateful=truefork-late=truefork-no-global-decline=falsetreat-decline-as-urgent=falsetreat-all-as-urgent=falsecall-fork-timeout=90call-fork-urgent-timeout=5call-fork-current-branches-timeout=10call-push-response-timeout=0message-fork-late=truemessage-delivery-timeout=3600message-accept-timeout=15fallback-route=allow-target-factorization=falsegenerated-contact-route=generated-contact-expected-realm=generate-contact-even-on-filled-aor=falseremove-to-tag=preroute=resolve-routes=trueparent-domain-fallback=false[module::PushNotification]enabled=truefilter=timeout=0max-queue-size=100time-to-live=2592000apple=falseapple-certificate-dir=/etc/flexisip/apngoogle=falsegoogle-projects-api-keys=firebase=truefirebase-projects-api-keys=windowsphone=falsewindowsphone-package-sid=windowsphone-application-secret=no-badge=falseexternal-push-uri=external-push-method=GET[module::MediaRelay]enabled=falsefilter=nortpproxy=nortpproxysdp-port-range-min=1024sdp-port-range-max=65535bye-orphan-dialogs=falsemax-calls=0force-relay-for-non-ice-targets=trueprevent-loops=falseearly-media-relay-single=truemax-early-media-per-call=0inactivity-period=3600force-public-ip-for-sdp-masquerading=false[module::Transcoder]enabled=truefilter=jb-nom-size=0rc-user-agents=audio-codecs=pcma/8000 gsm/8000 telephone-event/8000remove-bw-limits=falseblock-retransmissions=false[module::Forward]enabled=truefilter=route=sip::5060add-path=truerewrite-req-uri=falsedefault-transport=tcpparams-to-remove=pn-tok pn-type app-id pn-msg-str pn-call-str pn-call-snd pn-msg-snd pn-timeout[inter-domain-connections]accept-domain-registrations=falseassume-unique-domains=falsedomain-registrations=/etc/flexisip/domain-registrations.confverify-server-certs=truekeepalive-interval=30reg-when-needed=false[module::ContactRouteInserter]enabled=true#insert-domain=truemasquerade-contacts-on-registers=truemasquerade-contacts-for-invites=falseinsert-domain=false20.07.2023, 21:29, "Brian J. Murrell" @.***>: @SafeSoft-tlt Yes, of course. As you say, you need to build your own linphone to bake in your own FCS account number.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>