I need the "pn-tok" value

ok, no problem, will look further :slight_smile:

Hey, i was trying the approach
the cfg looks like below, just added the hf/body part and the t_rela;

	if (is_method("REGISTER")) {
		

		append_hf("Expires: 900\r\n");
		add_body_part("<regXML>\n<version>V2.0.0</version>\n<regDevName>test</regDevName>\n<regDevSerial>Q05659369</regDevSerial>\n<regDevMacAddr>00:0c:29:fa:48:51</regDevMacAddr>\n</regXML>", "text/xml");

		t_relay();
		exit;  

In asterisk runs on port 5050 , ip 192.168.0.17
Opensips runs on port 5060 , ip 192.168.0.181
registration for trunk 192.168.0.71:5065

config:

[opensips-auth]
type=auth
auth_type=userpass
password=xxx
username=10000000004
 
[opensips-aor]
type=aor
contact=sip:192.168.0.17:5050
qualify_frequency=300

[opensips-registration]
type=registration
outbound_auth=opensips-auth
server_uri=sip:192.168.0.71:5065
client_uri=sip:10000000004@192.168.0.71:5065
retry_interval=30
outbound_proxy=sip:192.168.0.181\;lr
 
[opensips]
type=endpoint
context=default
disallow=all
allow=ulaw,alaw
allow=h264,vp8
outbound_auth=opensips-auth
aors=opensips-aor
rewrite_contact=yes
outbound_proxy=sip:192.168.0.181\;lr
 
[opensips]
type=identify
endpoint=opensips
match=192.168.0.17

But as you can see in screenhos below, i dont get any response back, any idea?

when i do it with an UAC registrant on opensips (old setup), then it works
But what i do see, is that the from + to is adding the port 5065 , thats correct, there i want to register on…
i dont see that in the other screenshot, allthough i have it in my pjsip config:

I do see the port here though:
[Jun 15 14:47:30] WARNING[591]: res_pjsip_outbound_registration.c:894 schedule_retry: No response received from 'sip:10000000004@192.168.0.71:5065' on registration attempt to 'sip:10000000004@192.168.0.71:5065', retrying in '30'

server_uri=sip:192.168.0.71:5065
client_uri=sip:10000000004@192.168.0.71:5065

any idea?

``

EDIt, it doesnt seem to add the body/header, so maybe i’m putting it on wrong location in the cfg file, not sure where i need to add it…

Try running sngrep on the opensips server instead, that’ll allow you to see both sides of the conversation. Perhaps opensips is not relaying the message to your provider as expected, or perhaps it’s not handling the reply correctly. (I’m quite sure replies to existing dialogs are handled separately in kamailio and I expect opensips to be no different in that regard.)

that was an sngrep on the opensips server :slight_smile:

And that was the only dialog you got? In that case, something’s wrong with the opensips config…

Anyway, the best place to get help on opensips seems to be their IRC channel, it’s listed here: openSIPS | Community / Networking

ok, will have a look :slight_smile:

@Chano , seems its now pn-prid, not pn-tok anymore
you can see it indeed when you do : “database show registrar” , then the token is there

With chan_pjsip or chan_sip?

It’s been YEARS since I last used chan_sip. :wink:

Also you would need to store it somewhere else, as you can not find it in the registration, when the client is NOT registered. Which for cellphone clients would be most of the time, as the contact changes whenever they switch between wireless networks and potentially cell towers as well.

And as Asterisk does not seem to have a reliable way of reacting to registrations, there’s no reliable way to get the token for storage.

With pjsip :slight_smile:

Also have a look at my discussion with the owner of that android script, he claims he is not storing the token. And is still able to send the push… He updated his new version this week… But the script is huge, still need to understand how he does it…

In android land, applications can run in the background, keeping the connection alive, at least last I checked. Not so in iOS land.

From reading the bash script, it makes no sense how it will work, if the client does not have an active registration. So if you want to use it, you need to make sure the registration never expires. That is set the timeout so high, it’s unlikely to expire before you the next start.

Eg. you use the app on average every 3 hours, you set the registration expiry no less than 6 hours, or whatever makes sense for you. If the registration expires, that script has no obvious way to get the data, as it looks at the AOR from pjsip, and no AOR will be available without a registration.

You will also need to make sure the softphone app does NOT unregister whenever it shuts down.

Indeed, my thoughts exactly…

Also in linhome, they don’t have a background mode yet, only push… so just closing app, makes the register flush…
But it’s good that token doesn’t change, unless you do an uninstall… Good enough for me

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.