We are using PJSUA with FreePbx to register new sip extensions within our office , however we are having difficulties in registering new extensions .
below is the command we use with PJSUA :
./pjsua-i686-pc-linux-gnu --id=sip:[email protected]:5060 --registrar=sip:000.00.0.00:5060 --realm=* --username=99991 --password=99991 --log-file=log --log-level=6
When we run the above command we get the below Response :
13:35:59.895 pjsua_acc.c …SIP registration failed, status=403 (Forbidden (Bad auth))
ON the FreePBX (asterisk) , I see the below error under full log :
[2012-08-28 13:31:39] NOTICE chan_sip.c: Registration from ‘sip:[email protected]’ failed for ‘184.108.40.206’ - No matching peer found
can you please explain what does it mean by No matching peer found .
It means simply that you have not yet made an extension 99991 with a password 99991 on the asterisk/FreePBX box ( a very bad password for security reasons I might add )
We are trying to create a new extension from pjsua command line, hence that extension is not there on asterisk, when we create account/extension with pjsua we give all the details like the SIP url, URL of the Registrar, Auth Realm, Auth Username, Auth Password…
We were able to create a brand new extension which was not there on the asterisk/freepbx box using PJSUA earlier .
Can you please suggest any Command line way/method to create extensions other than doing it from FreePBx console .
Please help .
There is no simple way to “inject” a new extension into FreePBX, you will need to add the AMPUSER details into the asterisk database first then you will need to add tuples to the sip table in mysql, and add relevent entries into the user and device tables also to suit. Then you will need to reload the whole shebang. It is further complicated by what version of FreePBX you are trying to data to.
I query your previous ability to so do from “PJSUA earlier” please say more . . .
Below is the interactive steps from pjsua which worked couple of days ago when we added a new extension :
+a indicates adding a new account :
Your SIP URL: (empty to cancel): sip:[email protected]:5060
URL of the registrar: (empty to cancel): sip:220.127.116.11:5060
Auth Realm: (empty to cancel): *
Auth Username: (empty to cancel): 3333
Auth Password: (empty to cancel): 8abc83zxws
18:51:30.204 pjsua_acc.c Adding account: id=sip:[email protected]:5060
18:51:30.204 pjsua_acc.c .Account sip:[email protected]:5060 added with id 2
18:51:30.204 pjsua_acc.c .Acc 2: setting registration…
18:51:30.205 pjsua_core.c …TX 546 bytes Request msg REGISTER/cseq=40829 (tdta0x9eeaca0) to UDP 18.104.22.168:5060:
REGISTER sip:22.214.171.124:5060 SIP/2.0
Via: SIP/2.0/UDP 126.96.36.199:5060;rport;branch=z9hG4bKPj0dd375a7-d9e0-4954-b7cd-5ae6d1eb2025
From: sip:[email protected];tag=c2ca1504-3719-4af3-b8e4-a58d900fee24
To: sip:[email protected]
CSeq: 40829 REGISTER
User-Agent: PJSUA v2.0.1 Linux-188.8.131.52/i686/glibc-2.5
Contact: sip:[email protected]:5060;ob
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
THe Reason we want a command line way/method to create extensions is because we have another application which would make initate a service call and allocate extension to the user when they sign up .
so we would like to know it is possible instead of GUI .
Well your asterisk box seems to be accepting unknown registrations, but it has nothing to do with FreePBX. Sorry, apart from dropping FreePBX and going “realtime” with an asterisk that supports it, I can’t think of an answer to your problem. There are some decent sip proxies out there that handle that sort of thing securly (unlike your server apparently) and from scripts. , look at Kamailio for starters.