ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Asterisk 16/18 with push notification

    IT Discussion
    asterisk voip telephony sip telephony voip
    3
    23
    3.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rickygm @JaredBusch
      last edited by rickygm

      @jaredbusch it's not spam my friend, it's a real problem 🙂 , I would be grateful for help.

      1 Reply Last reply Reply Quote 0
      • JaredBuschJ
        JaredBusch
        last edited by

        @rickygm said in Asterisk 16/18 with push notification:

        @jaredbusch it's not spam my friend, it's a real problem 🙂 , I would be grateful for help.

        I'm home now and looked at this briefly.
        Interesting solution.

        Honestly, I would need to look at the results of this original script on a CHAN_SIP system before I could troubleshoot a CHAN_PJSIP system.

        The original script is tailing the log for SIP registrations and then piping the peer detials into a sed command that makes no sense.

        TK=$(asterisk -r -x "sip show peer $US" | sed -n "s/.*pn-prid=\(.*\):remote&.*/\1/p")
        

        What is pn-prid in the return of a sip show peer XXX? Because that value is what it is looking for. The only system I have current access to with chan_sip in use, only uses it for a trunk and that does not contain pn-pid.

        R 1 Reply Last reply Reply Quote 0
        • JaredBuschJ
          JaredBusch
          last edited by

          Based on what you did to the script, it appears it may be the PJSIP AOR?

          R 1 Reply Last reply Reply Quote 0
          • R
            rickygm @JaredBusch
            last edited by rickygm

            @jaredbusch Hi jaredbusch , I set up an environment with asterisk 13 and chan_sip to see if it worked, but it doesn't work either, it doesn't save the records in the mysql db, I thought I had something wrong in the script modified for pjsip, the project is based on FreePbx, I have asked the developer on github but he doesn't answer about the MySQL db.

            JaredBuschJ 1 Reply Last reply Reply Quote 0
            • R
              rickygm @JaredBusch
              last edited by

              @jaredbusch yes, this is the data with which the endpoint could be contacted.

              1 Reply Last reply Reply Quote 0
              • JaredBuschJ
                JaredBusch @rickygm
                last edited by

                @rickygm said in Asterisk 16/18 with push notification:

                I set up an environment with asterisk 13 and chan_sip

                From the command line on this system:

                ## replace NNN with a vaild, registered extension
                
                rasterisk -x 'sip show peer NNN' | pastebin
                

                Then post the pastebin link here.

                R 2 Replies Last reply Reply Quote 0
                • R
                  rickygm @JaredBusch
                  last edited by

                  @jaredbusch said in Asterisk 16/18 with push notification:

                  @rickygm said in Asterisk 16/18 with push notification:

                  I set up an environment with asterisk 13 and chan_sip

                  From the command line on this system:

                  ## replace NNN with a vaild, registered extension
                  
                  rasterisk -x 'sip show peer NNN' | pastebin
                  

                  Then post the pastebin link here.

                  Ok JaredBusch , share the link of script

                  https://pastebin.com/CBK7Liyy

                  and debug

                  https://pastebin.com/V3kPhYBY

                  1 Reply Last reply Reply Quote 0
                  • R
                    rickygm @JaredBusch
                    last edited by

                    @jaredbusch said in Asterisk 16/18 with push notification:

                    @rickygm said in Asterisk 16/18 with push notification:

                    I set up an environment with asterisk 13 and chan_sip

                    From the command line on this system:

                    ## replace NNN with a vaild, registered extension
                    
                    rasterisk -x 'sip show peer NNN' | pastebin
                    

                    Then post the pastebin link here.

                    sorry, I misunderstood

                    from asterisk 13 and chan_sip

                    https://pastebin.com/L0xX76vD

                    from asterisk 16 and PJSIP

                    https://pastebin.com/x6F0eFzX

                    JaredBuschJ 1 Reply Last reply Reply Quote 0
                    • JaredBuschJ
                      JaredBusch @rickygm
                      last edited by

                      @rickygm said in Asterisk 16/18 with push notification:

                      from asterisk 13 and chan_sip
                      https://pastebin.com/L0xX76vD

                      That output has nothing that will match the sed statement.
                      | sed -n "s/.*pn-prid=\(.*\):remote&.*/\1/p")

                      -n suppresses output except for the matched lines if /p is present.
                      /p prints the matched lines.

                      The match is a substitution pattern because of s/.
                      The substitution is looking for a line with anything .* then pn-pid= then some content being marked as a group \(.*\) until :remote& then the rest of the line .*. That marked group is the output printed /\1/p.

                      The result of that sed statement is what is stuck into the shell variable TK

                      The variable TK is what is inserted into the database as p_info that is used for the push notification logic.

                      So until you can find out what normally follows pn-pid in a command sip show peer NNN you will never be able to make any progress converting this to pjsip. Once you know what data is returned, then you can look at various pjsip commands to find something that returns the same data.

                      R 1 Reply Last reply Reply Quote 0
                      • R
                        rickygm @JaredBusch
                        last edited by

                        @jaredbusch said in Asterisk 16/18 with push notification:

                        That output has nothing that will match the sed statement.
                        | sed -n "s/.pn-prid=(.):remote&./\1/p")
                        -n suppresses output except for the matched lines if /p is present.
                        /p prints the matched lines.
                        The match is a substitution pattern because of s/.
                        The substitution is looking for a line with anything .
                        then pn-pid= then some content being marked as a group (.) until :remote& then the rest of the line .. That marked group is the output printed /\1/p.
                        The result of that sed statement is what is stuck into the shell variable TK
                        The variable TK is what is inserted into the database as p_info that is used for the push notification logic.
                        So until you can find out what normally follows pn-pid in a command sip show peer NNN you will never be able to make any progress converting this to pjsip. Once you know what data is returned, then you can look at various pjsip commands to find something that returns the same data.

                        I will wait for the developer to respond, I wrote to him asking for the db logic.

                        JaredBuschJ 1 Reply Last reply Reply Quote 0
                        • JaredBuschJ
                          JaredBusch @rickygm
                          last edited by

                          @rickygm said in Asterisk 16/18 with push notification:

                          @jaredbusch said in Asterisk 16/18 with push notification:

                          That output has nothing that will match the sed statement.
                          | sed -n "s/.pn-prid=(.):remote&./\1/p")
                          -n suppresses output except for the matched lines if /p is present.
                          /p prints the matched lines.
                          The match is a substitution pattern because of s/.
                          The substitution is looking for a line with anything .
                          then pn-pid= then some content being marked as a group (.) until :remote& then the rest of the line .. That marked group is the output printed /\1/p.
                          The result of that sed statement is what is stuck into the shell variable TK
                          The variable TK is what is inserted into the database as p_info that is used for the push notification logic.
                          So until you can find out what normally follows pn-pid in a command sip show peer NNN you will never be able to make any progress converting this to pjsip. Once you know what data is returned, then you can look at various pjsip commands to find something that returns the same data.

                          I will wait for the developer to respond, I wrote to him asking for the db logic.

                          What I posted has nothing to do with the DB logic. You are not getting a value in your sip show peer NNN that contains anything. So you are not going to write anything to the DB.

                          You need to debug that first.

                          R 1 Reply Last reply Reply Quote 0
                          • R
                            rickygm @JaredBusch
                            last edited by

                            @jaredbusch If I am interested in knowing the logic of the db, to know what you want to capture, and what you insert, the strange thing is that in FreepBX seems to work, do you use it?

                            JaredBuschJ 1 Reply Last reply Reply Quote 0
                            • JaredBuschJ
                              JaredBusch @rickygm
                              last edited by JaredBusch

                              @rickygm said in Asterisk 16/18 with push notification:

                              @jaredbusch If I am interested in knowing the logic of the db, to know what you want to capture, and what you insert, the strange thing is that in FreepBX seems to work, do you use it?

                              There is nothing to the database logic to be concerned with.

                              Like any database there are 2 bits. Insertomgupdating/deleting data and reading data.

                              In this case, shell script inserts records into i, while the Asterisk dial plan reads the database and does things if a record is found.

                              Your problem is getting the shell script to return valid data to insert into the database table. Nothing else can do anything until you have valid data to first insert into the database.

                              R 1 Reply Last reply Reply Quote 0
                              • R
                                rickygm @JaredBusch
                                last edited by

                                @jaredbusch ok got it, I will have to build my own script to be able to do this.

                                JaredBuschJ 1 Reply Last reply Reply Quote 0
                                • JaredBuschJ
                                  JaredBusch @rickygm
                                  last edited by

                                  @rickygm said in Asterisk 16/18 with push notification:

                                  @jaredbusch ok got it, I will have to build my own script to be able to do this.

                                  I have no idea how you got that out of what I said.

                                  The only thing you need to do is figure out what sip show peer NNN is supposed to return related to pn-pid. Then once that is known, it is simple enough to find a comparable item from a pjsip endpoint.

                                  R S 2 Replies Last reply Reply Quote 0
                                  • R
                                    rickygm @JaredBusch
                                    last edited by

                                    @jaredbusch yes, but I have a detail, the developer does not answer the messages, and we do not know what the pn-pid does.

                                    R 1 Reply Last reply Reply Quote 0
                                    • R
                                      rickygm @rickygm
                                      last edited by

                                      @rickygm now based on your experience, what other options are there to push with asterisk? I don't want to depend on third party services.

                                      1 Reply Last reply Reply Quote 0
                                      • S
                                        sneha @rickygm
                                        last edited by

                                        @rickygm Can you please tell me, what is the value of CALL_DESTINATION
                                        and pushneed and all variables??
                                        "${pushneed}" = "${CALL_DESTINATION}"]?

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          sneha @JaredBusch
                                          last edited by

                                          @JaredBusch hii

                                          1 Reply Last reply Reply Quote -1
                                          • S
                                            sneha @JaredBusch
                                            last edited by

                                            @JaredBusch hey

                                            1 Reply Last reply Reply Quote -1
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post