Asterisk 16/18 with push notification
-
@jaredbusch yes, this is the data with which the endpoint could be contacted.
-
@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.
-
@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
and debug
-
@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
from asterisk 16 and PJSIP
-
@rickygm said in Asterisk 16/18 with push notification:
from asterisk 13 and chan_sip
https://pastebin.com/L0xX76vDThat 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.*
thenpn-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 variableTK
The variable
TK
is what is inserted into the database asp_info
that is used for the push notification logic.So until you can find out what normally follows
pn-pid
in a commandsip show peer NNN
you will never be able to make any progress converting this topjsip
. Once you know what data is returned, then you can look at variouspjsip
commands to find something that returns the same data. -
@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.
-
@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.
-
@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?
-
@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.
-
@jaredbusch ok got it, I will have to build my own script to be able to do this.
-
@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 topn-pid
. Then once that is known, it is simple enough to find a comparable item from apjsip
endpoint. -
@jaredbusch yes, but I have a detail, the developer does not answer the messages, and we do not know what the pn-pid does.
-
@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.
-
@rickygm Can you please tell me, what is the value of CALL_DESTINATION
and pushneed and all variables??
"${pushneed}" = "${CALL_DESTINATION}"]? -
@JaredBusch hii
-
@JaredBusch hey
-
Good way to make me not care about answering you.