[asterisk-users] Virtual Phone for CDR Logging

Philipp Roos [Inlogia GmbH] roos at inlogia.com
Wed Dec 9 09:59:48 CST 2009


Hi,

I found a solution myself I want to share it.
The pjsua SIP client from http://www.pjsip.org does the trick.
You can run it parallel to the asterisk server, ring for a while and hang up then.

You just need to change one line in the source code to run it in background:
In pjsip-apps/src/pjsua/pjsua_app.c replace "console_app_main(&uri_arg);" with "while (1) {sleep(500);}"

Now "./configure" and "make dep && make clean && make" und run the sip client from pjsip-apps/bin
./pjsua-x86_64-unknown-linux-gnu --config-file=ringme.local.cfg

Here is my ringme.local.cfg:
--id sip:<you sip account>@<you ip>
--registrar sip:<you ip>
--realm *
--username <you sip account>
--password <your password>
--local-port=5061
--null-audio
--log-file=log.txt
--max-calls=32
--auto-answer=180
--duration=10

You need local-port to run beside asterisk.
auto-answer=180 sends a ringing responds.

Greetings
Philipp


Philipp Roos [Inlogia GmbH] schrieb:
> Hi,
> 
> I am new to the list, so I hope my questions aren't too stupid.
> 
> I am using Asterisk 1.4.21.2 and already set it up to use realtime, so a CDR for an incoming SIP call is written in my mysql database. This works fine.
> 
> The problem is that I don't want to have my phone ringing all the time. I just need a CDR of everyone how is calling me and to read out the CDR from my PHP script. I tried to replace the Dial(SIP/6000|30) command in the extensions table by Ringing(),Wait(5),Busy() but now no CDR entry is created. Same with Ringing(),Wait(5),Hangup(). Looks like I need a Dial() command for CDR.
> 
> How can I create a virtual phone of some kind, so I get a CDR entry without actually accepting the call.
> 
> Thanks in advance!
> 
> Greetings Philipp
> 
> 
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list