Need to set Outbound CID of Asterisk server from PJSIP client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In my PJSIP app:

	pjsua_msg_data md;
	pjsua_msg_data_init(&md);
	pjsip_generic_string_hdr hdr1, hdr2, hdr3, hdr4;
	pj_str_t hvalue, hname;

	if (inCID && strlen(inCID) == 10 && IsAllDigits(inCID)) {
		hname = pj_str("X-ASD-CID");
		pj_cstr(&hvalue, inCID);
		pjsip_generic_string_hdr_init2(&hdr4, &hname, &hvalue);
		pj_list_push_back(&md.hdr_list, &hdr4);
	}

Dialplan (this is for an admittedly old asterisk install.)

exten => _7XXXXXXXXXX,1,Set(CALLERID(num)=${SIP_HEADER(X-ASD-CID)})
exten => _7XXXXXXXXXX,n,Goto(outgoing,${EXTEN:1},1)


Norman Franke
Answering Service for Directors, Inc.
www.myasd.com



On Jul 19, 2012, at 5:12 PM, Sandip Dhummad wrote:

> First of all, I really appreciate the quick response from you. I went crazy 2 days on Google and did not find anything meaningful. 
> 
> Numbers are good enough for me. Would it be possible for you to provide me some code snippet at PJSIP as well as at Asterisk level? 
>  
> Thanks for your help!!
> 
> Thanks & Regards,
> Sandip Dhummad
> 
> From: Norman Franke <norman@xxxxxxxxx>
> To: Sandip Dhummad <sandipmit at yahoo.com>; pjsip list <pjsip at lists.pjsip.org> 
> Sent: Thursday, July 19, 2012 5:05 PM
> Subject: Re: Need to set Outbound CID of Asterisk server from PJSIP client
> 
> I've done something similar, although just number in our case. Names aren't transmitted across the public phone network. To do this, I added a custom header and then have a dial plan rule that extracts it and sets the appropriate variables for Asterisk. 
> 
> Norman Franke
> Answering Service for Directors, Inc.
> www.myasd.com
> 
> 
> 
> On Jul 19, 2012, at 5:01 PM, Sandip Dhummad wrote:
> 
>> Hi There,
>> 
>> I am working on writing VoIP  soft phone interface interacting with Asterisk PBX server. I decided to use PJSIP libraries in back end. The code works perfectly fine for making outbound calls. Recently I got a request to allow user to set their outbound CID(Caller ID) number/name from soft phone interface. I have already tested that functionality at Asterisk server level through a Java program invoking Asterisk API overriding the Outbound CID with user defined value. It works perfectly fine. I want to implement same function on my PJSIP based soft phone. I did not find any property called Outbound CID either at pjsua_acc_config struct level and/or at pjusa_call_make level. 
>> 
>> I had searched on Google to find a solution. I found few things that can solve the problem but none of them worked.
>> 1. Set display name in front of From SIP URL, like "John" <sip:####@###.###.##.##>
>> 2. Set force_contact property of pjsua_acc_config struct as an URL similar to above URL
>> 
>> Please help!! Thanks in advance for the same!!
>> Thanks & Regards, 
>> Sandip Dhummad
>> _______________________________________________
>> Visit our blog: http://blog.pjsip.org
>> 
>> pjsip mailing list
>> pjsip at lists.pjsip.org
>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> 
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20120719/87e0f147/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux